discard stp output

Database
Enthusiast

discard stp output

Hi there,

 

CREATE PROCEDURE db.testproc (OUT theoutput char(5))

BEGIN

SET theoutput = 'ulli';

END;

 

CALL db.testproc( OUT1 );

 

Is there a way to call the above stp - without changing it - without the output, or to reroute / discard the output?

 

Background; I want to call someone else's stp from BTEQ, and I'am only interested in BTEQ's return-code and don't want the output (and filtering with shellscript is no option).

5 REPLIES 5
Ambassador

Re: discard stp output

In BTEQ you can suppress the output using

.set quiet on;
CALL db.testproc( OUT1 );
.set quiet off;

 

Teradata Employee

Re: discard stp output

Hi

 

You can .EXPORT to /dev/null:

 

BTEQ -- Enter your SQL request or BTEQ command:
.export file /dev/null
*** Warning: No data format given. Assuming REPORT carries over.
*** To reset export, type .EXPORT RESET
BTEQ -- Enter your SQL request or BTEQ command:
call db.testproc( OUT1 );


*** Procedure has been executed.
*** Total elapsed time was 1 second.


BTEQ -- Enter your SQL request or BTEQ command:
.export reset

*** Output returned to console.
BTEQ -- Enter your SQL request or BTEQ command:

 

HTH.

 

Cheers.

 

Carlos.

Tags (1)
Teradata Employee

Re: discard stp output

Oops!

 

Forgot .SET QUIET

 

Dieter's solution is better.

 

Cheers.

 

Carlos.

Enthusiast

Re: discard stp output

Thanks for the replies guys!

Highlighted
Teradata Employee

Re: discard stp output

Starting with BTEQ 16.20.00.04, the MESSAGEOUT command has a RESET option. This option causes BTEQ to restore standard output back to the original stdout/SYSPRINT stream, which could be a terminal screen, a redirected file, a pipe, or some other device. So if TTU 16.20 is being used, another choice might be to temporarily discard standard output using MESSAGEOUT and when done to use its RESET option to restore the original routing. For example...

 

.MESSAGEOUT FILE=/dev/null
<<script section>>
.MESSAGEOUT RESET