I have a sql file which has the following statments:
BEGIN
if (&&masterKey = 1) then
shutdown immediate;
startup restrict;
end if;
END;
/
In a different SQL file (defineVariables.sql) I have declared the variable masterKey.
DEFINE masterKey = 0;
and imported that sql here using
@defineVariables.sql
While I execute the script I get the following error. I am not sure if its because I use the shutdown statement? Can someone please help me with this query?
Error Message:
SQL> BEGIN
2 if (&&masterKey = 1) then
3 shutdown immediate;
4 startup restrict;
5 end if;
6 END;
7 /
old 2: if (&&masterKey = 1) then
new 2: if (0 = 1) then
shutdown immediate;
*
ERROR at line 3:
ORA-06550: line 3, column 10:
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one of the
following:
:= . ( @ % ;
ORA-06550: line 5, column 1:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior
shutdowncommand.