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



Depends on your select.  For a nice single file select you could do 
something like:

D MyDS   EDS                                            extname(myfile)
c/exec sql
c+ Select field1, field2 into :field1, :field2 from MyFile
c+ where keyfield=:SomeVar
c/end-exec

or even
c/exec sql
c+ select * into :MyDS from MyFile
c+ where keyfield=:SomeVar
c/end-exec


Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





Pete Helgren <Pete@xxxxxxxxxx> 
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/08/2005 01:51 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
Midrange Mailing List <MIDRANGE-L@xxxxxxxxxxxx>
cc

Subject
SQL Error SQLCOD = -000000303 SQLSTT = '42806'






Using embedded SQL in RPG IV.  V5R2M0.....

I get an SQLCOD = -000000303 with SQLSTT = '42806' which is telling me I 
have a host variable that is incompatible ("A value cannot be assigned 
to a host variable, because the data types are not compatible.")

OK...that doesn't surprise me, I have some numeric data coming in and I 
guess that I defined the host variable incorrectly.

So, two questions arise:

1.How can I tell which, of the 11 fields in my select statement, is 
causing the error? and...

2. Is there an "easy" way to define host variables (or some 'trick' I 
can use) so that my selected fields from the tables match the host 
variables I select them into?

Am I making this too hard?  In Java I can "point" my results to a result 
set (rs) and then access them using rs.field1, rs.field2, rs.field3, 
etc.  Mapping the select statement into host variables is a drag in 
RPG.  Perhaps there is an easier way? I am all ears....

Thanks,

Pete Helgren


-- 
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing 
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-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.