Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting length og a LONG record.

Re: Getting length og a LONG record.

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 13 Oct 1999 16:22:26 +0200
Message-ID: <7u24m6$hgu$1@oceanite.cybercable.fr>


You can use a PL/SQL block:

v734> desc customer

 Name                            Null?    Type
 ------------------------------- -------- ----
 CUSTID                          NOT NULL NUMBER(6)
 NAME                                     CHAR(45)
 ADDRESS                                  CHAR(40)
 CITY                                     CHAR(30)
 STATE                                    CHAR(2)
 ZIP                                      CHAR(9)
 AREA                                     NUMBER(3)
 PHONE                                    CHAR(9)
 REPID                           NOT NULL NUMBER(4)
 CREDITLIMIT                              NUMBER(9,2)
 COMMENTS                                 LONG

v734> declare
  2     i integer := 0;
  3  begin
  4     dbms_output.enable (100000);
  5     for rec in (select comments from customer) loop
  6        i := i + 1;
  7        dbms_output.put_line ('record '||i||' length
'||length(rec.comments));
  8     end loop;

  9 end;
 10 /
record 1 length 71
record 2 length 56
record 3 length 87
record 4 length 45
record 5 length 68
record 6 length 129
record 7 length 73
record 8 length 142
record 9 length

PL/SQL procedure successfully completed.

--
Have a nice day
Michel

Martin Hepworth <maxsec_at_totalise.co.uk> a écrit dans le message : 38048F1C.CF917F73_at_totalise.co.uk...
>
> HI
> I'm running Oracle 7.3.4 (On solaris 2.6) and we have a little
> challenge. In Oracle 8 theres the DBMS_LOB package to get the actual
> length of a LONG record, but this doesn't exist in 7.x. So how do we do
> it (other than writing a Pro/C program :-)
>
> Martin
Received on Wed Oct 13 1999 - 09:22:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US