-
sql query
Hello,
lets say i have a query like
select isin_no from test_asset where isin_no = 'CH0024899483';
and the query returns 'no data found' error ora-01403
can we compare like
if (select isin_no from test_asset where isin_no = 'CH0024899483') = 'ora-01403' then
...
end if;
-
Is it part of a PL/SQL block, isn't it?
You have to include EXCEPTION section with an entry for WHEN NO_DATA_FOUND THEN do-whatever-you-have-to-do-in-this-case
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
Hi,
it is part of a plsql block.
But if the control gets into the exception block we cant get into main block again right?
i need to continue with the main block after this process..is it feasible?
-
If that's the case I would add logic to test if there is a row matching your condition then, if the row exists read it.
You can test resorting to an IF EXIST clause or a select count(*) > 0
Having said that, I would certainly include an EXCEPTIONS section.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
Hi Pavb,
its worked with select count(*)...
thanks a lot.
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
|