Question Recid

Good day guys, this is the scenario.

I got this syntax:

Code:
Def var vrecid as recid.

For each info_file where vrecid eq recid(info_file) no-lock.

Let us say there is a browser where it opens there the query of table info_file and it is on a multiple selection.

What I want to ask is, recid is for a single database storage right or there is a specific code for multiple database storage? so then i selected 2 datas in the browser. Does the syntax will read 2 record IDs(vrecid) in the query above? I am using get current value syntax etc.....
 

TomBascom

Curmudgeon
What version of Progress is this?

As James says RECID is "deprecated". That means "although it does continue to 'work', it is strongly advised that you not use it".

Why?

0) RECID is not permanent. If you dump & load, or do a tablemove, or someone deletes and re-creates the record you will (probably) get a new RECID.

1) Starting with version 9 RECID is not unique in a database -- it is only unique per storage area. Thus more than one table can have records with the same RECID.

2) Starting with oe11 table partitioning, tables can be spread across multiple partitions (which are storage areas) and thus RECID is not unique within a table any more -- IOW you can have multiple records in the same table that have the same RECID.

Generally speaking code like that shown above makes very little sense -- FOR EACH says that you expect multiple records. But you list just a single table and you are using RECID -- and RECID in the absence of table partitioning identifies a single row. FIND would be the more appropriate way to code such a query. And ROWID would be the appropriate way to identify a unique record. You also neglected to specify a lock status so you are scoping a share-lock to the enclosing block (which, as written, is the entire procedure). This is extremely bad practice -- even for a snippet of code being posted to a forum. In real code it is a train-wreck waiting to happen. Furthermore, FOR EACH blocks should be terminated with ":" rather than ".". Yes, the compiler allows ".". No, it is not proper and correct. It is confusing and detracts from readability. As do abbreviations. Don't do that. Lastly "hungarian notation" is a travesty from the dark ages of coding that should be stamped out at every turn.

Code:
define variable exampleRowid as rowid no-undo.

/* do something that  assigns a value to exampleRowid */

find info_file no-lock where rowid( info_file ) = exampleRowid no-error.

if available info_file then
  do:
    /* do something with info_file */
  end.
 
Good day guys, this is the scenario.
.........
What I want to ask is, recid is for a single database storage right or there is a specific code for multiple database storage? so then i selected 2 datas in the browser. Does the syntax will read 2 record IDs(vrecid) in the query above? I am using get current value syntax etc.....
Does the syntax will read 2 record IDs(vrecid) in the query above? NO. RECID was unique value; it depends your progress version...
 
Top