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!

Insert data in clob

Ricky007May 29 2018 — edited May 31 2018

Dear experts,

                  I am trying to insert more than 4000 characters by using clob,it is not allowing to insert

i am getting below errror while inserting

SQL Error: ORA-01704: string literal too long

01704. 00000 -  "string literal too long"

*Cause:    The string literal is longer than 4000 characters.

*Action:   Use a string literal of at most 4000 characters.

           Longer values may only be entered using bind variables.

 

create TABLE test_clob

(

T_COL_CLOB CLOB

);

INSERT INTO TEST_CLOB

VALUES

(

'<breakfast_menu>

<food>

<name>Belgian Waffles</name>

<price>$5.95</price>

<description>

Two of our famous Belgian Waffles with plenty of real maple syrup

</description>

<calories>650</calories>

</food>

<food>

<name>Strawberry Belgian Waffles</name>

<price>$7.95</price>

<description>

Light Belgian waffles covered with strawberries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>

Light Belgian waffles covered with an assortment of fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>

Thick slices made from our homemade sourdough bread

</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>

Two eggs, bacon or sausage, toast, and our ever-popular hash browns

</description>

<calories>950</calories>

</food>

</breakfast_menu>'

)

Please help to insert data

This post has been answered by Jonathan Lewis on May 31 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2018
Added on May 29 2018
24 comments
38,447 views