PL/SQL and cursors. Any specialist?
Date: 1996/08/02
Message-ID: <3202435A.5AEE_at_Chiche.com>#1/1
HELP! PL/SQL specialist needed!
Here is my problem:
I've got a piece of code looking like that:
Cursor cur_CONSTANTS (cur_key_1 in NUMBER) is
select * from CONSTANTS where ((ACCOUNT_NUMBER = cur_key_1);
for MCIF_10 in cur_MCIF_10 loop
.......
loop;
In the case MCIF_10.ACCOUNT_NUMBER isn't found in table CONSTANTS,
cur_CONSTANTS%NOTFOUND is true, but what happens if I reference a field from
the cursor, such as cur_CONSTANTS%Department ? Is it's value going to be NULL?
undetermined? I need to know because I'm using such expression as:
my_variable = NVL (cur_CONSTANTS%Department, 'default'), assuming that
my_variable
Until today, cur_CONSTANTS%Department always evaluated to NULL whenever there was
no match,
open cur_CONSTANTS (MCIF_10.ACCOUNT_NUMBER);
fetch cur_CONSTANTS into CONSTANTS;
will take the value 'default' in case cur_CONSTANTS%NOTFOUND is true.
but on a different system, it started returning a value, always the same. Is it
normal? I don't
So, NULL or Undertermined?
I know I could test cur_CONSTANTS%NOTFOUND, but this is not the point.
Thank you in advance.
Please e-mail me at stephane_at_chiche.com