Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Determining Database Record No.

Former Member
0 Likes
775

hi, how would i know what is database record no. of a given table record. i'll be using this record no. as part of a computed data w/c should be unique per given record.

thank you very much,

rico

3 REPLIES 3
Read only

Former Member
0 Likes
645

Hi Rico,

The below statement will get unique number of record count from DB.

SELECT COUNT( DISTINCT <field> ) INTO wf_count FROM <table name>.

Regards,

Prabhu Rajesh.

Read only

VXLozano
Active Contributor
0 Likes
645

I think there is nothing like you need, except the primary key of the tables. If you can access your DB server, it will provide you with the unique row id (if I could remember, Oracle uses ROWID). I did not worked with DBs in a long time, but I think the ROWID is not a solution...

Why you don't use yout table PK? I think you can use an itab like:

DATA: BEGIN OF itab OCCURS 0,

myownpk TYPE STRING.

INCLUDE STRUCTURE dbtable.

DATA: END OF itab.

After retrieving the data, or in your own loop, assing a concatenate of the PK fields to your myownpk field of itab, and you will have a single id of every record.

I think is not a clean method, still thinking that you must use your table's PK.

I wish someone with better knowledge than me will provide you with a better solution. Good luck,

Vic

Read only

Former Member
0 Likes
645

prabhu/vicenc, thanks very much for your replies.

regards,

rico