Special Variables

The global variable sybmsg is used by Sybtcl to store information related to its operation. The variable is an array and contains the keys described in the following list:

collengths

A list of the column lengths of the columns returned by sybcols.

coltypes

A list of the types of the columns returned by sybcols.

dateformat

Controls formatting of dates. Can be set to a string containing substitution strings, described at the end of this section.

dberr

Error number generated by the last DB-Library routine.

dberrstr

Error text associated with dberr.

fixedchar

Normally, trailing spaces are trimmed from character data. If set to yes, trailing spaces are retained.

floatprec

Number of decimal places to use for floating-point values. Default is 17.

handle

The handle of the last Sybtcl command.

line

Line number of the SQL command or stored procedure that generated the last message.

maxtext

Sets maximum amount of data returned by sybnext and sybreadtext commands. Default is 32,768 bytes.

msgno

Message number from the last Sybase server message.

msgtext

Message text associated with msgno.

nextrow

Indicates result of last SQL command. Possible values are described in the next list.

nullvalue

String value to return for null results. The default value default will return 0 for numeric types and a null string for others.

oserr

Operating system error number associated with the last DB-Library error.

oserrstr

Error text associated with oserr.

procname

Name of stored procedure that generated the last message.

retstatus

Return code of the last stored procedure that was executed.

Severity

Severity level of the last Sybase server message.

svrname

Name of the Sybase server that generated the last message.

The element $sybmsg(nextrow) can take the following values (which are also returned by the sybsql command):

FAIL

A server error has occurred.

NO_MORE_RESULTS

The final set of results has been processed.

NO_MORE_ROWS

All rows from the current result set have been processed, or the SQL command executed successfully but no rows are available.

PENDING

Asynchronous execution of command is still in progress.

REG_ROW

At least one row is available.

num

The last row retrieved was a compute row having compute ID number num.

The $sybmsg(dateformat) variable, described earlier, can contain the following format strings:

YYYY

Four-digit year (e.g., 1900)

YY

Two-digit year (00–99)

MM

Two-digit month (1–12)

MONTH

Name of month ( January–December)

MON

Abbreviated name of month ( Jan–Dec)

DD

Two-digit day (1–31)

hh

Two-digit hour (0–23)

mm

Two-digit minute (0–59)

ss

Two-digit second (0–59)

ms

Three-digit millisecond (0–999)

dy

Three-digit day of year (0–365)

dw

One-digit day of week (1–7, for Monday–Sunday)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset