PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

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
HPrepareQuery (Function)
In French: HPrépareRequête
HFSQLHFSQL Client/ServerNot available with these kinds of connection
Initializes a query and declares this query to the database server in order to optimize the next executions of this query. This query is not run. Then, the query can be run by HExecuteQuery. This function is available for the queries with or without bind.
To free the resources of this query, use HCancelDeclaration.
We recommend that you use this function when the same query is run successively and when only some of the query parameters are modified at each execution.
This function is optional and it can only be used on the Client/Server databases (currently available for AS/400).
For the other databases accessed by a Native Access, OLE DB or ODBC, HPrepareSQLQuery runs the query.
This function cannot be used on the HFSQL databases (HFSQL Classic or Client/Server) and on the xBase databases.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Example
hPrepareQuery(QRY_MyQry, MyConnection, hQueryWithoutCorrection)

FOR I = 1 TO 10
QRY_MyQry.lastname = "LastName" + I
QRY_MyQry.firstname = "FirstName" + I
QRY_MyQry.age_ = I
HExecuteQuery(QRY_MyQry)
END
Syntax
<Result> = HPrepareQuery(<Query Name> , <Connection> [, <Mode>])
<Result>: Boolean
  • True if the query was initialized,
  • False otherwise. HErrorInfo returns more details about the problem.
<Query Name>: Character string (with or without quotes)
  • Name and full path of query (".WDR" file) to initialize.
  • Logical name of query to initialize.
If a query with the same name is already declared, it is replaced by the new query.
<Connection>: Character string (with or without quotes)
Name of a connection, defined in the data model editor or dynamically by HDescribeConnection. The query will be run via this connection.
<Mode>: Optional Integer constant
Option for initializing the query:
hQueryWithoutCorrection
Native Accesses No check is performed by the HFSQL engine. This option must be used if the query contains commands specific to a type of connection (Oracle, SQL Server, ...).
Caution: if this constant is used:
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Linux wd230hf.so
Minimum required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment