Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert a String to xmltype

ProkopisFeb 5 2019 — edited Feb 5 2019

Hi all,

I have the following table

CREATE TABLE "TABLE_TMP" (

   "ISSUE_DATE" DATE,

   "XML" XMLTYPE );

  

I am trying using java to fill the table.

using the following statement

String xmlStr ='...';   -- 186.400 characters

sqlStmt = "INSERT INTO TABLE_TMP VALUES(sysdate,'" + xmlStr + "')";

resultSet = statement.executeQuery(sqlStmt);

The error I get is that the literal is too long.

java.sql.SQLException: ORA-01704: string literal too long

Is there any way to do it ?

I want to keep the column as xmltype in order to be able to

manage it easily.

Thanks in advance

Comments
Post Details
Added on Feb 5 2019
1 comment
678 views