Sorry about replying to my own posts, but... Problem solved!
As OCIBindByName is binding to the actual variable, that variable must not be changed.
I modified my script to look like this: ---***--- $ci=0; foreach ($bindargs as $bindname => $bindvalue){ ${"bindval$ci"}=$bindvalue; OCIBindByName($stmt,$bindname,&${"bindval$ci"},-1); $ci++; } ---***---
Are Pedersen wrote:
I get "ORA-01460: unimplemented or unreasonable conversion requested" when useing bind-sql on Oracle 9i.
I am useing OCI 8.1 client in PHP.
What is wrong? And what does this message mean?
Here is the code: ---***--- $bindarray1=array(':project1'=>$project); $bindarray1[':userid']=$userid; $rs = sql_query($qs,$bindarray1);
function sql_query($qs,$bindargs) { $stmt = @OCIParse($this->db_sqlhandler, $qs); if (!$stmt) { return false; } //bind all the variables if (is_array($bindargs)){ foreach ($bindargs as $bindname => $bindvalue){ OCIBindByName($stmt,$bindname,&$bindvalue,-1); } } if (@OCIExecute($stmt)) { return $stmt; } $DB_ERROR = OCIError($stmt); return $DB_ERROR; } ---***---
vardump of bindargs: array(2) { [":project1"]=> int(1) [":userid"]=> string(5) "10001" }
vardump of DB_ERROR:
array(4) {
["code"]=>
int(1460)
["message"]=>
string(62) "ORA-01460: unimplemented or unreasonable conversion requested
"
["offset"]=>
int(0)
["sqltext"]=>
string(365) "SELECT acl.prjid, acl.groupid, acl.read_access , acl.write_access,acl.delete_access,acl.change_access
FROM StructureTreeTbl outree, GroupChildrenTbl gg2, MembersTbl memb2, ACL acl
WHERE
(memb2.personid=:userid AND
memb2.groupid=gg2.gchildid AND
gg2.groupid=outree.orgchild AND
outree.orgid = acl.groupid AND acl.prjid=:project1)
"
}
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php