Re: ORA-01460 error when useing bind sql on oracle from php

From: Date: Thu, 20 Nov 2003 14:03:57 +0000
Subject: Re: ORA-01460 error when useing bind sql on oracle from php
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31649@lists.php.net to get a copy of this message
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)
                "
}


« previous php.db (#31649) next »