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
COMMAND | DESCRIPTION |
bteq <<! | This will invoke the BTEQ utility. ‘<<!’ represents the beginning of the statement blocks |
.LOGON TeradataServer/username,password | 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 |
.LOGOFF | This will log off the current user from Teradata |
! | This represents the end of statements |
Also read,