Unable to use varchar variable of input type in procedure.
646894Jan 19 2010 — edited Jan 19 2010Hello,
I have created as simple procedure.. its as follows..
SQL> CREATE OR REPLACE PROCEDURE
2 input_columns
3 (
4 table_name IN user_tab_columns.table_name%TYPE,
5 ignore_columns IN VARCHAR2(90)
6 ) IS
7 stmt VARCHAR2(3000);
8 BEGIN
9 stmt := 'INSERT INTO ignore_columns VALUES ('||table_name||', '||ignore_col
umns||')';
10
11 EXECUTE IMMEDIATE stmt;
12
13 END;
14 /
Warning: Procedure created with compilation errors.
SQL> show errors;
Errors for PROCEDURE INPUT_COLUMNS:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/27 PLS-00103: Encountered the symbol "(" when expecting one of the
following:
:= . ) , @ % default character
The symbol ":=" was substituted for "(" to continue.
The table ignore_columns has been created.
If i remove the size of the variable ignore_columns or if i define it as a number the procedure gets created successfully.
When i don't define the size of the variable, I cannot pass parameters for ignore_columns column. Could you please help me.
Thanks.