Home » Developer & Programmer » Forms » how to select a feild from cursor with condition?
how to select a feild from cursor with condition? [message #116490] Wed, 20 April 2005 06:30 Go to next message
zigbinputi
Messages: 11
Registered: April 2005
Junior Member
is this posible?

select cursor_name.field
from cursor_name
where cursor_name.id = 4;

i have a cursor that stores details. im having problem on how to retrieve 1 field from my cursor with condition like the one above. do i need to use record?

pls help how to do this.. this is really urgent..


thanks..

[Updated on: Wed, 20 April 2005 06:39]

Report message to a moderator

Re: how to select a feild from cursor with condition? [message #116605 is a reply to message #116490] Wed, 20 April 2005 20:08 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
For me cursors RETRIEVE data, not store it. If you want the 4th record then loop through the cursor, count to 4, then use the data.

If the data field 'ID' has the value '4' then put that into your select statment and get it directly.

I always use records eg:
   CURSOR c1
   IS
      select   *
          from dual;

   c1rec   c1%ROWTYPE;

then you don't have to keep changing the 'row' record when you change the 'select' record.

I probably have not grasped the essence of your enquiry, please elaborate.
Re: how to select a feild from cursor with condition? [message #116687 is a reply to message #116605] Thu, 21 April 2005 07:02 Go to previous messageGo to next message
zigbinputi
Messages: 11
Registered: April 2005
Junior Member
sori 4 confusion..
what im trying to say is. after you retrieves data from database using cursor, and stores them into a record. i want to fetch a data in it using SELECT where i can put condition. using select i think is faster than loops, like if you have 100 data in your cursor/record. im just knew in oracle pls help/guide me..

thanks..

[Updated on: Thu, 21 April 2005 07:13]

Report message to a moderator

Re: how to select a feild from cursor with condition? [message #116763 is a reply to message #116490] Thu, 21 April 2005 20:33 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If the data is already in the database, use a second cursor to fetch the exact information using information that you obtained from the first cursor. That is, go back to the database a second time but with a more exact where clause.
Previous Topic: any one with pdf book of Forms /Report 6i
Next Topic: hmm still problmm insertion
Goto Forum:
  


Current Time: Thu Sep 19 14:50:26 CDT 2024