An Bteq Error Code return issue.Need Help


An Bteq Error Code return issue.Need Help

Hai friends,

Hope your are doing good .
i got a issue raised in project reqarding the bteq script .
Our environment is teradata on windows platform .
i want to capture the bteq script final return error code which is executed from windows command prompt .
i came to know from forums how it can be accomplished with the scripts written with in unix script by evaluating the return values by $? .
Is there any Inbuilt Environment variables for Bteq to store the return code as we do have in MLOAD (&sysrec).

we execute the bteq scripts very similar as we do in our home and institute lab like .

C:\Documents and Settings\kiran\teradata_bteq_scripts>bteq sample_bteq_script_log.txt

this line is pasted in BODI(an ETL tool) which we will use it for invoking the scripts and as schedular too.

please kindly tell is there any way to capture the return codes of the betq script in Windows Command Prompt.

if it can be captured in BODI at least . please let me know as early as possible . looking forward for your reply.

Tags (1)

Re: An Bteq Error Code return issue.Need Help

It is in an environment variable called errorlevel.

Re: An Bteq Error Code return issue.Need Help

The information in the link provided is pasted below...

The results are stored in a pseudo environment variable named errorlevel so...

echo Exit Code is %errorlevel%

and a special syntax of the if command:

if errorlevel

see if /? for details.

For Example

@echo off
if errorlevel 1 (
echo Failure Reason Given is %errorlevel%
exit /b %errorlevel%
Warning: if you set an environment variable name errorlevel, %errorlevel% will return that value and not the exit code. Use (set errorlevel=) to clear the environment variable.

how to implement the above logic to capture the bteq error codes in to the cmd variables.

Please Help me .