0

I have a stored procedure called logger(message), where message is of type varchar2.

When I execute just

 exec logger('hello'); 

it says anonymous block completed, and what this procedure does is just insert a record in another table.

However, when I use it as a part of script say:

  Begin

    select count(*) into countCol from USER_TAB_COLUMNS where TABLE_NAME = 'EVAPP_INTERFACE_APPENTITY' and COLUMN_NAME = 'ORIGPTI_NUM' and DATA_SCALE is null; 
  IF    (countCol <> 0) then   

 execute immediate 'alter table EVAPP_INTERFACE_APPENTITY add ORIGPTI_NUM_TMP NUMBER(14,2)' ; 

 execute immediate 'update EVAPP_INTERFACE_APPENTITY set ORIGPTI_NUM_TMP = ORIGPTI_NUM' ; 

 execute immediate 'alter table EVAPP_INTERFACE_APPENTITY drop column ORIGPTI_NUM' ; 

 execute immediate 'alter table EVAPP_INTERFACE_APPENTITY rename column ORIGPTI_NUM_TMP to ORIGPTI_NUM' ; 


 DBMS_OUTPUT.put_line('This column EVAPP_INTERFACE_APPENTITY.ORIGPTI_NUM has been modified to the required precision'); 
   END IF; 

  execute logger(' first insert');

I get this error saying :

  Error report:
  ORA-06550: line 27, column 10:
  PLS-00103: Encountered the symbol "LOGGER" when expecting one of the following:

   := . ( @ % ; immediate
   The symbol ":=" was substituted for "LOGGER" to continue.

I tried execute immediate and just inserting logger() , but nothing works.

And I haven't had much help with google when I tried searching for execute stored procedure in script. How do I call this procedure?

1 Answer 1

5

Remove the word "execute" from that line:

logger(' first insert');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.