2

I have a question regarding defining two functions back to back with PL/SQL. Below is the code I have:

create or replace procedure test2(mynum in integer, retnum out integer)
as
begin
    DBMS_OUTPUT.put_line(mynum + 1);
    retnum := 1000;
end;



create or replace procedure test3(mynum in integer, retnum out integer)
as
begin
    DBMS_OUTPUT.put_line(mynum + 1);
    retnum := 1000;
end;

When I run it I get the following error, but when I create the functions separately I do not. Am I missing some keyword to separate the two declarations?

Procedure TEST2 compiled

LINE/COL ERROR


10/1 PLS-00103: Encountered the symbol "CREATE" Errors: check compiler log

3
  • rextester.com/LZFQFA22750 check the link i ran it and works properly Commented Oct 7, 2018 at 2:01
  • 7
    I'm guessing that you're using SQLPlus as your database client. Add a / on a line by itself after the END; for each procedure. Best of luck. Commented Oct 7, 2018 at 2:03
  • 3
    You need a delimiter between the two functions. As @BobJarvis said, it should be a /. Commented Oct 7, 2018 at 2:15

1 Answer 1

4

After every PL/SQL statement you should properly end it by adding / on a separate line as this is the "master delimiter".

Try to save your script as this:

create or replace procedure test2(mynum in integer, retnum out integer)
as
begin
    DBMS_OUTPUT.put_line(mynum + 1);
    retnum := 1000;
end;
/

create or replace procedure test3(mynum in integer, retnum out integer)
as
begin
    DBMS_OUTPUT.put_line(mynum + 1);
    retnum := 1000;
end;
/
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.