Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 02 Oct 2003 @ 10:36:13 GMT


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


Subj:   Re: Importing file into bteq query
 
From:   Ferry, Craig

I can't use the CREATE TABLE as syntax because I want to be able to change the primary index on the fly (I didn't find a way to do this with CREATE TABLE). I have done the following to get around my challenge.

I build and run the new ddl using this syntax in a unix script.

DATABASE=dssbatch
TABLE_NAME=craig_test
INDEX="branch_id, date_loaded "

bteq << EOF
.logon teradata/${TTID},${TTPSWD};

ECHO '.OS /dba/dss/dbloads/dly_sales/dly_sales_sql.ddl $DATABASE
$TABLE_NAME "$INDEX" > tmp.ddl';

.RUN FILE=tmp.ddl

.OS rm tmp.ddl;

.exit


Here is the file I call.

echo CREATE MULTISET TABLE $1.$2,NO FALLBACK ,
echo NO BEFORE JOURNAL,
echo NO AFTER JOURNAL
echo '('
echo date_loaded DATE FORMAT \'YY/MM/DD\' TITLE \'Date Loaded\',
echo branch_id SMALLINT,
echo branch_name VARCHAR'('20')'
echo ')'
echo PRIMARY INDEX '('$3')';


Thanks for all the suggestions!!



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023