-
I am trying to parse table name as a variable for an insert operation (ex: insert into table1(col1) values('HELLO')). But could not get it to work:
create or replace procedure insert_table (table_in in varchar2)
as
mysql varchar2(200);
begin
mysql := 'insert into '||table_in||'(col1) values('HELLO')'
execute immediate mysql;
end;
/
Errors for PROCEDURE INSERT_TABLE:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/52 PLS-00103: Encountered the symbol "TOM" when expecting one of the
following:
. ( * @ % & = - + ; < / > at in mod not rem
<> or != or ~= >= <= <> and or like
between is null is not || is dangling
Please help! Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|