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
jwmayhew13@gmail.com
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
end
from dual;

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

Thanks.
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
Littlefoot
Messages: 19335
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: Wed Jul 30 10:44:38 CDT 2014

Total time taken to generate the page: 0.16530 seconds