Configuration Command
Set the display width for a column of a subsequent select statement.
set COLUMN_NO WIDTH
COLUMN_NO
The number of the column whose display width you want to set. The first column in a select statement is column 1. The column number must be less than or equal to 64.
WIDTH
An integer whose absolute value is greater than or equal to 0 and less than 32767.
Description
If WIDTH is smaller than the size of the retrieved data, the data is truncated. If it is longer, the data is padded with blanks. If the WIDTH is negative (immediately preceded by a minus sign), the data is left-justified within the specified WIDTH. Otherwise, the column is right-justified.
To reset a column WIDTH to the default for that column (meaning no padding and no truncation), use a WIDTH of 0. To reset all columns to their default widths, use the startq command.
Server Only
This command conflicts with the SQL Server TRANSACT-SQL set command when the keyword set appears at the beginning of a command batch. For example, the following statement:
send "set TEXTSIZE 16384\n" to SQL
will produce a syntax error when submitted to SQL Server. This is because the application assumes this is a local command intended to set a column WIDTH format (assuming the default statement terminator, which is a newline).
To force the command to be interpreted as a TRANSACT-SQL command, precede the command with a backslash (\) character, which must appear as follows within an ESL send statement:
send "\\set TEXTSIZE 16384\n" to SQL
Example
response to StaffQuery
send "set 1 20 set 2 4 set 3 20\n" to SQL
send "select name, dept from org\n" to SQL
response to line from SQL
extract from input
take to 20 StaffName
See Also:
widths Command