PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Main remarks
  • Required versions
  • Unicode items
  • Lock time-out
  • Default values of items
  • Specific features of Native DB2 Connector
  • Analysis options
  • User types
  • INSERT queries and automatic identifier
  • Identical records
  • Independent contexts
  • SQL locks
  • HFSQL lock
  • Duplicate error on the Automatic Identifier item
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Native DB2 Connector: Specific features and remarks
Native AccessesAvailable only with this kind of connection
Overview
The following paragraphs present the main remarks and the specific features of Native DB2 Connector (also called Native DB2 Access).
Main remarks

Required versions

Caution: This version of Native DB2 Connector operates with WINDEV and WEBDEV 22.

Unicode items

The Unicode items are not supported by the Native DB2 Access. We advise you to use text items in Ansi format and to perform the conversion (if necessary) with UnicodeToAnsi.
HCreation will display an error message when creating files containing items in Unicode format.

Lock time-out

The lock time-outs on a DB2 database are not limited by default. The application can be locked if the two following conditions occur at the same time:
  • record locked by SQLLock,
  • this record is already locked.
We strongly advise you to define a lock time-out for each DB2 database used with the Native DB2 Connector. In most cases, the lock time-out is set to 30 seconds.
See the documentation specific to DB2 for more details.
Versions 21 and later

Default values of items

The default values of items are managed by Native DB2 Connector. The default values can be:
  • a value,
  • an SQL formula. In this case, the SQL expression must be recognized by the HFSQL engine and by the DB2 database. The only expression that can be used is CURRENT_TIMESTAMP.
New in version 21

Default values of items

The default values of items are managed by Native DB2 Connector. The default values can be:
  • a value,
  • an SQL formula. In this case, the SQL expression must be recognized by the HFSQL engine and by the DB2 database. The only expression that can be used is CURRENT_TIMESTAMP.

Default values of items

The default values of items are managed by Native DB2 Connector. The default values can be:
  • a value,
  • an SQL formula. In this case, the SQL expression must be recognized by the HFSQL engine and by the DB2 database. The only expression that can be used is CURRENT_TIMESTAMP.
Specific features of Native DB2 Connector

Analysis options

  • The analysis options regarding the full-text indexes are not supported by the Native Connector.
  • The analysis options regarding the partial indexing of text memos are not supported by the Native Connector.

User types

The Native DB2 Connector does not support the user types defined in DB2.

INSERT queries and automatic identifier

The automatic identifiers are not supported by the INSERT queries (created by programming or in the query editor). To use an automatic identifier, call HAdd on the table.

Identical records

The Native DB2 Connector cannot differentiate between two identical records (which means records with identical values for all items, excluding memo items).
When a record is modified or deleted, all the identical records will be modified or deleted.

Independent contexts

The Native DB2 Connector does not support the independent contexts. All the operations are performed in the same HFSQL context, even if an independent context was requested for a window, a page or a report.

SQL locks

In a browse performed by SQLFetch and SQLGetCol, the record currently read is locked in write mode.
When using SQLLock, the Native Connector browses the data on a "repeatable read" isolation level (see the documentation about DB2 for more details).
Therefore, several users can simultaneously lock a record in write mode (SQLLock returns True for both users). However, only the user who locked the record first will be able to modify it or to delete it. The other users will be able to access the record in read-only.

HFSQL lock

The locks CANNOT be used with the HFSQL functions in this version.

Duplicate error on the Automatic Identifier item

The "Automatic identifier" column of a table created by HCreation is such as:
BIGINT NOT NULL GENERATED BY DEFAULT
AS IDENTITY (START WITH 1, INCREMENT BY 1), PRIMARY KEY
The value of the automatic identifier is automatically managed by DB2.
To do so, a counter is incremented whenever an addition is performed.
However, DB2 does not increment the counter if you force the value of the automatic identifier in an INSERT query.
When another addition is performed, a duplicate error may occur if DB2 automatically generates a value that already exists for the automatic identifier.
To avoid this problem, run the following query to reinitialize the value of the counter to a value greater than the specified identifier:
ALTER TABLE <Table name> ALTER COLUMN <Name of auto ID>
RESTART WITH <Max value of auto ID in file +1>
Note: The Native DB2 Connector automatically performs this operation after the call to HAdd(hSetIdAuto).
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment