Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 13 Dec 2011 @ 01:08:03 GMT

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

Subj:   Re: Capture output from "show select *" into a table
From:   frank.c.martinez

Once you've got it in a file, you can use anything, even BTEQ, to get it into a table. Writing SQL with SQL is also a good general technique. We use it for a whole lot of stuff, as in:

     SELECT 'GRANT ' || TRIM(rm.RoleName) || ' TO casimmo WITH ADMIN OPTION;'
       FROM "DBC".RoleMembers    AS rm
         ON Grantee = UserName
        AND UserName = 'casimmo'
      WHERE WithAdmin = 'Y'
        AND u.UserName IS NULL
        GROUP BY 1;

See the output is set of GRANT statements. Useful if you don't already have a tool that can do stuff for you. And even some of the good tools (and there are ones out there) don't do something like this.


  <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