Home » Developer & Programmer » Forms » How to loop thru a multi record block
icon5.gif  How to loop thru a multi record block [message #130832] Tue, 02 August 2005 16:28 Go to next message
vijay1974
Messages: 3
Registered: August 2005
Junior Member
Hi Guys,

How do we loop thru all the records in a multi record block with out using first_record, last_record,next_record.

Thanks
Vijay


Re: How to loop thru a multi record block [message #130845 is a reply to message #130832] Tue, 02 August 2005 18:22 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Search the table in the database. If the record_status is 'changed', then commit the form before searching.

David
Re: How to loop thru a multi record block [message #130936 is a reply to message #130832] Wed, 03 August 2005 05:43 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
GO_RECORD can be an alternative.

Is there a particular reason why you don't want to use FIRST_RECORD ? Just curious...

MHE
Re: How to loop thru a multi record block [message #130960 is a reply to message #130936] Wed, 03 August 2005 10:45 Go to previous messageGo to next message
vijay1974
Messages: 3
Registered: August 2005
Junior Member
This validation should happen before commiting to the database.
Here is the scenario.

Col1 Col2 Col3 .................
Row 1 A AAAA 1111
Row 2 C CCCC 3333
Row 3 B
.
.
.

User can enter only certain combinations of values in col1, say user cannot enter value B if user already entered A. User should get a error when entered B in the third record.

first_record, last_record, go_record cannot be used in W-V-I or W-V-R or post-change triggers cause they are restricted procedures.

I was wondering is there any other way to loop thru the block.

Any help is appreciated.

Thanks
Vijay
Re: How to loop thru a multi record block [message #131012 is a reply to message #130960] Wed, 03 August 2005 18:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Somebody created a thread in this forum in which the solution was to place the values in a record_group. Then in the WVI, search the record_group. If found, fail. If not found, add. You will have to think about how to handle changing the contents of an item that has already been added to the record_group.

Upd: Look at http://www.orafaq.com/forum/m/129269/67467/?srch=record+group#msg_129269 and maybe http://www.orafaq.com/forum/m/120298/67467/?srch=record_group#msg_120298

David

[Updated on: Wed, 03 August 2005 18:57]

Report message to a moderator

Re: How to loop thru a multi record block [message #131033 is a reply to message #130832] Thu, 04 August 2005 00:54 Go to previous messageGo to next message
manjuvasu
Messages: 22
Registered: May 2005
Junior Member
hi,
u can try this.

a:=get_block_property('blkname',current_record);

so, it gives u as 1,2,3.... like that as u enter the record.

using for loop as
for i in 1..a loop
u can do u'r validation here.
end loop;

let me know whether it suits u'r need.
Re: How to loop thru a multi record block [message #131139 is a reply to message #130832] Thu, 04 August 2005 10:24 Go to previous message
vijay1974
Messages: 3
Registered: August 2005
Junior Member
Thank you guys for the help. I used record groups and accomplished it. It is working.


Regards
Vijay
Previous Topic: Internet based capability in 6i and 9i
Next Topic: Pasta via XML Publisher....
Goto Forum:
  


Current Time: Thu Sep 19 23:32:08 CDT 2024