Home » SQL & PL/SQL » SQL & PL/SQL » nested if
nested if [message #248654] Fri, 29 June 2007 23:07 Go to next message
apuw
Messages: 13
Registered: June 2007
Junior Member
I am having problems with nested if statements in order to raise exceptions on invalid conditions .

How can I use
if (last is NuLL) || (first is NULL) || (middle is NULL) then raise exception;

I have a block similar to

if comma > 0 then
street1 := substr(line,comma);
zip := substr(line,space);
city := substr(line ,comma,space);
elsif space != 0 then
<<< another street , city , zip expressions>>

If any of street , city or zip part is missing then it should call exception.
i tried nested if ..elsif it didnt work;
Re: nested if [message #248655 is a reply to message #248654] Fri, 29 June 2007 23:17 Go to previous message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
Please read & FOLLOW ALL posting guidelines as enumerated in #1 STICKY post at top of forum.

"didnt work; " is not a recognized Oracle error.

My car is a blue 4 door sedan.
My car didn't work.
Please tell me how to fix it.

Do yourself & us a favor, Read The Fine PL/SQL Reference Manual as found at:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm

Many fine coding examples can be found at http://asktom.oracle.com

If/when NEITHER answers your question, then post back here!

P.S.
Using nested IF is NOT required to implement requirements.

[Updated on: Fri, 29 June 2007 23:28] by Moderator

Report message to a moderator

Previous Topic: INSTR function (merged)
Next Topic: How to read CSV file and insert the same into a oracle table?
Goto Forum:
  


Current Time: Wed Dec 07 16:26:19 CST 2016

Total time taken to generate the page: 0.11051 seconds