Home » SQL & PL/SQL » SQL & PL/SQL » how to store a large string in oracle (windows xp,oracle10g)
how to store a large string in oracle [message #431928] Fri, 20 November 2009 02:08 Go to next message
narayanank
Messages: 3
Registered: November 2009
Location: Chennai
Junior Member

how do i store large string in oracle. suggest solution with an example
Re: how to store a large string in oracle [message #431934 is a reply to message #431928] Fri, 20 November 2009 02:23 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Define large.
For strings up to 4000 characters, use a varchar2 column, for longer strings use a CLOB.
Re: how to store a large string in oracle [message #431961 is a reply to message #431934] Fri, 20 November 2009 04:21 Go to previous messageGo to next message
narayanank
Messages: 3
Registered: November 2009
Location: Chennai
Junior Member

i need an example for using clob type.could you help me with this
Re: how to store a large string in oracle [message #431964 is a reply to message #431961] Fri, 20 November 2009 04:26 Go to previous messageGo to next message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
An example in which language?
What did you search in documentation? http://tahiti.oracle.com

Regards
Michel
Re: how to store a large string in oracle [message #431988 is a reply to message #431928] Fri, 20 November 2009 05:27 Go to previous messageGo to next message
MarkusW
Messages: 20
Registered: June 2009
Location: Austria
Junior Member
Hi,

use following ALTER

ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );


Regards,
Mark
Re: how to store a large string in oracle [message #432006 is a reply to message #431988] Fri, 20 November 2009 06:00 Go to previous messageGo to next message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
MarkusW wrote on Fri, 20 November 2009 12:27
Hi,

use following ALTER

ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );


Regards,
Mark

1/ This does not answer in anyway the question
2/ This is invalid
3/ This is not formatted as per OraFAQ Forum Guide I encourage you to read

Regards
Michel
Re: how to store a large string in oracle [message #432019 is a reply to message #432006] Fri, 20 November 2009 07:45 Go to previous messageGo to next message
joy_division
Messages: 4617
Registered: February 2005
Location: East Coast USA
Senior Member
Michel Cadot wrote on Fri, 20 November 2009 07:00
MarkusW wrote on Fri, 20 November 2009 12:27

ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );


3/ This is not formatted as per OraFAQ Forum Guide I encourage you to read


I do not like unformatted code either, but to me one line is considered formatted.
Re: how to store a large string in oracle [message #432068 is a reply to message #431928] Fri, 20 November 2009 17:41 Go to previous messageGo to next message
wakula
Messages: 150
Registered: February 2008
Location: Poland
Senior Member
narayanank wrote on Fri, 20 November 2009 09:08
how do i store large string in oracle.

Using CLOB. Beware of the difference in its usage (and performance issues in most applications and in the Oracle itself).

narayanank wrote on Fri, 20 November 2009 09:08
suggest solution with an example

Use CLOB. That is the solution.
Use CLOB. That is the example.
Re: how to store a large string in oracle [message #462430 is a reply to message #432006] Thu, 24 June 2010 04:23 Go to previous messageGo to next message
MarkusW
Messages: 20
Registered: June 2009
Location: Austria
Junior Member
Michel Cadot wrote on Fri, 20 November 2009 06:00
MarkusW wrote on Fri, 20 November 2009 12:27
Hi,

use following ALTER

ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );


Regards,
Mark

1/ This does not answer in anyway the question
2/ This is invalid
3/ This is not formatted as per OraFAQ Forum Guide I encourage you to read

Regards
Michel



Hi Michel,

The question was
Quote:
how do i store large string in oracle.


Why is my ALTER command wrong?
ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );


How can we solve this problem?

Thanks for help.

Regards
Markus
Re: how to store a large string in oracle [message #462431 is a reply to message #462430] Thu, 24 June 2010 04:27 Go to previous messageGo to next message
ThomasG
Messages: 3185
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
MarkusW wrote on Thu, 24 June 2010 11:23
Why is my ALTER command wrong?


SQL> ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );
ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) )
                                    *
ERROR at line 1:
ORA-00907: missing right parenthesis

Re: how to store a large string in oracle [message #462432 is a reply to message #462430] Thu, 24 June 2010 04:31 Go to previous messageGo to next message
cookiemonster
Messages: 12320
Registered: September 2008
Location: Rainy Manchester
Senior Member
Have you tried your command?
And why are resurrecting this thread after 6 months?
Re: how to store a large string in oracle [message #462439 is a reply to message #462430] Thu, 24 June 2010 04:57 Go to previous messageGo to next message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Hi Michel,

The question was

Quote:
how do i store large string in oracle.


Why is my ALTER command wrong?

Code: ALTER TABLE MYTABLE ADD ( MYCOL CLOB(10000) );

How can we solve this problem?

You have to first read Database SQL Reference and avoid to post some silly untested stuff.

Regards
Michel

[Updated on: Thu, 24 June 2010 04:58]

Report message to a moderator

Re: how to store a large string in oracle [message #462441 is a reply to message #431964] Thu, 24 June 2010 05:00 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Michel Cadot wrote on Fri, 20 November 2009 15:56
An example in which language?
What did you search in documentation? http://tahiti.oracle.com

Regards
Michel


Even after 6 month Op did not realised his mistake... Sad

sriram

[Updated on: Thu, 24 June 2010 05:02]

Report message to a moderator

Re: how to store a large string in oracle [message #462459 is a reply to message #462439] Thu, 24 June 2010 05:49 Go to previous messageGo to next message
MarkusW
Messages: 20
Registered: June 2009
Location: Austria
Junior Member
Hi Michel,

sorry, my mistake!

Regards,
Markus

Re: how to store a large string in oracle [message #462460 is a reply to message #431961] Thu, 24 June 2010 05:51 Go to previous messageGo to next message
MarkusW
Messages: 20
Registered: June 2009
Location: Austria
Junior Member
Hi narayanank,

this example works!

CREATE TABLE test
  (
    id NUMBER(6), 
    text CLOB
  );

INSERT INTO test VALUES (1,'ddddddddddddddddddddddddddddddddddddddddddd');
COMMIT;



Regards,
Markus
Re: how to store a large string in oracle [message #462461 is a reply to message #462460] Thu, 24 June 2010 05:52 Go to previous messageGo to next message
cookiemonster
Messages: 12320
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'd like to hope that narayanank has worked that out by now.
Re: how to store a large string in oracle [message #462462 is a reply to message #462461] Thu, 24 June 2010 05:55 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Why you "altered" your "ALTER" statement into "CREATE" statement ?
And saying working...
sriram Smile
Re: how to store a large string in oracle [message #462466 is a reply to message #462462] Thu, 24 June 2010 06:16 Go to previous messageGo to next message
MarkusW
Messages: 20
Registered: June 2009
Location: Austria
Junior Member
I don't know how to add a new column with typ CLOB to a table, the create table command works.

The create Ttble command I have run and this worked.

Markus
Re: how to store a large string in oracle [message #462467 is a reply to message #462466] Thu, 24 June 2010 06:19 Go to previous messageGo to next message
cookiemonster
Messages: 12320
Registered: September 2008
Location: Rainy Manchester
Senior Member
And you can't work out from your create table statement how to fix your alter table statement?
Really?

You need to spend some time looking at the documentation - it tells you this stuff.
Re: how to store a large string in oracle [message #462468 is a reply to message #462466] Thu, 24 June 2010 06:19 Go to previous message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I don't know how to add a new column with typ CLOB to a table,

Solution in the link we provided you.

Regards
Michel
Previous Topic: table access
Next Topic: select statement problem - and tuning issue
Goto Forum:
  


Current Time: Thu Sep 29 07:22:55 CDT 2016

Total time taken to generate the page: 0.13238 seconds