Home  >  Article  >  Backend Development  >  oracle 最后哦那你个插入 clob类型的值出现解决办法

oracle 最后哦那你个插入 clob类型的值出现解决办法

WBOY
WBOYOriginal
2016-06-13 10:03:24959browse

oracle 最后哦那你个插入 clob类型的值出现
在php连接Oracle的过程中,往表中clob类型的字段插入>4000字符的数据时,会报错:字符串太长。
遇到这种问题该怎么解决呢?
能不能不使用大家所讨论的 存储 方法?
错误提示使用绑定,谁能给个示范的绑定代码?
谢谢了

------解决方案--------------------

putenv("ORACLE_SID=sid1");
putenv("ORACLE_HOME=/u01/app/oracle/product/8.0.5");

$handle = ora_plogon("[email protected]", "TIGER") or die;
$cursor = ora_open($handle);
ora_commitoff($handle);

$query = "SELECT * FROM EMP";
ora_parse($cursor, $query) or die;
ora_exec($cursor);

echo "

\n";<br>echo  "$query\n\n";<br>$numcols = 0;<br>while(ora_fetch($cursor)) {<br>   $numcols = ora_numcols($cursor);<br>   for ($column=0; $column        $data = trim(ora_getcolumn($cursor, $column));<br>       if($data ==  "") $data = "NULL";<br>       echo  "$data\t";<br>   }<br>   echo  "\n";<br>}<br>$numrows = ora_numrows($cursor);<br>echo  "\nROWS RETURNED: $numrows\n";<br>echo  "
\n";

ora_close($cursor);

?>
(接分)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn