on 02-23-2010 5:56 PM
Hi
I want to use a global variable inside a SQL Transformation, but I got an error in the runtime. This makes me think there is no preprocessing of the text inside the Transformation. Is there a way to work around this ?
Can I change dynamically the contents of the SQL Transformation ?
Example:
select productid, productname from products where year = $YearGV
I tried enclosing the variable with {} [] and () but with no luck.
Any help would be appreciated.
Paolo
you can use Global Variables in SQL Transfrom, what is the error you are getting ?
what is the datatype of Global variable ? since you are comparing with year then it should be Date or DateTime, and you have to enclose this in [ ]
for example:- YEAR = [$YearGV]
if you enable the trace for SQL reader you can see the SQL Statement that is submitted to the database
you will not be able to Update Schema with refrences of global Variable since the variable substitution happens at runtime not at design time, so for update schema, use SQL Statment without Global variable, once schema is updated add the global variable
for example:
to update schema use
SELECT * FROM SCOTT.EMP
after update schema
SELECT * FROM SCOTT.EMP WHERE SAL > [$GV_SAL]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.