×
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.
Hi Rob
I had it like that to begin with and it didn't work. The SQL book I looked
at seemed to suggest that I needed to use parameter markers and I found an
example in the archives that seemed like it would work.
I'll check out the Values Into that Charles suggested to see if that helps.
Thanks
Jonathan
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of rob@xxxxxxxxx
Sent: 21 May 2008 19:30
To: RPG programming on the AS400 / iSeries
Subject: RE: Reading a Sum(field) column in RPGSQLLE
I am assuming that wtotal is the sum, NOT, the field that you want to
store the sum into. If wtotal is the sum, then why would you ever use a
parameter marker?
In other words, if
d wtotal s 9P 2
and not
d wtotal s 10a inz('THISFIELD')
D THISFIELD S 9P 2
then why not use
C* Build the SQL Statement for the current line...
C Eval wSql = 'select sum(' + %Trim(CAENVN) +
C ') into :wtotal from ' + %Trim(CAEMVN)
...
C/Exec SQL
C+ Execute prpSQL
C/End-Exec
Rob Berendt
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.