| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: VARCHAR2 size question
Alejandro Nieto wrote:
> Hi there,
>
> I'm newby in Oracle and I have a problem with a VARCHAR datatype filed
> in a table in ORACLE 7.
>
> The issue is I have a table which contains several columns or field
> with VARCHAR2(2000) datatype. Those fields due to implementation
> requirement needs to grow i mean we need to store about 2Mbytes in the
> value that represent the field. I was thinking to use the LONG datatype
> but unfortunately in Oracle 7 only one column in the table can be LONG
> and i have more than one field in the same table which need to store
> about 2Mbytes.
>
> The first idea came to my mind is in order to store the value of say my
> attribute i should use 10 columns or fields in the table and then use an
> algorithm to store and retrieve the data into/from those 10 fields. The
> performance in this case is not a big issue because it is for a simulator.
>
> Is there anybody can help me out with a better solution that this poor one?
>
> Thanks a lot in advance for your help
> Alejandro
>
Assuming you absolutely cannot upgrade to Oracle8 (where you could use
one of the LOB datatypes), you might also consider multiple tables each
with a LONG. You'd then have to use a view to put them all together in a
single SELECT join. Of course, that means you'd probably have some
difficulty keeping all your tables in sync (maybe with a trigger).
The idea of multiple VARCHAR2 fields is okay if you absolutely know without any doubt that no one will ever change their mind. What I mean is you could put together columns named something like LOB01 thru LOBnn, each VARCHAR2(2000) and concatenate them whenever you need to retrieve them (maybe format them too). But as soon as you sit back to relax, someone will ask you to store 4 MB. Received on Fri Oct 25 2002 - 11:51:09 CDT
![]() |
![]() |