The hQueryDefault mode is used when files involved in the query are in the analysis, and when the statement doesn’t contain any SQL/400 proprietary keyword or function, such as a library name.
If the files are not in the LIBL, use function ASExec to add the library in the LIBL, or to change the current library:
Example:
ASExec("CHGCURLIB MYLIBRARY")
HExecuteQuery(Query3,hQueryDefault)