Archives of the TeradataForum
Message Posted: Mon, 13 Dec 2011 @ 01:08:03 GMT
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
LEFT OUTER JOIN DBA.Users AS u
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.
iv
|