Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Thu, 05 Sep 2002 @ 13:50:55 GMT





     
  <Prev Next>   <<First <Prev Next> Last>>  




Subj:   Re: Revealing underlying sql for teradata views?
 
From:   Narayan Murthy K S



You could use the SHOW command to get all the database objects (with their definition) affecting your sql query.

For example we know that dbc.dbcinfo is a view built on the dbc table dbc.dbcinfotbl.

So now if i need to know the database objects(with their definition) associated with the following query :

select * from dbc.dbcinfo;

i just need prefix the above with 'SHOW' keyword as follows :

SHOW
select * from dbc.dbcinfo;

 BTEQ -- Enter your DBC/SQL request or BTEQ command:
show sel * from dbc.dbcinfo;

show sel * from dbc.dbcinfo;

 *** Text of DDL statement returned.
 *** Total elapsed time was 1 second.

------------------------------------------------------------------------
CREATE SET TABLE DBC.DBCInfoTbl ,FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL
     (
      InfoKey VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      InfoData VARCHAR(16384) CHARACTER SET LATIN NOT CASESPECIFIC)
UNIQUE PRIMARY INDEX ( InfoKey );

 *** Text of DDL statement returned.
------------------------------------------------------------------------
REPLACE VIEW DBC.DBCInfo AS
SELECT
    InfoKey,
    InfoData
FROM DBC.DBCInfoTbl WITH CHECK OPTION;

- Narayan Murthy K S





     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008