Home » Developer & Programmer » Forms » How i get Last Record of Current Data Block using forms 6i
How i get Last Record of Current Data Block using forms 6i [message #309938] Sun, 30 March 2008 03:58 Go to next message
qanita786
Messages: 229
Registered: May 2007
Location: PAKISTAN
Senior Member
Dear I am using forms 6i i want to get last rcord in data block suppose that detail block have ten records now i click with mouse first row in current record option the result will show 1 record but actually ten record founds how to get last row in current data block with out going to last record

kind regards
Faheem
Re: How i get Last Record of Current Data Block using forms 6i [message #309970 is a reply to message #309938] Sun, 30 March 2008 15:58 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's a desk with ten drawers. You open the first one. You want to grab contents of the tenth drawer, but without opening it. How do you do that?

Although I don't quite understand what prevents you from going to the last record and do with it whatever you want, there (perhaps) is a way to do something about the problem: if that "tenth" record is the last one (based on some criteria, such as a sequence number, date (time) column etc.), and if these records are stored in the database, you might try to
SELECT col1, col2, ...
FROM this_table t1
WHERE t1.last_record_identifier_column = (SELECT MAX(t2.last_Record_identifier_column)
                                          FROM this_table t2
                                          WHERE t2.id_column = t1.id_column
                                         );

However, if these records are not in the database yet, I believe you'll have to navigate to the last record in order to manipulate with its contents.
Re: How i get Last Record of Current Data Block using forms 6i [message #310019 is a reply to message #309938] Mon, 31 March 2008 00:07 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
If you want all records to be retrived in your FORMS DATA BLOCK then See QUERY ALL RECORD.

If you want to get the values of the last record then I think LittleFoot is right you have to use a QUERY.

Regards,
Azam Khan
Re: How i get Last Record of Current Data Block using forms 6i [message #310371 is a reply to message #310019] Tue, 01 April 2008 01:07 Go to previous messageGo to next message
qanita786
Messages: 229
Registered: May 2007
Location: PAKISTAN
Senior Member
Dear problem is that i am in insertion mode and commit command will not be used
Re: How i get Last Record of Current Data Block using forms 6i [message #310511 is a reply to message #310371] Tue, 01 April 2008 08:11 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

Is`nt
System.Last_record

worked for you.
Re: How i get Last Record of Current Data Block using forms 6i [message #310618 is a reply to message #310511] Tue, 01 April 2008 15:42 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Question by qanita786
i want to get last record in data block

Answer by musman
System.Last_record

What about ":system.last_record"? It returns a Boolean (i.e. current record is (or is not) the last one). How did you mean to use it in order to get the last record?

(By the way (I forgot to mention it last time): qanita786, please, use punctuation next time you post a message. Your initial post is simply horrible; several lines of text with no full stop, comma, initial capital letter and/or whatever makes punctuation).
Previous Topic: Stored Procedure in Forms
Next Topic: FRM-40735: ON-INSERT Trigger raised unhandled exception ORA-00984
Goto Forum:
  


Current Time: Sat Dec 14 14:29:52 CST 2024