× 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.



Why are you building the temporary table?

This program doesn't need it.  Just use:

     C/EXEC SQL
     C+ DECLARE SQLTBLCSR CURSOR FOR 
     C+   SELECT
     C+    FHDDAT, FHOT, FHPRO, FHDT, FHPUDT, FHDADT, FHSCD,FHCCD, FHCCT,
     C+    FHCST, FHCZIP, FHDTIM FROM FRL00144 WHERE FHDDAT >= FDATE AND
     C+    FHDDAT <= TDATE ORDER BY FHOT, FHDT
     C/END-EXEC

By building the temporary table and by returning only 1 record at a time, your 
performance is going to suck big time.

Charles Wilt
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
 

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of
> fkany@xxxxxxxxxxxxxxxxxx
> Sent: Tuesday, April 05, 2005 4:48 PM
> To: CN=RPG programming on the AS400/O=iSeries
> Subject: RE: SQLRPGLE won't compile...
> 
> 
> 
> 
> Program now compiles.  I set the break point in debug after 
> the "INSERT" section, queried QTEMP/SQLTABLE and there was no 
> data.  Can anyone see why?
> 
> Thanks,
> 
> Frank
> 
>      *
>      * GET_TERM_BILLS - Get Freight Bills by Terminal
>      
> *************************************************************
> *********
>      P GET_TERM_BILLS  B
>      ?*
>      ?* Get Numeric Version of Origin Terminal
>      C                   IF        #OT1 <> '*ALL'
>      C                   EVAL      NUM#OT1 = *ZEROS
>      C     #OT1          CHAIN     AAL03002
>      C                   IF        %FOUND(AAL03002)
>      C                   EVAL      NUM#OT1 = CT1TID
>      C                   ENDIF
>      C                   ENDIF
>      ?*
>      ?* Get Numeric Version of Destination Terminal
>      C                   IF        #DT1 <> '*ALL'
>      C                   EVAL      NUM#ODT = *ZEROS
>      C     #DT1          CHAIN     AAL03002
>      C                   IF        %FOUND(AAL03002)
>      C                   EVAL      NUM#ODT = CT1TID
>      C                   ENDIF
>      C                   ENDIF
>      ?*
>      ?* Create SQL table in QTEMP
>      C/EXEC SQL
>      C+ CREATE TABLE QTEMP/SQLTABLE (XFHDDAT DECIMAL (8 ), 
> XFHOT DECIMAL
>      C+ (3 ), XFHPRO DECIMAL (7 ), XFHDT DECIMAL (3 ), 
> XFHPUDT DECIMAL (8
>      C+ ), XFHDADT DECIMAL (8 ), XFHSCD CHARACTER (7 ), 
> XFHCCD CHARACTER
>      C+ (7 ), XFHCCT CHARACTER (20 ), XFHCST CHARACTER (2 ), XFHCZIP
>      C+ CHARACTER (6 ), XFHDTIM DECIMAL (6 ))
>      C/END-EXEC
>      ?*
>      ?* Insert records into SQL table
>      C/EXEC SQL
>      C+ INSERT INTO QTEMP/SQLTABLE (XFHDDAT, XFHOT, XFHPRO, XFHDT,
>      C+ XFHPUDT, XFHSCD, XFHCCD, XFHCCT, XFHCST, XFHCZIP, 
> XFHDTIM) SELECT
>      C+ FHDDAT, FHOT, FHPRO, FHDT, FHPUDT, FHDADT, FHSCD,FHCCD, FHCCT,
>      C+ FHCST, FHCZIP, FHDTIM FROM FRL00144 WHERE FHDDAT >= FDATE AND
>      C+ FHDDAT <= TDATE ORDER BY FHOT, FHDT
>      C/END-EXEC
>      ?*
>      ?* Declare SQL Cursor
>      C/EXEC SQL
>      C+ DECLARE SQLTBLCSR CURSOR FOR SELECT * FROM QTEMP/SQLTABLE
>      C/END-EXEC
>      ?*
>      ?* Open SQL Cursor
>      C/EXEC SQL
>      C+ OPEN SQLTBLCSR
>      C/END-EXEC
>      '*
>      '* Process Entire SQL Table File
>      '* -----------------------------
>      C                   DOU       SQLCOD <> 0
>      ?*
>      ?* Get SQLTABLE file record
>      C/EXEC SQL
>      C+ FETCH NEXT FROM SQLTBLCSR
>      C/END-EXEC
>      ?*
>      ?* EOF; Exit Loop
>      C                   IF        SQLCOD <> 0
>      C                   LEAVE
>      C                   ENDIF
>      ?*
>      ?* Validate Freight Bills
>      C                   EVAL      BADDATE = 'N'
>      C                   EVAL      NEXTFLG = 'N'
>      C                   CALLP     CHK_TERM_BILLS
>      ?*
>      ?* Invalid Date Range
>      C                   IF        BADDATE = 'Y'
>      C                   LEAVE
>      C                   ENDIF
>      ?*
>      ?* Invalid Freight Bill; Get Next Record
>      C                   IF        NEXTFLG = 'Y'
>      C                   ITER
>      C                   ENDIF
>      ?*
>      ?* Check Service Quality
>      C                   CALLP     CHK_SVC_QLTY
>      ?*
>      ?* Populate Work File(FR47P457) fields
>      C                   CALLP     POP_WORKF
>      ?*
>      ?* Write Record to Work File(FR47P457)
>      C                   WRITE     FREC457
>      ?*
>      C                   ENDDO
>      ?* DOU SQLCOD <> 0
>      ?*
>      ?* Close SQL Cursor
>      C/EXEC SQL
>      C+ CLOSE SQLTBLCSR
>      C/END-EXEC
>      ?*
>      P GET_TERM_BILLS  E
> 
> 
> 
> -- 
> This is the RPG programming on the AS400 / iSeries (RPG400-L) 
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.