×
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.
I should probably leave this one for one of the RPG masters, but...
What is For_Read?
Is FLBHST a character data type? The you have to enclose your 470 etc. with
single quotes.
I am going to assume you are checking either sqlcode or sqlstate after EACH
SQL statement (otherwise, you're being a bad boy :))
Not to steer you away from programming this, but I think you could do this
in one UPDATE statement.
HTH, Elvis
Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com
-----Original Message-----
Subject: My SQL Question
Fellow Midrangers,
I am attempting to find the most recent occurrance by date of one of four
history codes. I will use only the first one I get to update another file.
I have tried SELECT DISTINCT and Fetch First Row Only but I get a 26501
SQLSTT error. I removed those and instead am reading all records which
qualify and handling the file update in another manner (only updating those
which have not been previously updated). This is a one time program so
strict efficiency is not required.
When I run this through debug, instead of getting one of my four codes, I am
getting blank codes. Where am I going wrong here? When I run it
interactively, I get records with codes.
// Get `470`, `471`, `476` And `478` Account Records From History;
// Assemble Select Statement
QQS = 'Select FLBSS, FLBTDT Desc, FLBHST From FLBHREP ';
// Set Where For Selected History Codes Since 02/01/2008
QQW = 'Where FLBHST In (?, ?, ?, ?) And FLBTDT >= ? '; // Codes Since
2/1/2008
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.