procedure not compiling
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: procedure not compiling

  1. #1
    Join Date
    Mar 2001
    Location
    south africa
    Posts
    401

    procedure not compiling

    i am writing simple procedure but its erroring out due to alter
    this is on logical standby

    Code:
    create or replace PROCEDURE pr_test
    as 
    begin
      declare
        user       VARCHAR2(50 BYTE);
         adfg      VARCHAR2(50 BYTE);
        
      begin
       alter session disable guard;
    insert into AUDIT values (  user,adfg,sysdate);
    commit;
    alter session enable guard;
    end;
    end;
    it throws the following error

    Code:
    SQL> show errors
    Errors for PROCEDURE PR_LOGACCESS:
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    8/4      PLS-00103: Encountered the symbol "ALTER" when expecting one of
             the following:
             begin case declare exit for goto if loop mod null pragma
             raise return select update while with 
               <<
             close current delete fetch lock insert open rollback
             savepoint set sql execute commit forall merge pipe
    any help is appreciated

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    you are using sqlplus commands in plsql, cant do that unless you use execute immaediate

  3. #3
    Join Date
    Mar 2001
    Location
    south africa
    Posts
    401
    thank you ..appreciate your time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width