Re: Question About Viewing Portion of LONG Valu

From: Bimal Dey <euabim_at_eua.ericsson.se>
Date: Fri, 16 Jul 1993 14:58:24 GMT
Message-ID: <1993Jul16.145824.14782_at_eua.ericsson.se>


In article 3By_at_cbfsb.cb.att.com, sbrenner_at_cbnewsb.cb.att.com (scott.d.brenner) writes:
>I think this has been asked and answered before, but the solution has
>escaped me. I'm looking for a way to view the first 50 or so characters
>of a LONG datatype using SQL*Plus. (I know they're not really "characters,"
>but you know what I mean!) I can't use "substr()" because it's not a
>character column. Any clues?
>
>Please respond directly to me at sbrenner_at_attmail.com; I'll post the
>answer (assuming I get it) in a few days.
>
>a T d H v A a N n K c S e
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Scott D. Brenner AT&T Consumer Communications Services
>sbrenner_at_attmail.com Basking Ridge, New Jersey
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Include
 Column <Column Name> Format A50
and
 Set Wrap Off
in the beginning of your sql-script.

Good Luck.
/Bimal

Enclosing an example below:

SQL> Create Table longtest

  2         ( col1 Number(10),
  3           col2 Long);

Table created.

SQL> Insert Into longtest
  2 Values(10, '12345678901234567890123456789012345678901234567890');

1 row created.

SQL> Select * From longtest;

      COL1 COL2
---------- ---------------------------------------------------------------------        10 12345678901234567890123456789012345678901234567890

SQL> Column col1 Format 99;

SQL> Column col2 Format A25;
SQL> Select * From longtest;

COL1 COL2

---- -------------------------
  10 1234567890123456789012345
     6789012345678901234567890

SQL> Set Wrap On;
SQL> Select * From longtest;

COL1 COL2

---- -------------------------

  10 1234567890123456789012345
---
    _/_/_/  _/ _/     _/   _/   _/
   _/   _/ _/ _/_/ _/_/ _/  _/ _/
  _/_/_/  _/ _/  _/ _/ _/_/_/ _/
 _/   _/ _/ _/     _/ _/  _/ _/
_/_/_/  _/ _/     _/ _/  _/ _/_/_/
 ____________________________________________________________________________
!                                !                                           !
! Bimal Dey                      ! ELLEMTEL Telecommunication Systems Lab.   !
! System Analyst & Developer     ! Box - 1505                                !
!                                ! S-125 25 AELVSJOE                         !
! Administrative System Support  ! S W E D E N                               !
!________________________________!___________________________________________!
!                                !                                           !
! Voice: +46 8 727 36 43         ! Snailmail: 221:079                        !
! Fax  : +46 8 647 82 76         ! Email    : Bimal.Dey_at_eua.ericsson.se      !
! Telex: +54 812452 EUA S        ! Memo     : eua.euabim                     !
!________________________________!___________________________________________!
 
Received on Fri Jul 16 1993 - 16:58:24 CEST

Original text of this message