Home » Developer & Programmer » Forms » data not inserting into cursor
data not inserting into cursor [message #173147] Fri, 19 May 2006 11:34 Go to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

I am trying to insert values from a count into a cursor
what am I missing, because its not saving to the record nor is the new values displaying on the form

cursor off_cur is select * from offenses where off_id = : offense.off_id;
off_rec off_Cur%rowtype;

begin
open off_cur;
loop
fetch off_cur into off_rec;
exit when off_cur%notfound;
if off_rec.classoffenses = '01a' then
select count(*) into murder18_count_male FROM NAMES WHERE (age = 18) and (SEX = 'M') AND (RACE = 'B' or RACE = 'W' or RACE = 'A' or RACE = 'I') ;
off_rec.m_age_18 := murder18_count_male;
forms_ddl('commit');
synchronize;
elseif off_rec.classoffenses = '02' then
select count(*) into murder18_count_f FROM NAMES WHERE (age = 18) and (SEX = 'F') AND (RACE = 'B' or RACE = 'W' or RACE = 'A' or RACE = 'I') ;
off_rec.f_age_18 := murder18_count_f;

end loop;

close offense_cur;
Re: data not inserting into cursor [message #173195 is a reply to message #173147] Sat, 20 May 2006 01:59 Go to previous message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
Hi,

Your code will not work:

Cursor must be declared 'for update'

Look up in the pl/sql docs 'where current of'

Try it; if you cannot get it to work, please post again. (I have no time now to write it all out)

Regards, good weekend,

Rob Zijlstra
Previous Topic: calling a form from another form
Next Topic: wrong no of values in INTO the list of a Fetch Statment
Goto Forum:
  


Current Time: Fri Sep 20 09:32:34 CDT 2024