problem with procedure error [message #37460] |
Fri, 08 February 2002 13:57 |
Lance Pris
Messages: 40 Registered: January 2002
|
Member |
|
|
Could you please look at the following code and see what I am doing wrong? I do not understand why I am getting errors.
Thanks in advance
Lance
Here is my statement:
Create or Replace Procedure Primus_Temp_Dump( in_tab_name in varchar2) as
Dump_Stmt varchar2(2000);
Begin
Dump_Stmt := 'TRUNCATE TABLE '||in_tab_name;
Execute Immediate Dump_Stmt;
Exception
when others then
DBMS_OUTPUT.PUT_LINE(Primus_Temp_Dump( error other exceptions');
End;
/
set arrarysize 1
show errors;
I get the following error when I compile it in Toad:
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one of the following:
:= . ( @ % ;
In SQLplus I get this:
Warning: Procedure created with compilation errors.
SQL> set arrarysize 1
SP2-0158: unknown SET option "arrarysize"
SQL> show errors;
Errors for PROCEDURE PRIMUS_TEST_DUMP:
LINE/COL ERROR
-------- -----------------------------------------------------------------
7/9 PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one
of the following:
:= . ( @ % ;
|
|
|
Re: problem with procedure error [message #37466 is a reply to message #37460] |
Sun, 10 February 2002 23:07 |
Satish Shrikhande
Messages: 167 Registered: October 2001
|
Senior Member |
|
|
Create or Replace Procedure Primus_Temp_Dump( in_tab_name in varchar2) as
Dump_Stmt varchar2(2000);
Begin
Dump_Stmt := 'TRUNCATE TABLE '||in_tab_name;
Execute Immediate dump_stmt ;--'TRUNCATE TABLE '||in_tab_name;
exception
when others then
dbms_output.put_line('Err '||sqlcode ||' '||sqlerrm);
End;
|
|
|
|