Home » SQL & PL/SQL » Client Tools » SQLPLUS - then /else run script.sql (oracle, sqlplus)
SQLPLUS - then /else run script.sql [message #570301] Wed, 07 November 2012 15:14 Go to next message
Messages: 1
Registered: November 2012
Junior Member
I am having trouble with the script below, would anyone have any suggestions or be able to help me out?

I am trying to do a case statement where I select to see if an ID exists or not and if it doesnt i want to run a .sql file but its not working properly.
select case when exists (select ID from VERSION where ID = '16.1')
then 'ID Exists'
else @script.sql
from dual;

Its not allowing me to run the @script.sql with the else statement...does anyone have any suggestions?

Re: SQLPLUS - then /else run script.sql [message #570302 is a reply to message #570301] Wed, 07 November 2012 15:18 Go to previous message
Messages: 21648
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A similar problem was discussed a few days ago; have a look.
Previous Topic: SQL Tool to Use with InForm?
Next Topic: Conditionals in a SQLPlus batch file
Goto Forum:

Current Time: Fri Jan 22 20:42:21 CST 2021