|
****************************************************************************
Yes it is numeric
And my value is also numeric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Mark Keller
Sent: Wednesday, August 01, 2007 4:34 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: As much as I hate showing my own stupidity morethanonceaday(
I
am flat out stuck) Embedded SQL
Everything in your code looks fine. But the sqlcode seems to be saying
that the value you are pulling back is null. Very odd! Is custno a
numeric field?
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Doug Palme
Sent: Wednesday, August 01, 2007 2:25 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: As much as I hate showing my own stupidity more
thanonceaday( I am flat out stuck) Embedded SQL
I have run the statement in strsql and it returns a value as I would
expect....the exact same statement in the program fails....which is the
frustrating part.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Mark Keller
Sent: Wednesday, August 01, 2007 4:22 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: As much as I hate showing my own stupidity more than
onceaday( I am flat out stuck) Embedded SQL
You could do an ev zsum on the control line I believe.
You may want to run the statement in strsql also perhaps? Just to
verify.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Doug Palme
Sent: Wednesday, August 01, 2007 1:59 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: As much as I hate showing my own stupidity more than once
aday( I am flat out stuck) Embedded SQL
Ok,
I made that change but I am still getting the -305 error.......now
generally when working in DSPMODSRC, I can put the cursor on a variable
and hit F11 and it'll display the value......I notice that in an SQL
statement I cannot do that (with the variable defined as :ZSUM, etc.).
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Michael_Schutte@xxxxxxxxxxxx
Sent: Wednesday, August 01, 2007 3:52 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: As much as I hate showing my own stupidity more than once a
day( I am flat out stuck) Embedded SQL
oops, reverse the INTO and the FROM clauses.
Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
3776 South High Street, Columbus, OH 43207
Phone: 614/492-7419 Fax: 614/409-2017
Visit us on the web! www.bobevans.com
(Embedded image moved to file: pic31322.gif)
"The Secret's the Sauce! Enjoy our new Bob-B-Q Pulled Pork Knife & Fork
Sandwich!"
rpg400-l-bounces@xxxxxxxxxxxx wrote on 08/01/2007 04:50:06 PM:
Doug, you are doing a sum with no group by... so a cursor is notneeded
because only one result will be returned. You should simply sayFork
SELECT SUM(SLEXT$) FROM SLSTRNL5
INTO :ZSUM
WHERE SLACCT= :CUSTNO
AND SLTDAT > :ZBDATEN
AND SLTDAT <= :ZEDATEN
AND SLCLAS > 1
AND SLSHRT = ' '
Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
"The Secret's the Sauce! Enjoy our new Bob-B-Q Pulled Pork Knife &
Sandwich!"an
rpg400-l-bounces@xxxxxxxxxxxx wrote on 08/01/2007 04:44:38 PM:
I am reading a file and using the values within that file to create
SQLthe
that will go out and select a sum of sales figures for a particular
customer.
Here is the relevant SQL code:
C*---Prepare SQL Statement
C/EXEC SQL
C+ DECLARE C1 CURSOR FOR
C+ SELECT SUM(SLEXT$) FROM SLSTRNL5
C+ WHERE SLACCT= :CUSTNO
C+ AND SLTDAT > :ZBDATEN
C+ AND SLTDAT <= :ZEDATEN
C+ AND SLCLAS > 1
C+ AND SLSHRT = ' '
C/END-EXEC
I then open the cursor with the following:
C*---Open the Cursor
C/EXEC SQL
C+ OPEN C1
C/END-EXEC
I then am running a fetch statement with the following:
C*---Fetch the Result and place into Variable
C/EXEC SQL
C+ FETCH C1 INTO :ZSUM
C/END-EXEC
ZSUM is defined as an 9,2 on the D spec
Everything so far, at least to my eyes looks good...
However before I process that ZSUM data (output to a report) I check
correctly),SQLCOD and I am getting a return code of -305..I have checked thevariables
that I am passing in, such as CUSTNO (defined on the D SPEC
haveZBDATEN and ZEDATEN are also defined on the D SPEC correctly...so I
no************************************************************************
clue what variable the system is balking at.
Any assistance would be appreciated.
Douglas
****
************************************************************************
This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.
****
mailing
--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
listlist
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.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
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.
************************************************************************
****
This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution, or use of the information contained
herein (including any reliance thereon) is STRICTLY PROHIBITED. If you
received this transmission in error, please immediately contact the
sender and destroy the material in its entirety, whether in electronic
or hard copy format. Thank you.
************************************************************************
****
--
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.
--
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.
************************************************************************
****
This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.
************************************************************************
****
--
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.
--
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.
This transmission may contain information that is privileged,****************************************************************************
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.
--
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 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.