Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

volcano

Programmer
Aug 29, 2000
136
HK
Hi, I have jave program that will parse a XML (I make use of SAX parser) and retrieve the content of some elements to store into the DB. However sometimes I found I got an error known as "java.sql.SQLException: ORA-01704: string literal too long". I have made the relative field in the table to be of datatype LONG. But it seems it doesn't help. Do you have any idea?

Thanks
 
The Oracle error you are getting means that you have exceeded the length of the column. I wouldn't recommend using longs since they have been deprecated. I typically use a Varchar2 which can hold up to 4000 characters. If I have data that is more than 4000 like 5000 for instance. I will place 4000 in one row and 1000 in another. If this method doesn't work for you I would suggest using Clob's. Using Clob's has the drawback of not being able to be searched easiler.

Nathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top