SQLCHN Variable - BBj


For this topic's original documentation, see SQLCHN Variable - Open SQL Channels.

BBj-Specific Information

By default, BBj SQL channel numbers can be any integer from 1 through Integer.MAX_VALUE (2147483647), but values above 32767 have the potential to confuse legacy applications that depend on accurate 16-bit integers in the SQLCHN variable. In BBj 14 and higher, the LEGACY_SQLCHN_LIMIT!COMPAT setting can be set to TRUE to limit SQLOPEN channel numbers to values of 32767 or less. This eliminates any possibility of inadvertently using SQL channel numbers that cannot be accurately reported in the SQLCHN variable.  For example:

READY

>PRINT STBL("!COMPAT","LEGACY_SQLCHN_LIMIT")

LEGACY_SQLCHN_LIMIT=FALSE

>PRINT Integer.MAX_VALUE

2147483647

>SQLOPEN (Integer.MAX_VALUE)"ChileCompany"

>PRINT HTA(SQLCHN)

FFFF

>SQLCLOSE (Integer.MAX_VALUE)

>SQLOPEN (Integer.MAX_VALUE)"ChileCompany"

!ERROR=14  (SQL Channel number can't be > 32767)

>

See Also

Variables - Alphabetical Listing