ORACLE/PLSQL: ORA-06550

You tried to execute an invalid block of PLSQL code (like a stored procedure or function), but a compilation error occurred.

Check the parameters or  variables.

SQL> CREATE OR REPLACE PROCEDURE BOOM
  2  AS
  3    vnum number;
  4  BEGIN
  5    vnum := vBoomVal;
  6  END;
  7  /

As you can see, the error is caused by the variable called vBoomVal not being declared. To resolve this error, we can modify our Boom procedure to declare the variable as follows:
SQL> CREATE OR REPLACE PROCEDURE BOOM
  2  AS
  3    vnum number;
  4    vBoomVal number;
  5  BEGIN
  6    vBoomVal := 999;
  7    vnum := vBoomVal;
  8  END;
  9  /
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: