note 3421 deleted from function.ocibindbyname by sixd

From: Date: Wed, 20 Nov 2013 19:46:38 +0000
Subject: note 3421 deleted from function.ocibindbyname by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197580@lists.php.net to get a copy of this message
Note Submitter: k_a_h_l_i_l at yahoo dot com ---- ocibindbyname with VARCHAR fields doesn't handle length dynamically. I had to define my variable with the correct length (and garbage data) before calling bindbyname. $myvar = "000000"; OCIBindByName($stmt,":myvar",&$myvar, -1); without the first initialization line ($myvar = "000000"), the statement will give a NULL length error when executed. This error happens even if the variable's length is provided as a parameter. So OCIBindByName($stmt,":myvar",&$myvar, 6); won't work either unless the initialization statement is executed first.

« previous php.notes (#197580) next »