Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

CHARTOROWID (extension)

Syntax

CHARTOROWID ( char_expression )

Description

The scalar function CHARTOROWID returns a ROWID contained in the input argument in character form.

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.
  • If the argument char_expression evaluates to null, the result is null.
  • The c-treeSQL 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.

TOCIndex