I'm trying to implement a sql function in a while loop and I am running into some errors. No matter what combonation I try Data services doesn't like the syntax.
Please see below for an example of what I'm using:
sql('TABLENAME','select count(*) from TABLENAME where TABLENAME.status = \'U\'')
I always get a "Found erroneous expressions" error. I've check spelling etc... and it seems to be ok, am I missing something with syntax? Doesn anyone have any hints for working with while loops or using the sql() function?
got this to work
sql('SAP_TST', 'select count(*) from TABLENAME where STATUS = \'P\'')
thanks for the suggestion, unfortunately I'm still getting this error. Could it be the count(*) not being allowed in the SQL() function?
VAL-030159 3/26/2012 2:26:59 PM Found erroneous expression <sql('SAP_TST','select count(*) from TABLE where TABLE.STATUS = \'U\'')>. Check its syntax and fix
I'm not using a semi-colon anywhere, the formatting is the same as what i typed above except the table name is different.
What I'm trying to do is execute a while loop until the record count = 0. So I'm trying to include the sql statement in my while loop condition so that I can check the record count of a table.
So something like
while( sql( select count(*) from table)) != 0 )
Perform data flow tasks