The user startup string is a limited sequence of SQL requests that you can submit at any time after a session has been established. The length of a startup string is limited to 255 characters.
- You log on to the database through BTEQ.
- You establish a JDBC connection using the Teradata JDBC Driver and have specified the connection parameter RUNSTARTUP=ON. For more information about using a startup string with the Teradata JDBC Driver, see the Teradata JDBC Driver Reference, available at https://teradata-docs.s3.amazonaws.com/doc/connectivity/jdbc/reference/current/frameset.html.
- An application that uses CLIv2 invokes the startup string using the CLIv2 RunStartUp function. If a startup string is not defined for the user, the database returns an error to the requestor.
Only BTEQ, the Teradata JDBC Driver, and CLIv2 support startup strings.
The remainder of this section describes how to use a startup string with BTEQ.
The following BTEQ example shows how the system invokes a startup string. Suppose you define the startup string for a user as 'ECHO ''.SHOW CONTROLS'';' .17. The .SHOW CONTROLS command returns the current settings of the BTEQ formatting command options.
When the user logs onto the database, the following events occur in the indicated order.
- BTEQ submits a RunStartUp request to the database.
- The database executes the specified ECHO request and returns the BTEQ command string .SHOW CONTROLS.
- BTEQ executes the command returned to it, .SHOW CONTROLS.
- The database returns the settings of the BTEQ formatting command options for the current session.
Suppose you define the startup string for another user as ‘SELECT DATE, TIME;’
When this user logs onto the database, the following events occur in the indicated order.
- BTEQ submits a RunStartUp request to the database.
- The database executes the SELECT DATE, TIME request and returns the answer set.
- BTEQ displays the returned answer set.