Nish animal69
Nish animal69

Reputation: 23

getting 'ORA-00922: missing or invalid option' error when I'm trying to run the below plsql code. how to solve it?

SET SERVEROUTPUT ON;
DECLARE
 var_test1 VARCHAR2(30) := 'RebellionRider';
BEGIN
    DBMS_OUTPUT.PUT_LINE (var_test1);
END;

Whenever im running the above code im getting the following error. Im using oracle apex to run my code. how to solve it?
Error:-

ORA-00922: missing or invalid option

BEGIN
     DBMS_OUTPUT.PUT_LINE (var_test1);
END;  

Upvotes: 0

Views: 600

Answers (2)

Jhonatas Menezes
Jhonatas Menezes

Reputation: 16

When you are on developer environment, you can to select only the text you want run, so press F5 or click run. This will also working.

Upvotes: 0

Littlefoot
Littlefoot

Reputation: 142705

As you use Apex, where exactly did you run that code? It works just fine in its SQL Workshop (SQL Commands).

Just remove SET SERVEROUTPUT ON, it is SQL*Plus command to enable the output, it is

  • meaningless in Apex
  • raises ORA-00922 (in Apex)

Upvotes: 5

Related Questions