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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.