Use utl_raw.cast_to_raw to convert string to raw data in Oracle Options

codeling Posts: 1153 Points: 4845
Posted: Tuesday, September 24, 2019 10:01:22 AM

The UTL_RAW package is a PL/SQL package that contains procedures for converting and packing message data which is sent back and forth through the WebSphere MQ queues using the RAW data type and PL/SQL data types.

UTL_RAW.CAST_TO_RAW converts a value of data type VARCHAR2 into a raw value with the same number of bytes. The input value is treated as if it were composed of single 8-bit bytes, not characters. Multibyte character boundaries are ignored. The data is not modified in any way, it is only changed to data type RAW.

SQL> select utl_raw.cast_to_raw( 'Hello World!' ) data
  2    from dual;

DATA
--------------------------------------------------------------------------------
48656C6C6F20576F726C6421

SQL>
 
Users browsing this topic
Guest