Home » Developer & Programmer » Forms » how to fetch previous record values into next record
how to fetch previous record values into next record [message #157083] Tue, 31 January 2006 04:45 Go to next message
Nilesh Kunte
Messages: 30
Registered: December 2004
Location: Indore
Member
hi,
help!!!!
I have a header-detail relationship form.
In the detail block I have one column called "product_type" and another column called "description". For the first time I am inserting values manually in the product type, say "GPC" and description, say "A/C Ducting".
when I come in the next record, I want that as soon as I type "GPC", the description of GPC i.e. "A/c Ducting" should appear in the corresponding item. i.e. I want to fetch previous record details in the next records through SQL STATEMENT ONLY.
note: the previous record is not yet saved.
I want to fetch previous unsaved records in the next/current record through SQL STATEMENT ONLY.
What SQL statement should I Write.

T&R,
Nilesh Kunte.
Re: how to fetch previous record values into next record [message #157150 is a reply to message #157083] Tue, 31 January 2006 09:43 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You contradict yourself: you want to fetch records, not yet passed to the server ("not saved") through the use of an SQL statement (wich is passed to the server and executed over there, where your records aren't).

I see one option: post the changes, in the when-validate-record trigger. Posting is just the process of passing your values to the database without performing a commit. If you are in the same session you should be able to fetch the values you have entered but not yet committed.

MHE
Re: how to fetch previous record values into next record [message #157181 is a reply to message #157150] Tue, 31 January 2006 16:22 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sounds as though you need to load these values into some globals via the When-Validate-Item trigger and then use them via the When-Create-Record trigger.

David
Re: how to fetch previous record values into next record [message #157213 is a reply to message #157181] Wed, 01 February 2006 01:41 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
David,
what if the user has entered something like this in his MR block:
First he entered the record with name AAA and then the record with name BBB. Finally, another record is being entered with name AAA. If I understand correctly, he wants the description of the previous record with the same name.
  NAME     DESCRIPTION
________________________
| AAA  | Description A |
________________________
| BBB  | Description B |
________________________
| AAA  | ????????????? |
________________________

In this case, a simple GLOBAL won't do I'm afraid, because if the end user changes his mind and erases the last AAA and replaces it with BBB, he should get Description B. You could define a global for each and every name a user entered I guess, but I think it's sloppy programming.

Perhaps a package variable (PL/SQL table).

MHE
Re: how to fetch previous record values into next record [message #157360 is a reply to message #157213] Wed, 01 February 2006 22:56 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Perhaps a record group could be used to hold all the value pairs. There are threads on how to do this in this forum. Search 'record_group' or 'record group' - there was one just before the end of the year.

David
Previous Topic: Running Forms from Web
Next Topic: passing values from oracle forms to oracle reports
Goto Forum:
  


Current Time: Fri Sep 20 07:24:06 CDT 2024