SELECT INTO Class in BTEQ

Tools
Enthusiast

SELECT INTO Class in BTEQ

I have a following query written in BTEQ script file. Also i have command file which invokes the script file.
I want to return the record count results from the belwo select query to command file and based on that i will do some actions.
To return value from BTEQ to command file, i can use .RETURN mRecCnt.
But SELECT INTO class is not valid in BTEQ script. Is ther any other method to get the value?

SELECT COUNT(*) INTO mRecCnt FROM mytable WHERE ERRCODE > 0;
2 REPLIES
Teradata Employee

Re: SELECT INTO Class in BTEQ

You cannot specify/use the variables in the Bteq and mRecCnt is the variable in this case.

Enthusiast

Re: SELECT INTO Class in BTEQ

you mentioned you want to store the results into a command file...

in that case perhaps the .export file command of bteq would be of help to you ?