- Function HDeclareExternal: Use with the Native Connectors and/or the OLE DB provider
In french: HDéclareExterne
Not available with this kind of connection
Temporarily imports into the current analysis the description of a data file from an existing HFSQL data file. This data file is opened. To no longer use this file description, call HCancelDeclaration
- All the HFSQL functions can be used on the imported data file except for the integrity management.
- You can import as many descriptions as necessary.
- This function can be used with data files in XML format.
- The second syntax of this function cannot be used during an access to a database via Remote access.
- To use HDeclareExternal in a stored procedure:
- the relative path of the data file must be specified in relation to the directory of the database containing the stored procedure. The path must include the name and extension of the data file.
- no connection must be used: the current database on which the stored procedure is found will be used.
- By default, if the current project:
- is associated with an analysis, the lock mode applied to the data files is the multi-user mode (the files are not locked when they are opened and they can be accessed by the other applications).
- is not associated with an analysis, the lock mode performed on the data files is the single-user mode: the files are locked in read/write mode as soon as they are opened. This mode prevents the other applications from accessing the files already opened by the current application.
Function HDeclareExternal: Use with the Native Connectors and/or the OLE DB provider
By default, the logical name supplied to HDeclareExternal is considered as being the only name of the table. It is encapsulated by using the encapsulation characters corresponding to the database or specified by the OLE DB provider before being sent to the database (this is used to manage the table names containing special characters).
To provide a file name composed of <User name>.<Table name> (or depending on the database, <Schema name>.<Table name>) in HDeclareExternal, these names must be already formatted (using encapsulation characters corresponding to the database, or specified by the OLE DB provider).
Example for SQLServer:
The encapsulation characters are " ".
To change CUSTOMER into DBO.CUSTOMER with HDeclareExternal
, you must pass "DBO"."CUSTOMER".
Therefore, the following code must be used:
HDeclareExternal("""DBO"".""CLIENT""", sdClient, "MaConnexion")
Training (WINDEV): WD External file
This page is also available for…