× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm trying to use 'DECLARE GLOBAL TEMPORARY TABLE'.
In debug, I found no data in the FR47P457A file after the EXECUTE SQLCMD line.

I checked the job log and here are the messages:
================================================
PREPARE of statement SQLCMD completed.
Unable to retrieve query options file.
FR47P457A in QTEMP type *FILE already exists.
=======================================================

I pressed F1 on 'Unable to retrieve query options file' and here is what I 
found:
=================================================================
Message ID . . . . . . :            CPI433A                 Severity . . . . . 
. . :            00
Message type . . . . . :            Information
Date sent  . . . . . . :   04/08/05      Time sent  . . . . . . :   09:27:19

Message . . . . :   Unable to retrieve query options file.
Cause . . . . . :   Unable to retrieve the query options from member QAQQINI
  in file QAQQINI in library QUSRSYS for reason code 2.  The reason codes and
  their meanings follow:
    1 - Library QUSRSYS was not found.
    2 - File QAQQINI in library QUSRSYS was not found.
=========================================================

QAQQINI exists in QSYS and not in QUSRSYS.  Why is QAQQINI needed, what does it 
do?  Would it hurt anything to copy the QAQQINI object to QUSRSYS?

Here is the SQLRPGLE code:
==========================
 /FREE
   SQLSTRING = 'DECLARE GLOBAL TEMPORARY TABLE FR47P457A AS '        +
               '(SELECT FHOT, FHPRO, FHDT, FHDDAT, FHDTIM, FHDADT, ' +
                       'FHPUDT, FHSCD, FHCCD, FHCCT, FHCZIP '        +
                  'FROM FRL00144 WHERE FHDDAT >= ' + %CHAR(FDATE)    +
                                 ' AND FHDDAT <= ' + %CHAR(TDATE)    +
                                 ') WITH DATA';
 /END-FREE

      *
      * Prepare SQL Command String
C/EXEC SQL
C+     PREPARE SQLCMD FROM :SQLSTRING
C/END-EXEC
      *
      * Execute SQL Command String
C/EXEC SQL
C+     EXECUTE SQLCMD USING :FDATE, :TDATE
C/END-EXEC
      *
==============================

I appreciate all your help.  Thanks.

Frank



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.