Hi, I am using dynamic SQL to do the update. I face difficulty when I want to filter my query using any string.
For example - where attribute1 = 'ABC' - It doesn't allow that and consider ABC as a column name. I did lot of research and tried vairous methods like ' "ABC" (with double quotes), '"ABC"' (with one single and one double quote) - But nothing works.
Can anyone please help me out ?
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 ?