|
-
What you may be wanting to do is raise an error if a value exists in a table, or if it doesn't, and let SQL Plus exit on error.
Something like ...
select x from dual where exists(select 1 from my_table where my_column = 'VALUE')
... will be a fast way of detecting whether a value exists in my_table, and ..
select to_number('X') from dual where exists(select 1 from my_table where my_column = 'VALUE')
... will cause an error if the value is found. since you want the opposite, you might like to try ...
select decode(row_flag,0,to_number('X'),null)
from
(select count(*) from dual where exists(select 1 from my_table where my_column = 'VALUE'))
I haven't tested this, and I'm sure there would be variations on the theme.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|