BinTxtBlob

Description

Specifies that binary data or an ANSI string is to be submitted
to or retrieved from a text column with UPDATEBLOB or SELECTBLOB.

Applies to

ASE, SYC Sybase Adaptive
Server Enterprise

I10 Informix

IN9 Informix

OLE DB

O90 Oracle9i

O10 Oracle 10g

ORA Oracle 11g

SNCSQL Native Client for Microsoft SQL Server

Syntax

BinTxtBlob=value

Parameter

Description

value

Specifies that a PowerBuilder blob that
is submitted to a text column in a database with UPDATEBLOB or
retrieved with SELECTBLOB contains binary data
or an ANSI string. Values are:

0 The blob contains a Unicode string.

1 The blob contains any kind of data that is not regarded as
a Unicode string.

Default

BinTxtBlob=0

Usage

By default, when you use the UPDATEBLOB and SELECTBLOBSQL statements with a database column
with a text datatype (long or clob for
Oracle or text for Adaptive Server or OLE DB
access to SQL Server), the PowerBuilder
blob that is updated or selected is expected to contain a Unicode string.
If the blob contains any other kind of data, such as binary data
or an ANSI string, set the BinTxtBlob database parameter to 1 before
calling SELECTBLOB or UPDATEBLOB.
This prevents PowerBuilder or the database server from attempting
to perform any conversion to or from Unicode.

Oracle O90, O10, and ORA The Oracle database interfaces use a Unicode database handle.
With the default setting (BinTxtBlob=0) and UPDATEBLOB, they
send the data directly to the Oracle server and inform the server
that the binary data contains Unicode strings. Any conversion needed
is performed by the server. For SELECTBLOB, they
get a Unicode string from the server.

When BinTxtBlob is set to 1, the value of the NLS_LANG
environment variable determines the binding character set. The ANSI
string or binary data is transferred directly to or from the server
as in PowerBuilder 9 and previous releases.

To set BinTxtBlob to 1 with the O90 interface, you must use
an Oracle 9.2 or later client, or you will receive an error.

OLE DB, SNC, ASE, and SYC If BinTxtBlob is set to 0, the OLE DB, SNC, ASE,
and SYC interfaces perform any necessary conversion. If BinTxtBlob
is set to 1, the data is passed to the server without conversion.

Examples

Example 1

In code, before calling SELECTBLOB or UPDATEBLOB with
a PowerBuilder blob that contains ANSI string data or binary data,
set the BinTxtBlob parameter to 1:

SQLCA.DBParm="BinTxtBlob=1"

Restore the default setting of 0 if an operation needs to
be performed on a blob that contains Unicode string data.

For example, suppose a Unicode string “ABC” stored
in client memory as “65 00 66 00 67 00” is updated
to the database using UPDATEBLOB. If BinTxtBlob is
set to 0, the data is converted to ANSI and stored in the database
text column as “65 66 67”. If BinTxtBlob is set
to 1, no conversion occurs and the data is stored in its original
form as “65 00 66 00 67 00”.