CONNECTSTRING Command | Basic Teradata Query - CONNECTSTRING - Basic Teradata Query

Basic Teradata® Query Reference

Product
Basic Teradata Query
Release Number
17.10
Published
February 2022
Language
English (United States)
Last Update
2022-02-03
dita:mapPath
nnw1608578382132.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose

This control enables users to specify a character string that is used to supply a database connection properties list in key=value pair format.

For details on which key names are valid, refer to CLI's Reference Manual.

The command is not available to z/OS BTEQ users employing a TDP-mediated CLI.

Syntax

Diagram.svg

where the following is true:

SET
Is an optional keyword.
=
Is an optional keyword.
properties_list

Contains one or more, semicolon-separated, key=value pairs with or without surrounding double quotes around the values. When not supplied, the value of CONNECTSTRING reverts back to its default state.

Usage Notes

For batch mode (as opposed to interactive), BTEQ will enact a fatal error for invalid CONNECTSTRING command syntax.

All database sessions must be logged off in order to issue the command.

To use the command within a multi-command instruction, surround the list with single quotes and use 2 consecutive single quotes to represent each inner single quote. Prior to passing the string to CLI, BTEQ will remove the surrounding single quotes and will replace each instance of 2 consecutive inner single quotes with just one single quote. An overall even number of single quotes must be given for BTEQ to be able to interpret input correctly.

To supply a value that includes a double-quote character, the following quoting rules must be applied in order for BTEQ to provide a string that CLI will be able to parse:

  • Embedded double quote characters (i.e. not the first or last character in the value), are allowed and do not require enclosing the value in quotes. For example: somekey=abc"def
  • If a value contains a double quote character as the first or last character in the value, the value must be enclosed in double quotes, and the embedded double quote must be escaped by doubling it. For example: somekey="""abcdef"

The CONNECTSTRING command cannot be used in an SQL macro.

Example - TLS sslmode Option

The following input instruction shows a CONNECTSTRING command being used to indicate the sslmode option for TLS should be overridden.

.connectstring sslmode=require

Example - Multi-Command Instruction

The following input instruction shows a CONNECTSTRING command being proovided as its first step followed by a SHOW CONTROLS command provided as its second step. They will share the same result block in batch mode output but each step will be processed independently.

 .connectstring 'sslmode=require'; .show controls connectstring;

Example - Multi-Line Command

The following input instruction shows a CONNECTSTRING command being provided by using two lines where the first ends with a dash character to indicate continuation.

 .connectstring 'sslmode=re-
      quire'