PHP 8.5.0 Alpha 1 available for testing

Voting

: six minus five?
(Example: nine)

The Note You're Voting On

xorinox at gmx dot ch
10 years ago
Working with Oracle and raw types in and out worked like the following for me.

<?php
/*oracle procedure
procedure open_session(
i_instance_id in raw,
o_session_id out raw,
o_errcode out number,
o_errmsg out varchar2
);
*/

//open database
$conn = DBOpen( DB_DEV_USER );

//get session id
$sql = "begin p_loader.open_session( hextoraw( :instance_id ), :session_id, :errcode, :errmsg ); end;";
$stmt = oci_parse( $conn, $sql );
$instanceId = DB_INSTANCE_ID;
oci_bind_by_name( $stmt, ":instance_id", $instanceId, 1, SQLT_CHR );
oci_bind_by_name( $stmt, ":session_id", $sessionId, 16, SQLT_BIN );
oci_bind_by_name( $stmt, ":errcode", $errcode, 12, SQLT_INT );
oci_bind_by_name( $stmt, ":errmsg", $errmsg, 4000, SQLT_CHR );

oci_execute( $stmt );
$sessionId = bin2hex( $sessionId ); //now this is a hex string

//close database
DBClose( $conn );
?>

<< Back to user notes page

To Top