on 03-26-2012 9:08 PM
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?
edit:
got this to work
sql('SAP_TST', 'select count(*) from TABLENAME where STATUS = \'P\'')
Thanks!
Shaun,
Instead of table name try using datastore name in the beginning.
sql('datastorename','...............');
Thanks,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the suggestion, unfortunately I'm still getting this error. Could it be the count(*) not being allowed in the SQL() function?
error message:
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
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.