Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table. For the sake of example, let's say it's created like so:
MyTable:
LOAD Myfield1, Myfield2, Myfield3
RESIDENT SomeOtherTable;
I wanted to add a sequential record number to the table, so I tried this:le:
MyNewTable:
LOAD *, RECNO() as RecordID
RESIDENT MyTable;
It added the RecordID field, but it used seemingly random values - 4, 8, 11, 15 instead of the expected 1,2,3,4.
In order to get the desired result, I had to do this:
MyNewTable:
LOAD Myfield1, Myfield2, Myfield3, RECNO() as RecordID
RESIDENT MyTable;
I consider this to be a bug (among the many other bugs your product has). Oh wait, the trainer refused to call stuff like this a "bug", preferring instead to call it a "nuance".
Use Rowno() instead of RECNo()
Is there a where statement when you did a resident load??
What do you get when you use RowNo() instead of RecNo()?
MyNewTable:
LOAD *, RowNo() as RecordID
RESIDENT MyTable;
Try using the rowno() instead of record number.
Hi,
do you have a sample application+data to demonstrate the issue?
This example doesn't seem to show this behaviour:
MyTable:
LOAD RecNo() as Myfield1,
Ceil(Rand()*100) as Myfield2,
Ceil(Rand()*100) as Myfield3
AutoGenerate 20;
MyNewTable:
LOAD *, RECNO() as RecordID
RESIDENT MyTable;
DROP Table MyTable;
thanks
regards
Marco