Convert SQL RowId to OpenEdge ROWID

Posted by Peter Strachan on 25-Feb-2020 11:25

We have hit an issue recently where a SQL extract of data via ODBC connection fell over pointing to a specific RowId. To aid in investigating this I would like to convert the SQL RowId integer to an OpenEdge ROWID. I have found some examples of poeple converting the integer to a hex character, then to ROWID via the TO-ROWID function. I have used https://knowledgebase.progress.com/articles/Article/21616 as an example to base my code however when using the ROWID "0x0000000000000881", this seems to burst some form of limit:

DEFINE VARIABLE iRowId AS int64 NO-UNDO.

/*iRowId = EXP(16, (LENGTH("0x0000000000000881") - 2)).*/

MESSAGE (KEYCODE(SUBSTRING("0x0000000000000881", 2, 1)) -
KEYCODE("A") + 10) * EXP(16, (LENGTH("0x0000000000000881") - 2)) skip
irowid
VIEW-AS ALERT-BOX.

Uncommenting the assignment makes the code bomb, any help would be greatly appriciated.

Could anyone provide comment on the above or a solution that might help please?

All Replies

Posted by dbeavon on 25-Feb-2020 17:00

Did you find these links?  

community.progress.com/.../58016

knowledgebase.progress.com/.../unexpected-and-illogical-case-sensitivity-in-to-rowid

It sounds like you are running into something similar.  I ran into this while using the CLR bridge (ODBC interface) to execute and retrieve data via SQL queries into an ABL session.  It is actually very fast, and allows us to build on the power of the sql92 engine.

This thread is closed