Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no of records selected

Status
Not open for further replies.

Rottdpogs

IS-IT--Management
Jul 17, 2001
86
CN
Please Advice.
How can i determine the numbers of records I've selected.
Ex.
select * into :a, :b, .... from sample ;

how can i know the no of records selected?
thanks in advance.
 
Do you want the count of records along with all the records?
 
caster,
yes. i want to know the number of records together with the selected records. thanks
 
If you do your select as part of a datawindow or datastore you are returned the number of rows (along with the data). Otherwise an imbedded sql is either going to return a single row or, if multiple rows are needed, you need to declare a cursor and then fetch your data into it (and I assume you would increment a counter to tell how many rows were retrieved).
 
The code below will place the number of rows retrieved from a datawindow or datastore in a variable. The Retrieve() returns a long, so be sure to declare your row count variable as a long as well to avoid any furture overrun problems.

*** Code snippet ***
Long ll_NumRows

ll_NumRows = dw_1.Retrieve()
*** end snippet ***

If you want to know the row count *before* you retrieve data, you will need to use embedded SQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top