How to convert from string to RAW(Oracle) in php?-ThrowExceptions

Exception or error:

I am trying to pass a long strings to Oracle stored procedure RAW variable but getting an error:

oci_execute(): ORA-06502: PL/SQL: numeric or value error

Not sure how to convert String to Raw datatype.

How to solve:

select UTL_RAW.CAST_TO_RAW(‘test’) from dual
— 74657374

echo bin2hex(‘test’);
— 74657374

Leave a Reply

Your email address will not be published. Required fields are marked *