Redirecting output in Teradata

Database
Enthusiast

Redirecting output in Teradata

Hi All

Is it possible to redirect the output of a teradata sql statement like show procedure so that the results get stored into a table
Eg what I want to do is get a list of all the procedures from in TD database and then obtain there meta data using shpr proc statement and finalyy use the meatdata of all the procs for analysis purpose

----

SELECT TABLENAME FROM DBC.TABLES WHERE TABLEKIND ='P'

Then store all the anmes in some table

for each procedure get the metadata and store the metad data in the table as

ProcName ProcDefinition

Then the defination column can be searched to do the anslyis for fields or tables.

IS the above process feasible Please Advice
2 REPLIES
Enthusiast

Re: Redirecting output in Teradata

Hi

If your definitions are small(dont remember the limit :-P) you can get the request text from dbc.Tables itself.There is a field in dbc.tables which gives you the request text of the object.But, if the definition is too big, then this field would not store the entire definition.

One more method I can think of is to export the result of "Show Procedure " into a file and them through some scripting logic Import it into your target table.

Enthusiast

Re: Redirecting output in Teradata

Hi Leo

How can we redirect the result of SHOW PROCEDURE command into a file

Thanks