在php连接Oracle的过程中,往表中clob类型的字段插入>4000字符的数据时,会报错:字符串太长。
遇到这种问题该怎么解决呢?
能不能不使用大家所讨论的 存储 方法?
错误提示使用绑定,谁能给个示范的绑定代码?
谢谢了
------解决方案--------------------
<?php
putenv("ORACLE_SID=sid1");
putenv("ORACLE_HOME=/u01/app/oracle/product/8.0.5");
$handle = ora_plogon("SCOTT@sid1", "TIGER") or die;
$cursor = ora_open($handle);
ora_commitoff($handle);
$query = "SELECT * FROM EMP";
ora_parse($cursor, $query) or die;
ora_exec($cursor);
echo "<HTML><PRE>\n";
echo "$query\n\n";
$numcols = 0;
while(ora_fetch($cursor)) {
$numcols = ora_numcols($cursor);
for ($column=0; $column < $numcols; $column++) {
$data = trim(ora_getcolumn($cursor, $column));
if($data == "") $data = "NULL";
echo "$data\t";
}
echo "\n";
}
$numrows = ora_numrows($cursor);
echo "\nROWS RETURNED: $numrows\n";
echo "</PRE></HTML>\n";
ora_close($cursor);
?>
(接分)