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



Are any of the variables you supplied ( order#, Item, QTY, or vin#)
parameters to your procedure? If so, make sure you actually passed them to
the procedure. I found one once where the parameter had options(*nopass)
but the programmer forgot to not touch it if it was not passed! Also, if
they happen to be based() on a pointer make sure that pointer has storage
allocated to it.

Stu




On Wed, Feb 9, 2011 at 16:42, Pete Helgren <pete@xxxxxxxxxx> wrote:

This one has me stumped. I have a prepared statement that selects a row
based on parameter values. The sql looks like this:

gSQLStmnt2 = 'select distinct extord, lprod, lqord, ' +
'substr(extvin,1,10) from ecl ' +
'inner join eclx01 on lord=extord and lline=exline ' +
'where lprod = ? and extvin = ? ';

I then do the following in another sub procedure:

c/free
EXEC SQL
PREPARE S2 FROM :gSQLStmnt2;
EXEC SQL
DECLARE C2 CURSOR FOR S2;
EXEC SQL
OPEN C2 USING :ItemNum, :Vin;
/end-free

When I run the program the joblog shows this:
.......
Blocking used for query.
Cursor C2 opened.
1 rows fetched from cursor C2.
Pointer not set for location referenced.

That MCH3601 occurs on this fetch:

FETCH FROM C2 INTO :order#,:Item,:QTY,:vin#;

This is the first time I have used a parameterized SQL statement in an
RPG program so I have probably done something wrong. The compiler
listing shows this at the statement the error points to:

451 C SQL_00032 IFEQ '1'
452 C EVAL ORDER# = SQL_00034
453 C EVAL ITEM = SQL_00035
454 C EVAL QTY = SQL_00036
455 C EVAL VIN# = SQL_00037
456 C END

It is almost as though it doesn't like the host variables. I double
checked the sizes and types of the variables and they *seem* OK.

Anybody seen something like this before and can point me to my error?

--
Pete Helgren
Value Added Software, Inc
www.asaap.com
www.opensource4i.com

--
This is the RPG programming on the IBM i / System i (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 thread ...

Replies:

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.