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

Home -> Community -> Mailing Lists -> Oracle-L -> RE :Strange workings of Oracle

RE :Strange workings of Oracle

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Mon, 16 Oct 2000 10:11:11 +0200
Message-Id: <10651.119291@fatcity.com>


Rahul, Shreepal,

   If I may venture an opinion, I think that the LPAD() is a trick to have the name of the column always appear as 'CACHE' when executing a SELECT under SQL*Plus. Otherwise, you would have had something like :

      C
      -
      N

which might be more difficult to interpret. Now, I agree that having 'YES' or 'NO' wouldn't have cost much ...

-- 
Regards,

  Stephane Faroult
  email: sfaroult_at_oriolecorp.com 
  Oriole Corporation
  Voice:  +44  (0) 7050-696-269 
  Fax:    +44  (0) 7050-696-449 
  Performance Tools & Free Scripts
------------------------------------------------------------------
http://www.oriolecorp.com, designed by Oracle DBAs for Oracle DBAs
------------------------------------------------------------------
 

>
> Shreepad, found this line in the view text for dba_tables...
> lpad(decode(bitand(t.flags, 8), 8, 'Y', 'N'),5),
>
> why use LPAD ?? and why not use YES AND NO if the columns is varchar2(5) ??
>
> rahul
>
> >
> >
> >
> > Hi everyone,
> >
> > I noticed something very strange when i tried to cache a table.
> >
> > 1) I cached a table
> > alter table emp cache;
> > 2) Did a describe on dba_tables
> > One of the columns is :
> > CACHE VARCHAR2(5)
> > 3) SQL> select distinct cache from dba_tables ;
> >
> > CACHE
> > -----
> > N
> > Y
> > 4)SQL> select table_name,cache from dba_tables where cache='Y' ;
> >
> > no rows selected
> >
> > 5)select table_name,cache from dba_tables where cache like '%Y%';
> > TABLE_NAME CACHE
> > ------------------------------ -----
> > EMP Y
> >
> > 6) SQL> select table_name,cache from
> > dba_tables where cache=' Y';
> >
> > TABLE_NAME CACHE
> > ------------------------------ -----
> > EMP Y
> >
> > Gave 4 spaces before y
> >
> >
> >
> >
> > If the column is varchar2 shouldn't it put only Y rather than
> > prefixing it with spaces.
> >
> > Even for Datatype char , space are postfixed .
> >
> > I found this on Oracle 7.3.4 and Oracle 8.1.5
> >
> >
> > Thanks
Received on Mon Oct 16 2000 - 03:11:11 CDT

Original text of this message

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