Teradata BTEQ utility is one of the most powerful and efficient tools of the Teradata system to perform many operations. In this post, we will see how the BTEQ logon is working.
BTEQ Logon example
Let us see a sample script with bteq logon command. The logon command is followed but the bteq logoff command.
bteq <<! .LOGON TeradataServer/username,password .IF ERRORCODE > 0 THEN .EXIT 1 .LOGOFF !
Let us break the above BTEQ commands and understand each of them
|This will invoke the BTEQ utility. ‘<<!’ represents the beginning of the statement blocks
|This is the main BTEQ LOGON command. This command will log you into the Teradata system with the credentials you have provided.
|.IF ERRORCODE > 0 THEN .EXIT 1
|This statement will exit the BTEQ if there is an error in the code
|This will log off the current user from Teradata
|This represents the end of statements