Home » SQL & PL/SQL » SQL & PL/SQL » Error checking in procedure (Oracle 10g)
Error checking in procedure [message #331366] Thu, 03 July 2008 02:35 Go to next message
psychoconker
Messages: 8
Registered: July 2008
Junior Member
I have a Customer ID provided in a procedure for booking an event and I need to check to see if the customer is in our system, What would be the best way to go about this?

I Thought about running a select statement to see if it finds it in the database but I couldn't really think of a way to check if it found it.. Its late and I can't think


Re: Error checking in procedure [message #331368 is a reply to message #331366] Thu, 03 July 2008 02:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a good night and think back to it tomorrow.

Regards
Michel
Re: Error checking in procedure [message #331369 is a reply to message #331366] Thu, 03 July 2008 02:43 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
If you can't think of a way, only because it's late, then you are WELL overdue your stopping time. Structures like these are etched in your mind; no matter what time, even if they wake you up in the middle of the night, you should be able to offer at least two varieties of these.
So, stop working, or stop pretending. It's not a bad thing to be a "newbie" (hate that word) in programming or in PL/SQL; we all were at one time! If you pretend to be more, and actually are not, you will get answers you cannot work with.

Two possible ways (out of several):
- select into and catch the no_data_found exception
- select count(*) from dual where exists
Re: Error checking in procedure [message #331509 is a reply to message #331366] Thu, 03 July 2008 12:56 Go to previous messageGo to next message
mandeepmandy
Messages: 79
Registered: May 2008
Location: USA
Member

Only SELECT is the Way Smile
Re: Error checking in procedure [message #331513 is a reply to message #331509] Thu, 03 July 2008 13:13 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
mandeepmandy wrote on Thu, 03 July 2008 18:56
Only SELECT is the Way Smile

What on EARTH is this supposed to mean and how does it add to/ improve upon Frank's answer?
Previous Topic: Pls help in writing query
Next Topic: Problem with ELSE SQL%NOTFOUND THEN !!!
Goto Forum:
  


Current Time: Mon Dec 05 06:56:10 CST 2016

Total time taken to generate the page: 0.05026 seconds