Chapter 4: SQL Language Elements
4.9.2.12 CHARTOROWID (extension)
Syntax
CHARTOROWID ( char_expression )
Description
The scalar function CHARTOROWID returns a ROWID contained in the input argument in character form. The representation of a row identifier depends on the storage manager. The format of the char_expression argument to this function varies between storage managers.
Example
The following example shows the character-string format for a row identifier supplied as an argument to CHARTOROWID. In this example, the format for a row identifier is an integer (delimited as a character string by single quotes).
SELECT ROWID, FLD FROM SYSCALCTABLE;
ROWID FLD
----- ---
0 100
1 record selected
-- CHARTOROWID requires single quotes around its argument
SELECT * FROM SYSCALCTABLE WHERE ROWID = CHARTOROWID ('0');
FLD
---
100
1 record selected
Notes
- The argument to the function must be of type character.
- The result is of internal ROWID type as defined by the storage manager.
- If the argument char_expression evaluates to null, the result is null.
- The SQL statement execution returns error if the result of the input character expression does not contain a character string in the proper format for a row identifier, as defined by the storage manager.