Skip to Content
0
Former Member
Jun 05, 2008 at 11:20 AM

select query

13 Views

Dear Frens,

I have a requirement where in which i need to select some 1000 records at once from a master DB table.

For that, i know we can use 'cursor' which implicitly takes care of the index DB pointer, which allows to read 1000 then 1000 records,so on sequentially.

In case of a RFC call, i should not use cursor.

Hence the option that i have left is use some condition in select query to fetch 1000 records.

This is the select query :

select distinct addrnumber from ADRC

into corresponding fields of table sel_tab

up to 1000 rows

where addrnumber GE ls_addrnumber

order by addrnumber.

here ls_addrnumber stores last read Addrnumber.

This query can select 1000 records at once. But the problem i have is that, the database is always cannot be in a sorted manner. Hence the condition which i have used above to fetch next 1000 records will not be fruitful, there is a change of missing some records.

Can anybody have any better solution. As i said earlier, i cannot use cursors.

Reply asap,.

WIth Best regards,

Satish