Could someone suggest the most CONCISE way to have SQL, NOT PL/SQL to verify that a value exist in a table and if the value exist, continue with the script, otherwise exit?
I know this is a simple matter in PL/SQL, but I'm curious of the method to do it in SQL.
You've not said which version so I've assumed 9i in which the following will work.
Code:
SELECT *
FROM table
WHERE (SELECT condition_column FROM condition_table) = condition_to_proceed
eg.
If you have a STATE table with a column TEST and you want to make sure TEST = 1 to proceed your statement would look like
SELECT *
FROM any_table
WHERE (SELECT test FROM state) = 1;
Hope that helps
Jim
Oracle Certified Professional "Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Bookmarks