PICXBINDING

Specifies the handling of fixed-length PIC X(n) host variables.

Syntax:

PICXBINDING={DEFAULT | PAD | TRIM | TRIMALL | FIXED | VARIABLE}

Parameters:

DEFAULT
SQL Server - SBCS locales
Always passes PIC X(n) host variables to SQL Server as fixed-length data, and trims trailing spaces. The ODBC driver pads the data with spaces before presenting it to SQL Server.
SQL Server - DBCS locales
Always passes PIC X(n) host variables to SQL Server as variable-length data, and trims trailing spaces. If the PIC X(n) host variable is all spaces, present one space to SQL Server.
All other DBMSs in all locales
Always passes PIC X(n) host variables to the DBMS as fixed-length data, and trims trailing spaces. If the PIC X(n) host variable is all spaces, present one space to the DBMS.
PAD or FIXED
Always preserves trailing spaces for all DBMSs in all locales, and passes the data to the DBMS as fixed-length data.
TRIM or VARIABLE
Always trims trailing spaces for all DBMSs in all locales. If the PIC X(n) host variable is all spaces, presents one space to the DBMS and passes the data to the DBMS as variable-length data.
TRIMALL
Always trims trailing spaces for all DBMSs in all locales. If the PIC X(n) host variable is all spaces, presents an empty string to the DBMS and passes the data to the DBMS as variable-length data.

Properties:

Default: DEFAULT

Dependencies:

ALLOWNULLCHAR is compatible with PICXBINDING only when PICXBINDING is omitted (meaning it is set to DEFAULT by default) or explicitly set to DEFAULT. Because PICXBINDING is designed to be used with PIC X(n) host variables that contain character data, not embedded binary data such as the NULL character ('\0'), an attempt to use ALLOWNULLCHAR when PICXBINDING is set to VARIABLE or FIXED could return unpredictable results.

Scope:

Used at compile time: No
Behavior at run time: Source file

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

For PIC X(n) host variables that contain all spaces, consider the following effects of PICXBINDING parameters when inserting into VARCHAR columns:

  • DEFAULT with SQL Server inserts a space-padded column
  • DEFAULT with all non-SQL Server DBMSs inserts one space into the column
  • PAD with all DBMSs inserts a space-padded column
  • TRIM with all DBMSs inserts one space into the column
  • TRIMALL with Oracle inserts a NULL value into the column
  • TRIMALL with all non-Oracle DBMSs inserts an empty string into the column