Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using (TITLE '') in Stored Procedures 1

Status
Not open for further replies.

TDDBA

MIS
Jan 7, 2002
5
US
I am generating SQL in a stored procedure (On Teradata Release V2R.04.00.03.03 so I can't execute it dynamically). I want to have the output not show the column names. I tried putting (TITLE '') after each SQL statement, but it doesn't have any affect. Then I tried to use cast(stmt1 as title '') in the Call statement and it would not let me put a blank in there (overrode it and called it Stmt1) if I put something else in there it did call it that. How can I eliminate the column headings?
 
Hi,
I don't understand what you mean. You can't return an ANSWER SET from a stored procedure. The best you can do is return the OUT parameter.

Now outside of not using OUT parameters I don't know if there is a way to not display the names of the out parameters.

Now If you want to return an answer set you create a temp table put the qualified rows via the stored procedure into the temp table and then after the stored procedure has executed you select the rows out of the temp table via normal SQL so yoy can put your TITLE "" on that SQL.

Maybe that answer set could be the OUT parameter you wanted to return.

then you create a macro which

call sp; sel out (title "") from temptable;

then tell people to execute the macro rather than calling the stored procedure directly.


 
Thanks for your great answer. Now that I think about it the labels are for the out parameters and not the columns. That explains why the (Title '') doesn't work. I don't know why I can't give the out parms a name of '' in the call stmt.

Do you know of a way to execute the SQL stmts that I generated without using BTEQ? (In the next release I can using dynamic SQL in the stored procedures but we don't have that release).
 
Hi,
Not that I am aware off. I thought I read some where there was a restriction that the out parametre name in the call had to be identical to parameter in the stored procedure. I think someone asked if we could relax that in a future release.

Now what query tool are you using. from BTEQ for example you can turn off column headings.

However I don't know if this feature works on OUT parameters since as was pointed out they aren't columns.

I wonder if other tools have a similar feature.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top