Back to Index |

Output as Expression

To give the developer more flexibility in the generation of the output SQL statements, BlueSky Integration Studio includes an option called 'Output as Expression'. This option is only available on SQL based data objects such as the .NET Data Provider, MS SQL, OleDb and Odbc

When data is output using the output as expression feature, the developer is responsible for formatting the actual string that will be inserted into the SQL statement for the selected column. In fact, quite literally, BlueSky Integration Studio simply takes the expression string and inserts it directly into the SQL statement.

For instance, if you have a column called a1.PRODUCT and the current value = 12345

Your code might look something like this when output as an expression:

Notice that BlueSky Integration Studio will simply insert whatever expression string your code returns into the output SQL statement. You as the developer are responsible for knowing how the string should be formatted. The above is a simple string example, but you will see that this feature has unlimited possibilities allowing you to tap into all of your database specific features.

In the above example, we returned a string column which is why we had to also include the single quotes. If this were a numeric database column we would not have included the single quotes.

Where is it?

The Output to Expression option is located on the Code Window for all SQL based output data objects. You will notice that the functions return value changes from the original column type to a String when this option is used. Again, BlueSky Integration Studio is simply inserting whatever expression is returned into the SQL string that is sent to the database.

Using Database Specific Features

The real power in this features comes from the ability to now use any specific database feature you choose, because you can simply return any expression you want. For instance, Oracle® Databases have a feature called sequences that returns a sequential list of numbers that you can use as unique key id's for your table data. To use this feature now, you can simply return it as an expression. In the column's code window, you would Return the necessary string, and BlueSky Integration Studio will insert that string value into the SQL Statement.

Replacing 0's with NULL

Another common use of expressions is when you want to insert NULL's into numeric database columns with instead of 0. You would simply select the Output as Expression check box (shown down below...), and simply write the following code:

© 2003 - 2007 Relational Solutions, Inc. - All rights reserved