|
|
|
Re: How to handle null values in function having dynamic sql [message #613774 is a reply to message #613770] |
Mon, 12 May 2014 04:26 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
The code is unreadable. Also, it has syntax errors. That function won't even compile.
na.dharma@gmail.com wrote on Mon, 12 May 2014 14:32Currently I am handling not null values but now I need to handle null values for all rec.FB_LVL as well.
IF you know how to handle NOT NULL values, then what is stopping you from handling NULL values? At first glance it looks like you just need a simple IF-ELSE construct. What exactly is the issue?
[Updated on: Mon, 12 May 2014 04:28] Report message to a moderator
|
|
|
|
Re: How to handle null values in function having dynamic sql [message #613781 is a reply to message #613780] |
Mon, 12 May 2014 05:14 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
1. Why don't you use code tags?
2. What are the rules for the IS NULL condition? How would I or anyone know about the logic which you are keeping secret with yourself?
IF REC.FB_LVL2 IS NOT NULL
THEN
IF REC.FB_LVL2_FLAG = 'I'
THEN
QRY := QRY || '
AND FB_LVL2 IN (' || REC.FB_LVL2 || ')';
ELSE
QRY := QRY || '
AND FB_LVL2 NOT IN (' || REC.FB_LVL2 || ')';
END IF; -- nested scope ends here
<< Your IS NULL condition goes here >> -- this is with the main scope
END IF; -- this ends the main scope to check NULL values
|
|
|
|
|
|
Re: How to handle null values in function having dynamic sql [message #613787 is a reply to message #613784] |
Mon, 12 May 2014 05:28 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
na.dharma@gmail.com wrote on Mon, 12 May 2014 15:49Apologies for the incovienece as previously I have psted the wrong code..
Do you also see what I see :
Michel Cadot wrote on Mon, 12 May 2014 14:38you refuse to follow the guide.
Lalit Kumar B wrote on Mon, 12 May 2014 14:56The code is unreadable.
Lalit Kumar B wrote on Mon, 12 May 2014 15:44Why don't you use code tags?
cookiemonster wrote on Mon, 12 May 2014 15:45I know you know how to use code tags, so stop being lazy and use them.
|
|
|
|
|
|