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



Fsad021l   if   e           k disk
Fsad070l   if   e           k disk
Fgod300p   if   e           k disk
Fimacl01   if   e           k disk
Filtaxp    o    e             disk

******************************************************************
C     *ENTRY        PLIST
C                   PARM                    fromdate          8
C                   PARM                    todate            8
******************************************************************
C     key           klist
C                   kfld                    CUSCHN
C                   kfld                    CUSSUB
C                   kfld                    ICCYY
C                   kfld                    IMM
C                   kfld                    IDD
C                   kfld                    INV#
C     G5key         klist
C                   kfld                    G5CUS#
C                   kfld                    G5PRDB

C/EXEC SQL
C+ Declare C1 cursor for
C+ Select distinct CUSCHN, CUSSUB, ICCYY, IMM, IDD, INV#
C+   From sad070p
C+   Join rcm on ccust = CUSCHN * 1000 + CUSSUB
C+  Where char(ICCYY * 10000 + IMM * 100 + IDD)
C+         between :fromdate and :todate
C+    and prodno in ('11000', 'A0012000')
C+    and cste = 'IL'
C+  Order by CUSCHN, CUSSUB, ICCYY, IMM, IDD, INV#
C/END-EXEC

C/EXEC SQL
C+ Open C1
C/END-EXEC
C                   Dou       SqlCod = 100
C/EXEC SQL
C+ Fetch from C1 into :CUSCHN, :CUSSUB, :ICCYY, :IMM, :IDD, :INV#
C/END-EXEC
C                   If        SqlCod <> 100

C     key           chain     sad021l
C                   if        %found(sad021l)
C                   clear                   iltaxr
C                   eval      CUST# = CUSCHN * 1000 + CUSSUB
C                   eval      DATE# = ICCYY * 10000 + IMM * 100 + IDD
C                   eval      INV## = INV#
C                   eval      totl  = iamt
C                   eval      ttax  = ISTTXA

C     key           setll     sad070l
C                   Dou       %eof(sad070l)
C     key           reade     sad070l
C                   if        not %eof(sad070l)
C                   select
C                   when      PRODNO = '11000'
C                   eval      BQTY  += qty
C                   eval      BASE  += lamt
C                   when      PRODNO = 'A0012000'
C                   eval      RQTY  += qty
C                   eval      RACK  += lamt
C                   when      PRODNO = 'A0402000'
C                   eval      FQTY  += qty
C                   eval      FUEL  += lamt
C                   other
C                   eval      OQTY  += qty
C                   eval      OTHR  += lamt
C                   eval(h)   OTAX  += lamt * STTAXR
C                   endsl
C                   endif
C                   enddo
C                   endif

C                   eval      G5CUS# = cust#
C                   eval      G5PRDB = '00000'
C     G5key         chain     god300p
C                   if        %found
C                   eval      exempt = 'Y'
C                   endif

C     cust#         setll     imacl01
C                   Dou       %eof(imacl01)
C     cust#         reade     imacl01
C                   if        not %eof(imacl01)
C                             and imtype = 'D'
C                             and (ddate = 0 and idel <> 'D'
C                                  or ddate > date#)
C                             and  IINDTE < date#
C                   eval(h)   IBASE += IMINCH
C                   eval(h)   IALLW += DRACAL
C                   if        IPRC  <  DRACRT
C                   eval(h)   IPRC   = DRACRT
C                   endif
C                   endif
C                   enddo
C                   write     iltaxr
C                   endif
C                   enddo
C/EXEC SQL
C+ Close C1
C/END-EXEC
C                   seton                                        lr



------------------------------

date: Thu, 12 May 2005 09:37:38 -0230
from: RPower@xxxxxxxxxx
subject: Embedded SQL

Guys,
fellow developer here is learning SQL.
Whilst the book he is using is technically and shows us all the nice
little things, it fails to show the entire picture.  Would someone out
there be willing to share a program using SQL so that we might look at a
real example?  TIA,

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
Tel: 709-576-8132
Email: rpower@xxxxxxxxxx
Website: http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. -
Sir Winston Churchill


------------------------------




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.