× 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 All,

I have tried every variation I can think of, and every example I have found on the List and elsewhere via Google. I must be missing something obvious.

I have a simple array containing a part number and quantity. I want to use SQL to populate the array, and I am almost sure I can do it in a single statement.

Using just a 'Select Into' the array winds up with all 50 elements having the same values. I also tried using a Cursor/Fetch Into with the same results. At this point I have spent hours on something I though would take five minutes.

Here is the simplist variation I have tried. If anyone can tell me what I am missing I would greatly appreciate it.

FYI - There are only 7 items with CLASS=Z, so it would not overflow the array. Once I get it working the way I want I will limit the number of rows returned in the production app.

H DFTACTGRP(*NO)

DarrDs ds qualified dim(50)
D SKU 15a
D Qty 7s 0

/free
exec sql
Select
SKU, QTY
Into
:arrDs
From
ONHAND
Where
CLASS='Z';

*inlr = *on;
Return;

/end-free

Thanks!
JD

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.