duanhan5388 2011-07-19 04:57
浏览 99
已采纳

ODBC SQL update语句如果超过32,000个字符

Here is the problem: I have one giant string of xml data stored in a (BLOB)field in a table. It holds some strings 70k characters or more at times. I pull it out using an ODBC_Connection.

I can import (no problem).
I can manipulate the XML and save it back as a string (no problem).
I can save the string back into a mySQL field (no problem).

The problem comes when i try to save it back to its original field that i pulled it from. If I save the string with less than 32,000 characters, we are golden. If there are more than that many characters in the string, BAM. I get this error message.

( ! ) Warning: odbc_exec() [function.odbc-exec]: SQL error: [DataDirect][ODBC InterBase
driver][InterBase]Dynamic SQL Error, SQL error code = -104, token size exceeds limit,
SQL state 37000 in SQLExecDirect in ...\Test\index4.php on line 129 Call Stack

#   Time    Memory  Function    Location
1   0.0011  482872  {main}( )   ..\index4.php:0
2   0.1260  1033760 odbc_exec ( )   ..\index4.php:129

Here is the PHP code i am using just in case:

// Now save it back to the system
$conn=odbc_connect($DBNAME_O,$DBUSER_O,$DBPW_O);
if (!$conn)
{exit("Connection Failed: " . $conn);}
echo $tempFileXML;
$sql="UPDATE EHR_VISITS SET RECORD='$tempFileXML' WHERE EHR_VISITS_ID='1396'";
//  echo $theData;
$rs=odbc_exec($conn,$sql);
odbc_close($conn);  

Thanks for the help...

UPDATE: This is connected to an interbase database, not MS SQL. Also, I tried using a different ODBC driver, and got the same message but with a slightly higher character tolerance: 42000 instead of 37000.

HELP please....

  • 写回答

1条回答 默认 最新

  • doubei5310 2011-07-19 10:27
    关注

    Have you tried passing the data in as a parameter ?

    E.g:

    $sql = UPDATE EHR_VISITS SET RECORD=? WHERE EHR_VISITS_ID='1396'; 
    $stmt = odbc_prepare($conn, $sql); 
    $rs = odbc_execute($stmt, $tempFileXML);  
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集