-
Hi,
Can someone help me to see the following codes which is part of the trigger, I just like to make sure the syntax is correct.
if (nvl(:new.keypart1_use,'nothing') = 'nothing') then
v_keypart1indic := 0;
else
v_keypart1indic := 1;
end if;
if (nvl(:new.keypart2_use,'nothing') = 'nothing') then
v_keypart2indic := 0;
else
v_keypart2indic := 1;
end if;
if (nvl(:new.keypart3_use,'nothing') = 'nothing') then
v_keypart3indic := 0;
else
v_keypart3indic := 1;
end if;
-
Actually, I would use:
v_keypart1indic := DECODE ( :new.keypart1_use, NULL, 0, 1);
Actually, however, if you look at my suggestions to your original post, you will see that you should really fill these in the EXCEPTION block:
...
v_keypart1indic := 1;
...
EXCEPTION
---WHEN NO_DATA_FOUND THEN
------v_keypart1indic := 0;
...
HTH,
- Chris
-
[QUOTE][i]Originally posted by chrisrlong [/i]
[B]Actually, I would use:
v_keypart1indic := DECODE ( :new.keypart1_use, NULL, 0, 1);
[/B][/QUOTE]
Unfortunatelly the DECODE is not supported in PL/SQL.... ;)
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
The compiler complaint that DECODE' may be used inside a SQL statement only.
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
|