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



Instead of answering the question, I will respond by asking questions.

Assuming you could get all of those field\column values [probably from the one record\row selected by the very specific WHERE clause criteria], deposited into the dim(100) array, with each P(7,0) value as a separate element in that array, how would you know _which_ value of those 100 values in the array is the _one value_ that you want? For example, will all but one value of the fields with naming trqs##, equal zero; i.e. such that the one non-zero value would be the _one value_ of interest?

If an answer to that question is not directly obvious, perhaps another question might clarify. What is the, or a representation of the [e.g. still using SELECT INTO syntax regardless it is disallowed], dynamic SQL that would make the solution /simple/?

Regards, Chuck

Mark Keller wrote:

I've get a series of 100 fields that I only need 1 value from. I'm doing a SELECT INTO so a dynamic statement won't work. If it did, my statement would be pretty simple. the program compiles OK, but I get
SQL0030 during execution. "Number of host variables less than result
values." Sorry if the formatting of the code below is funky...

Any thoughts on this? What am i doing wrong here? TIA and please don't embarrass me too bad! :) Mark

The Data structure:

D allRequests...
D DS
D theRequests 7P 0 dim(100)

The SQL statement:

exec sql
select trqs01, trqs02, <<SNIP trqs03 to trqs99>>, trqs00
into :allRequests
from FILE1
where TCLS = :c2Class and TVEN = :c2Vendor
and TSTY = :c2Style and TCLR = :c2Color
and TSIZ = :c2Size and TRID = :rowId ;

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.