社区
基础编程
帖子详情
请问php怎么写一个长字符串到oracle9i的xmltype字段?
tssungeng
2004-11-26 02:40:12
直接insert的话,内容长了就提示错误。
请问怎么写一个长字符串到oracle9i的xmltype字段?
...全文
88
3
打赏
收藏
请问php怎么写一个长字符串到oracle9i的xmltype字段?
直接insert的话,内容长了就提示错误。 请问怎么写一个长字符串到oracle9i的xmltype字段?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tssungeng
2004-11-29
打赏
举报
回复
自己写了一段代码,但是还不是不行
下面是我的代码:
***************************8
<?
/*
//(tabel_name:articles)DDL; //just for test;
//create table articles (id number(11),content sys.xmltype);
*/
//----------This is insert test----------------------------------
$conn = @OCILogon("in_user","user_in","bigfish");
//$stmt = @OCIParse($conn,"insert into articles (id,content) values(1,sys.xmlType.createXML(EMPTY_CLOB())) RETURNING content INTO:CONTENT");
$stmt = @OCIParse($conn,"insert into articles (id,content) values(1,empty_clob()) RETURNING content INTO:CONTENT");
$clob = @OCINewDescriptor($conn,OCI_D_LOB);
OCIBindByName($stmt,':CONTENT',&$clob,"1",OCI_B_CLOB);
OCIExecute($stmt,OCI_DEFAULT);
if ($clob->save("<root><a>JUST TEST</a></root>"))
{
OCICommit($conn);
echo "Insert succes!";
}
else
{
echo "Insert default!";
}
//---------------Insert end-----------------------------------------
//---------------Select start---------------------------------------
$sql = "select content from articles order by id desc";
$stmt = @OCIParse($conn,$sql);
@OCIExecute($stmt,OCI_DEFAULT);
@OCIFetchInto($stmt,&$rows,OCI_RETURN_LOBS);
echo "<br>Content is:\"".$rows[0]."\"";
//---------------Select end-----------------------------------------
?>
****************************8
报错:
Warning: ociexecute(): OCIStmtExecute: ORA-00932: inconsistent datatypes: expected NUMBER got CLOB in /home/www/bigfish/sgtest/testclob.php on line 12
Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in /home/www/bigfish/sgtest/testclob.php on line 13
Insert default!
Content is:""
Warning: Unknown(): _oci_close_session: OCISessionEnd: ORA-00600: internal error code, arguments: [729], [28], [space leak], [], [], [], [], [] in Unknown on line 0
tssungeng
2004-11-26
打赏
举报
回复
谢谢!一起鼎
qcbao
2004-11-26
打赏
举报
回复
不知道,帮你顶
PLSQL_developer教程
对初学者很有用,文档中,有对pl/sql 操作的介绍,功能,设置相关的介绍....
oracle
xml
type
大小,简介
Oracle
xml
type
在向大家详细介绍
Oracle
之前,首先让大家了解下
Oracle
xml
type
是什么,
Oracle
从
9i
开始支持一种新的数据类型----
xml
type
,用于存储和管理
xml
数据,并提供了很多的functions,用来直接读取
xml
文档和管理节点。下面将介绍
Oracle
xml
type
的一些基本使用。1.建立含有
Oracle
xml
type
数据类型的表create table abc (id nu...
oracle
xml
type
创建 、插入、更新、查找
[文章摘要]介绍了
oracle
9i
的
xml
type
数据类型的基本使用 包括:建立含有
xml
type
数据类型的表 插入(insert)数据 查询(select)数据 更新(update)数据 添加超过4k字节的
xml
文档到
xml
type
型
字段
适合初学者。 关键词:
oracle
9i
xml
type
oracle
从
9i
开始支持一种新的数据类型----
xml
type
,用于存
oracle
的
xml
type
例子
oracle
从
9i
开始支持一种新的数据类型----
xml
type
,用于存储和管理
xml
数据,并提供了很多的functions,用来直接读取
xml
文档和管理节点。下面将介绍
xml
type
的一些基本使用。 1.建立含有
xml
type
数据类型的表 create table abc (id number,
xml
doc sys.
xml
type
); 声明
xml
type
型
字段
用:
Oracle
中的
XML
TYPE
应用学习
Oracle
之
xml
type
应用(1)介绍了
oracle
9i
的
xml
type
数据类型的基本使用包括:建立含有
xml
type
数据类型的表插入(insert)数据查询(select)数据更新(update)数据添加超过4k字节的
xml
文档到
xml
type
型
字段
适合初学者。 关键词:
oracle
9i
xml
type
oracle
从
9i
开始支持一种新的数据类型----
xml
type
,用于存储
基础编程
21,891
社区成员
140,343
社区内容
发帖
与我相关
我的任务
基础编程
从PHP安装配置,PHP入门,PHP基础到PHP应用
复制链接
扫一扫
分享
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章