Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem in a cursor loop, in Pro*c

439412Oct 9 2005 — edited Oct 11 2005
Hi,
guys, i have a strange scenario ahead, i have a code on pro*c, i have a cursor and iam fetching values into host variables inside the cursor loop with few indicator variables and sqlca.sqlcode check also, like the following

EXEC SQL OPEN C1_CASH;
for ( ; ; )
{

/* loop through all business areas */

EXEC SQL FETCH C1_CASH INTO :h_circle_id,:h_hub_name,:h_location_id INDICATOR :t1,:h_bank_id,:h_bank_account_no,:h_receipt_amt INDICATOR :t2,:h_reversal_charge_amt,:h_receipt_id,:h_receipt_cut_dt,:h_subm_dt,:h_payment_mode_id,:h_segment_code INDICATOR :t4

if (t2 == -1)
{
}

if (t1 == -1)
{
}

if (sqlca.sqlcode == 1403) {
}
}/end for loop

now everything is fine only problem is after the last record of the cursor, the for loop starts and then i have a no_data function, which i haven't registered in my main() function, but somehow that is invoked with junk values, can anyone help me out, has any one faced similar problems, any good links for cursor loop in proc*c...

cheere...........
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2005
Added on Oct 9 2005
11 comments
1,500 views