Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to use varchar variable of input type in procedure.

646894Jan 19 2010 — edited Jan 19 2010
Hello,

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.
This post has been answered by Twinkle on Jan 19 2010
Jump to Answer

Comments

Mtshepana

Why is there so much ephasis on JET not being a framework?

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 16 2010
Added on Jan 19 2010
10 comments
973 views