Rao_S
asked on
How can i use variables in select statement?
hi, i have to use variables in select statement including a constant value, table name, and where clause, like so..
execute immediate 'INSERT INTO table1 USING SELECT '
||lv_source
||', '
||'col1, col2, col3 FROM '
||lv_tablename
||'WHERE TEMPLATE_NAME LIKE '
||CHR (39)
||lv_likevalue
||CHR (39);
execute immediate 'INSERT INTO table1 USING SELECT '
||lv_source
||', '
||'col1, col2, col3 FROM '
||lv_tablename
||'WHERE TEMPLATE_NAME LIKE '
||CHR (39)
||lv_likevalue
||CHR (39);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you sdstuber, it worked!
i have to add another cursor and pass mutiple 'lv_likevalue', let me test that too...
i have to add another cursor and pass mutiple 'lv_likevalue', let me test that too...
ASKER
thank you sdstuber, works correctly!!
ASKER
Error: Error in loading:table1-933ORA-0093