Sql 使用Oracle将XML请求插入clob列
我确实有如下XML请求:Sql 使用Oracle将XML请求插入clob列,sql,xml,oracle,Sql,Xml,Oracle,我确实有如下XML请求: <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:toy="ToyotaWebServiceHost" xmlns:soapenc="http://sche
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:toy="ToyotaWebServiceHost" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<toy:CreateOrder soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<orderToCreate xsi:type="enc:WebServiceOrder" xmlns:enc="ToyotaWebServiceHost/encoded">
<OrderRows xsi:type="enc:ArrayOfWebServiceOrderRow" soapenc:arrayType="enc:WebServiceOrderRow[]"/>
<OrderId xsi:type="xsd:string">?</OrderId>
</orderToCreate>
</toy:CreateOrder>
</soapenv:Body>
</soapenv:Envelope>
?
我想将它插入clob列中的表中,但由于双引号(“”),它不可插入
并观察到以下误差。
SQL错误:ORA-01756:带引号的字符串未正确终止
它是不可插入的。请建议Oracle使用单引号来分隔字符串 使用单引号,不需要转义双引号-参见下面的示例
create table tab (my_clob clob);
insert into tab (my_clob)
values (
'<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:toy="ToyotaWebServiceHost" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<toy:CreateOrder soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<orderToCreate xsi:type="enc:WebServiceOrder" xmlns:enc="ToyotaWebServiceHost/encoded">
<OrderRows xsi:type="enc:ArrayOfWebServiceOrderRow" soapenc:arrayType="enc:WebServiceOrderRow[]"/>
<OrderId xsi:type="xsd:string">?</OrderId>
</orderToCreate>
</toy:CreateOrder>
</soapenv:Body>
</soapenv:Envelope>'
);
1 row inserted.
create table选项卡(my_clob clob);
插入到选项卡(我的clob)
价值观(
'
?
'
);
插入1行。