That Helped. Thanks.
One more question, I need to pass string as parameter and need to use in WHERE clause. For example in a dynamic SQL,
'SELECT * FROM DBC.COLUMNS WHERE TABLENAME =' || TB1 || .. ;
The above doesn't work as say when I pass TB1= 'SRC_TB' - it doesn't go as 'SRC_TB'. It goes as SRC_TB (without any quotes) and that throws an error. I tried few options like below but nothing worked.
'SELECT * FROM DBC.COLUMNS WHERE TABLENAME =' || ''TB1'' || ... ;
'SELECT * FROM DBC.COLUMNS WHERE TABLENAME =' || '' || TB1 || '' || .... ;
Any suggestions ?
Thanks.
↧