Home » Developer & Programmer » Forms » need help on program unit (forms 6i,win xp)
need help on program unit [message #328899] Mon, 23 June 2008 05:01 Go to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
Hi ,
Please check the text document attached with this message.
In the code the cursor is not looping.Kindly suggest.

Thanks in advance
Re: need help on program unit [message #328916 is a reply to message #328899] Mon, 23 June 2008 05:43 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
the cursor is not looping

How do you know?

We don't have your schema. We don't know what's in your tables. We don't have your form. All we have is your statement, and we can't prove it. Can you?

Code you used *looks OK*. But, is it? How many records does cursor return? If it is only one, loop actually works but you can't see much of it.

Is there any error there? If so, which one? By the way, remove WHEN-OTHERS exception; this handler might obfuscate an error (if any). I don't know what "g.cent" does but - for testing purposes - remove it.
Re: need help on program unit [message #328918 is a reply to message #328899] Mon, 23 June 2008 05:51 Go to previous messageGo to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
Hi littlefoot,
I am not getting any error.There will be always more than one row so i have done the loopin.g.cent is used for testing purpose only.But the only thing is the loop is not working in this.

Regards
Re: need help on program unit [message #328925 is a reply to message #328918] Mon, 23 June 2008 06:56 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, I have created a test form based on the DEPT table in Scott's schema. This is the WHEN-NEW-FORM-INSTANCE trigger which does the job (disregard the fact that it needs some tweaking about "creating the initial record"):
declare
  cursor c_d is 
    select deptno, dname, loc
    from dept
    order by deptno desc;
begin
  for cur_r in c_d loop
    create_record;
    :deptno := cur_r.deptno;
    :dname  := cur_r.dname;
    :loc    := cur_r.loc;
  end loop;
end;

This is the result:

/forum/fa/4508/0/

Now how does your form look like?
Previous Topic: Form Builder 10g
Next Topic: Navigate to another item in enter query mode
Goto Forum:
  


Current Time: Fri Sep 27 14:23:40 CDT 2024