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



further info: I moved x3errind above the amount fields (and the select
statement) and I'm still getting the error on that field - it's
ignoring x3errind in the data structure. x3ErrInd is blank and x3DAMT
is zero, x3CAMT has DAMT in it and x3CNT has CAMT in it.

screwy. is there an issue using max() on an alpha field?

On Fri, May 11, 2012 at 9:52 AM, rick baird <rick.baird@xxxxxxxxx> wrote:
Hey all.  I'm getting an SQL0030 - Number of host variables less than
result values - error on the following code.

I'm counting eight variables in the data structure and eight in the
select statement.  I run the sql interactively and I get eight
columns.  x3Errind is blank after each fetch. the rest of the field
values are as expected, so for some reason it doesn't like the last
field in my DS.  No other errors and no warnings on that data
structure in my compile listing.

Any ideas would be greatly appreciated!  Thanks!

D C3ds            ds                  inz
D  x3CMPY                             like(ICMPY)
D  x3JRNL                             like(IJRNL)
D  x3BAT                              like(IBAT )
D  x3YYPP                             like(IYYPP)
D  x3DAMT                       11  2
D  x3CAMT                       11  2
D  x3CNT                         8  0
D  x3ErrInd                           like(IERRIND)

C/exec sql
C+    Declare C3
C+     cursor for
C+     select ICMPY,
C+            IJRNL,
C+            IBAT,
C+            IYYPP,
C+            cast(sum(IDAMT) as dec(11,2)),
C+            cast(sum(ICAMT) as dec(11,2)),
C+            cast(count(*) as dec(8,0)),
C+            max(IERRIND)
C+       from JRIMMAST
C+      group by
C+            ICMPY,
C+            IJRNL,
C+            IYYPP,
C+            IBAT
C+      order by
C+            ICMPY,
C+            IJRNL,
C+            IYYPP,
C+            IBAT
C/end-exec
---
C/exec sql
C+    open    C3
C/end-exec
---
C/exec sql
C+    fetch C3
C+     into :C3ds
C/end-exec

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.