Workkkkk
Workkkkk

Reputation: 285

PL/SQL Trying to execute a very simple procedure

I know this is a very stupid question, but I just can't get this to work. I get an error saying that identifier hello must be declared

CREATE OR REPLACE PROCEDURE hello (p_name IN VARCHAR2) 
IS
BEGIN
dbms_output.put_line (‘Welcome '|| p_name);
END hello;
/

EXECUTE hello('JOHN');

Upvotes: 0

Views: 45

Answers (1)

Littlefoot
Littlefoot

Reputation: 142713

Everything's fine, except the first single quote in DBMS_OUTPUT call:

SQL> CREATE OR REPLACE PROCEDURE hello (p_name IN VARCHAR2)
  2  IS
  3  BEGIN
  4  dbms_output.put_line ('Welcome '|| p_name);
  5  END hello;        --  ^ change this one
  6  /

Procedure created.

SQL> EXECUTE hello('JOHN');
Welcome JOHN

PL/SQL procedure successfully completed.

SQL>

Upvotes: 3

Related Questions