CAST_TO_RAW function - Casts a VARCHAR value to a VARBINARY value

The CAST_TO_RAW function casts a VARCHAR value to a VARBINARY value.

Syntax

Read syntax diagramSkip visual syntax diagramUTL_RAW.CAST_TO_RAW( input)

Parameters

input
An input argument of type VARCHAR(32672) that specifies the value to be converted to VARBINARY(32672).

Authorization

EXECUTE privilege on the UTL_RAW module.

Example

Example 1: The following example shows how to CAST the VARCHAR value to VARBINARY value: :
db2 "select sysibmadm.utl_raw.cast_to_raw(‘abcdef’) from sample "

1          
-----------
          x'616263646566'

  1 record(s) selected.