web analytics

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

Options

codeling 1602 - 6666
@2019-09-24 10:01:22

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>

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com