How to receive record ID???

The subject is:

I want to select some records from some table ("TableA", "TableB", ...) using Select SQL to a temporery table, then I will choose one record from this Temp Table. How can I know the exact position of this record on the source table "TableA".

Please give me some advices!!!

Thanks




Answer this question

How to receive record ID???

  • cm6043

    Hi,

    you can use RECNO() in your select :

    SELECT *, RECNO() as position FROM tableA INTO CURSOR temp



  • Barry Hughes

    Do you have a primary key on the tables If not, how will join them

    Whatever the join condition that you use in your SQL will uniquely identify the record in your source tables. The easiest way to do this is to use surrogate Primary keys on all your tables.

     

     



  • How to receive record ID???