Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 18 May 2006 @ 12:31:18 GMT


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


Subj:   Re: Bteq with .Repeat * Using
 
From:   Dieter Noeth

Anomy.Anom wrote

  I'm getting an syntax error on username try to loop through a list of users with the following code:  


You can't pass database-/table-/columnames as parameters.

Create the create-statement on the fly using EXPORT and then RUN that file.

Untested:

     .IMPORT VARTEXT FILE=/home1/test/work.d/users

     .EXPORT REPORT FILE=tmp_users_tmp

     .WIDTH 500;

     .REPEAT *
       USING username  (VARCHAR (30))
     SELECT
     'create user ' || :username || ' from DBS_users
     as
      perm                     = 0
     ,temporary            = 0
     ,password             = temp1234
     ,default database = object_db
     ,account                = ''\$L1\$''
     ,spool                    = 20000000000
     ,profile                   = default_DBS_profile
     ,default role           = DBSUser
     ,no fallback
     ,no before journal
     ,no after journal
     ;' (title '')
     ;

     .EXPORT RESET;

     .RUN FILE = tmp_users_tmp;

Dieter



     
  <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