Description
When you retrieve data from a database into a DataWindow object or report, PowerBuilder does not get a result set description to validate the SELECT statement against the database server before retrieving the data. This means the retrieval should be faster, especially when you are accessing the database over a network. (This feature is called describeless retrieval.)
If you want to override the default behavior and have PowerBuilder get a description of the result set before retrieving data, set the StaticBind parameter to 0 or No.
Applies to
ADO.NET
ASE and SYC SAP Adaptive Server Enterprise
DIR SAP DirectConnect
ODBC
OLE DB
O90 Oracle9i
O10 Oracle 10g
ORA Oracle (for 11g and later)
SNC SQL Native Client for Microsoft SQL Server
MSOLEDBSQL Microsoft OLE DB Driver for SQL Server
Syntax
StaticBind=value
Parameter |
Description |
---|---|
value |
Specifies whether you want PowerBuilder to get a result set description before retrieving data from a database into a DataWindow object or report. Values are:
|
Default value
StaticBind=1
Usage
Validation
When StaticBind is set to 1 (the default), PowerBuilder does not validate the SELECT statement against the database server before retrieving data. It assumes that the result set matches the column format of the DataWindow object or report into which it is being retrieved. If a mismatch occurs, PowerBuilder displays an error.
Troubleshooting tips
Problems can occur in your application if the result set description obtained by the DataWindow object or report is different from the current database description of the result set. This can occur for the following reasons:
-
The database definition changes after you build the DataWindow object or report.
-
You build the DataWindow object or report while connected to one DBMS and then run it against a different DBMS.
To fix problems caused by conflicting result set descriptions, you can correct your DataWindow object or report definition by doing either of the following:
-
Export and edit your column definitions
-
Force a recompile of the SQL statement in the Database painter's Interactive SQL (ISQL) view (see the section called “Using the Database painter” in Users Guide for instructions)
If your DataWindow object or report and DBMS result set descriptions do not match and you want to avoid errors, set StaticBind to 0 or No to specify that PowerBuilder should always get a result set description before retrieving data into a DataWindow object or report.
Examples
To specify that you want PowerBuilder to get a result set description before retrieving data into a DataWindow object or report:
-
Database profile
Clear the Static Bind check box on the Transaction page (or System page in the case of the OLE DB interface) in the Database Profile Setup dialog box.
-
Application
To specify this statement in code, type the following:
SQLCA.DBParm="StaticBind=0"