Home » SQL & PL/SQL » SQL & PL/SQL » problem with procedure error
problem with procedure error [message #37460] Fri, 08 February 2002 13:57 Go to next message
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 Go to previous messageGo to next message
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;
Re: problem with procedure error [message #39537 is a reply to message #37460] Mon, 22 July 2002 19:54 Go to previous message
kzshoiecik
Messages: 1
Registered: July 2002
Junior Member
dirjkj, kijejk kijjke
Previous Topic: Scheduling of procedures
Next Topic: i want to select followinf word using substr and instr
Goto Forum:
  


Current Time: Fri Apr 19 18:23:27 CDT 2024