Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How do I copy LONG columns between tables?
Stefan Larsson wrote:
>
> Fri, 24 Nov 2000 14:28:57 GMT, offroadbiker_at_hotmail.com (Darren M.) ->
> >Stefan,
> >
> >You can use varchar2 if the data in the long field will be less than 2000
> >characters. (On Oracle 8, you can go to 4000 char.)
>
> I wanted to use LONG as varchar2 without the limit on string length.
> I was kind of hoping that varchar2 and long would be equivalent except
> for performance... I was mistaken, it seems.
>
> >I have also done something like this in the past to copy long columns
> >between tables. I haven't written pl/sql for a while, so I've put comments
> >where I forget the syntax:
> >
> ... [pl/sql code]
>
> PL/SQL will still not let me declare or use LONG variables and columns
>
> I think
> INSERT INTO [table2]
> SELECT ... FROM [table1]
>
> is equivalent to your PL/SQL-code. Am I correct? Or are there differences
> between SQL inserts and PL/SQL inserts?
>
> I rewrote the tables like
> CREATE TABLE Elements(
> id_ INTEGER,
> pos_ INTEGER,
> elt_ VARCHAR2(2000)
> )
>
> and then I split the string into 2000 bytes chunks... a bit clumsy, I
> think. It would have been much cleaner to be able to use LONG columns.
>
> /stefan
You can use up to varchar2(32767) via PL/SQL...
Or take a look at LOB's (from 8.0+)...Much easier to use...
HTH
-- =========================================== Connor McDonald http://www.oracledba.co.uk (mirrored at http://www.oradba.freeserve.co.uk) "Some days you're the pigeon, some days you're the statue"Received on Fri Nov 24 2000 - 04:39:27 CST
![]() |
![]() |