Home » Developer & Programmer » Forms » Need to know how to move to Next Record and Previous Record (Oracle Forms 10g)
Need to know how to move to Next Record and Previous Record [message #385020] Fri, 06 February 2009 03:41 Go to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

Hi,

I am very new to Oracle Forms 10g, I am working on one application ( Which i have attached for the referece). Here I have some Text Boxes in which i will enter the records and i will get the number of records found ( count).

Assume the following scenario,

I have 3 Textboxes

LCNumber: Null

Name: 'As%'

Location: Null

Based on the above input, i have built my SQL Query and get the count.

Select count(*) from Employees where Name Like 'As%'.

Assume i have 2 records in my Table Employees for name like 'As%', I want to display the records in another set of Text Boxes.

Like

LCNumber: 2900

Name:Ashoka

Emailid:=devanampriya@gmail.com

DateofJoin:=25-May-2005.

When i Click my NEXT Button (Not the default toolbar, i need to code this) . The second record should be displayed.

LCNumber: 2901

Name:Ashokaaaa

Emailid:=ashokaaa@gmail.com

DateofJoin:=25-June-2005.


Please help me, i have attached the SQL Script and the .fmb file here.


Regards,
Ashoka BL
devanampriya@gmail.com


SQL SCript

CREATE TABLE EMPLOYEES
(
LCNUMBER VARCHAR2(10 BYTE),
NAME VARCHAR2(50 BYTE),
LOCATION VARCHAR2(20 BYTE),
EMAILID VARCHAR2(20 BYTE),
DATEOFJOIN DATE,
PRESENT_PAST VARCHAR2(20 BYTE)
);


INSERT INTO EMPLOYEES ( LCNUMBER, NAME, LOCATION, EMAILID, DATEOFJOIN,
PRESENT_PAST ) VALUES (
'LC02900', 'Ashok', 'Location1', 'blashok@ciber.com', TO_Date( '05/25/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 'Present');
INSERT INTO EMPLOYEES ( LCNUMBER, NAME, LOCATION, EMAILID, DATEOFJOIN,
PRESENT_PAST ) VALUES (
'LC02901', 'BL', 'Location1', 'blashoka@ciber.com', TO_Date( '06/25/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 'Past');
INSERT INTO EMPLOYEES ( LCNUMBER, NAME, LOCATION, EMAILID, DATEOFJOIN,
PRESENT_PAST ) VALUES (
'LC02902', 'Ashoka', 'Location3', 'blashokkk@ciber.com', TO_Date( '07/25/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 'Present');
COMMIT;


  • Attachment: EMPLOYEE.fmb
    (Size: 100.00KB, Downloaded 1005 times)
Re: Need to know how to move to Next Record and Previous Record [message #385065 is a reply to message #385020] Fri, 06 February 2009 05:45 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
I really wouldn't try querying one record at a time.
Just use the default functionality.
Query all the records but set the block to only display one at a time.

Then you can just next_record and previous record
Re: Need to know how to move to Next Record and Previous Record [message #385278 is a reply to message #385065] Sun, 08 February 2009 22:55 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

hey,
thanks for the information,but if you observe form which i attached, i need the form to behave something like Advanced Search screen,

If you enter even the wild card it should get me the rows,

Regards,
Ashoka BL
Re: Need to know how to move to Next Record and Previous Record [message #385342 is a reply to message #385020] Mon, 09 February 2009 03:46 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
I haven't been able to open your form properly, it corrupts when I try - what version of forms are you using?

You should probably explain more in words what you're trying to accomplish.

Quote:

If you enter even the wild card it should get me the rows


That's standard behaviour, why isn't it working for you?
Re: Need to know how to move to Next Record and Previous Record [message #385343 is a reply to message #385342] Mon, 09 February 2009 03:49 Go to previous message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

hey,

Thanks for the reply, i got it, i did it used binding the items to the block and using set_block_property(where_clause).

Its quite easy instead of the very long approach which i was doing, since i was beginner i didnt know about it.

Thanks for the help, problem solved Smile

Regards,
Ashoka BL
Previous Topic: Is there possible to find the next_item of block?
Next Topic: Opening a window
Goto Forum:
  


Current Time: Mon Feb 03 18:09:51 CST 2025