Home » SQL & PL/SQL » SQL & PL/SQL » Error: String literal too long (Oracle 9i)
Error: String literal too long [message #305524] Tue, 11 March 2008 03:21 Go to next message
kanthikota
Messages: 6
Registered: March 2008
Location: Pune
Junior Member

When I am trying to update a column, datatype of CLOB with a string of more than 4000 characters, I am getting an error saying "String literal too long". Can anyone tell me how can I insert a string of more than 4000 characters in a column of a Oracle table...
Re: Error: String literal too long [message #305529 is a reply to message #305524] Tue, 11 March 2008 03:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Concatenate several strings that are less then 4000 bytes.
This is not an expert question. Why did you post this in expert forum and newbie one?

It is clearly stated in the forum description: "Newbies should not post to this forum!"
Expert notion is defined in the sticky: Not an EXPERT? Post in the NEWBIES forum, NOT here
Rules are described in: OraFAQ Forum Guide

Regards
Michel
Re: Error: String literal too long [message #305552 is a reply to message #305529] Tue, 11 March 2008 04:42 Go to previous messageGo to next message
kanthikota
Messages: 6
Registered: March 2008
Location: Pune
Junior Member

Hi Michel,

I am not doing the update from the front end. I am doing the manual update in the backend by using a normal update statement.
For suppose myTable is having a column col1 of CLOB datatype.
When i put my update statement in this format

Update myTable Set col1 = 'content of my string(single sql query which is of more than 4000 characters)' where condition

and executing the same in TOAD 9.0 I am getting the error as mentioned above. Here i am not taking the content into any variable. So can u tell me why this is throwing an error...??
Re: Error: String literal too long [message #305554 is a reply to message #305552] Tue, 11 March 2008 04:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use:
Update myTable Set col1 = 'content of your string splitted '||'in strings '||'less than 4000 characters' where condition

Regards
Michel
Re: Error: String literal too long [message #305589 is a reply to message #305554] Tue, 11 March 2008 05:53 Go to previous messageGo to next message
kanthikota
Messages: 6
Registered: March 2008
Location: Pune
Junior Member

I have done the same as u mentioned and my TOAD hanged up. After that i have restarted the TOAD and i executed the same again i got the message "ORA-01489: result of string concatenation is too long".
Re: Error: String literal too long [message #305597 is a reply to message #305589] Tue, 11 March 2008 06:04 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So you can't do it this way with your data.
You have to use PL/SQL and DBMS_LOB.APPEND or other programming language.

Regards
Michel
Previous Topic: How to Drop invalid synonyms
Next Topic: mutiple adress intable
Goto Forum:
  


Current Time: Fri Dec 09 21:05:13 CST 2016

Total time taken to generate the page: 0.10035 seconds