- Importing the structure of files
- The import steps
- Taking into account the evolution of the Informix database
- 1. Opening the connection
- 2. Running queries
- 3. Retrieving the result
- 4. Closing the connection
Native Informix Connector: Programming with HFSQL functions
Available only with this kind of connection
To use an Informix database with the Native Connector, the structure of Informix tables must be imported into the WINDEV or WEBDEV analysis
Differences compared to SQL programming: The queries are not required to handle the Informix data. Indeed, the HFSQL functions can be directly used to read data, perform searches, implement filters, ... However, the structure of Informix files must be imported into the WINDEV or WEBDEV analysis.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Importing the structure of files
The import steps
To perform this import:
- Start the data model editor: click among the quick access buttons.
- On the "Analysis" pane, in the "Creation" group, expand "Import" and select "Import the descriptions of files/tables".
- The wizard starts. A connection to the Informix database is automatically established and associated with the files imported into the analysis. This connection will be used to handle the Informix data file by programming.
In the different wizard screens, choose the following options:
- Type of database: Informix.
- Characteristics of the connection: Data server, User and password, database.
- The application will access the data in the current format.
- When the connection is established, all you have to do is select the tables that will be imported into the WINDEV or WEBDEV analysis. These tables can be handled by programming with the HFSQL functions of WLanguage. These tables will be displayed in blue in the data model editor.
Taking into account the evolution of the Informix database
To take into account the evolutions of the tables imported into the data model editor, on the "Analysis" pane, in the "Analysis" group, expand "Synchronization" and select "Update the analysis from the external databases".
A wizard starts, allowing you to:
- analyze the differences for the imported tables
- analyze the differences for the all the Informix tables.
1. Opening the connection
To open the connection to the Informix database, use the function HOpenConnection
, specifying the name of the connection to be opened. The connection name was defined when importing the structure of files into the analysis.
To modify some parameters of this connection (user name or password for example), call HConnect
: If you try to read the data file directly (function HReadFirst
, ...), the connection associated with description of the data file in the analysis will be opened automatically.
2. Running queries
- HExecuteQuery: is used to run a preset query with the query editor.
- HExecuteSQLQuery: is used to run a query by specifying the SQL code of query and the name that will be assigned to this SQL code.
// Initialize the "Customer_84" query
HExecuteQuery(CUSTOMER_84, "InformixDatabase", hQueryWithoutCorrection)
HExecuteSQLQuery(QryCustomer, hQueryWithoutCorrection, ...
"SELECT NAME FROM CUSTOMER", "InformixDatabase")
3. Retrieving the result
Remark: The HLockWrite and HLockReadWrite constants are ignored. Indeed, the read and/or write locks are not supported by the Native Connector.
4. Closing the connection
The function HCloseConnection
closes the database connection when all necessary queries have been performed.
This page is also available for…
Click [Add] to post a comment