× 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 would pass the string IN_ITEMLIST as *0181*0183*90005* where "*" is some
character that is guaranteed -not- to appear in SUBECD and then change the
last line in the WHERE clause to

  AND LOCATE("*" || TRIM(SUBECD) || "*", IN_ITEMLIST) > 0

HTH,
Gary

> -----Original Message-----
> From: java400-l-bounces@xxxxxxxxxxxx 
> [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Clapham, Paul
> Sent: Wednesday, April 05, 2006 2:13 PM
> To: Java Programming on and around the iSeries / AS400
> Subject: RE: Calling stored procedure from Java app
> 
> "I just want the stored procedure to interpret exactly what 
> I'm passing it."
> 
> And that's exactly what happens. Conceptually you're passing 
> it a string. Just one string. The callable-statement 
> parameter mechanism conceptually puts quotes around that one 
> string and plugs it into the parameter. That results in a 
> IN-clause that is comparing to just one string. There is no 
> way to pass it two or three or four strings (which is what 
> you would like to do) because you only have one parameter.
> 
> "There must be a way..."
> 
> Let me put it this way. Your question (usually in the context 
> of PreparedStatement) has been asked approximately biweekly 
> on Sun's Java forum for the last several years. From time to 
> time the usual "solutions" are proposed but they turn out not 
> to work. Nobody has ever posted a working solution. To me 
> that says that there is no way. But if you find one, there 
> are thousands of people who want to know what it is.
> 
> Sorry,
> PC2
> 
> -----Original Message-----
> From: java400-l-bounces@xxxxxxxxxxxx 
> [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kelly Jones
> Sent: April 5, 2006 13:58
> To: Java Programming on and around the iSeries / AS400
> Subject: RE: Calling stored procedure from Java app
> 
> Hi Paul,
> 
> Yes, I am looking for the resulting SQL statement to look 
> like what you describe.  However, I'm not sure what you mean 
> by "A CallableStatement isn't a macro function that replaces 
> arbitrary strings".  I'm not trying to replace any string, I 
> just want the stored procedure to interpret exactly what I'm 
> passing it.
> 
> I can get the procedure to work from Ops Nav "run a script", 
> but can not get it work from the Java app.  I can't believe 
> something as simple as this isn't doable.
> 
> I suppose I could loop through all of the items in my 
> itemList and put them in a temp table on the iSeries and do a 
> select from somestuff where item in (select item from temp 
> table), but I would prefer not to have to do that.
> 
> There must be a way...
> 
> Kelly
> 
> --
> This is the Java Programming on and around the iSeries / 
> AS400 (JAVA400-L) mailing list To post a message email: 
> JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change 
> list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, 
> please take a moment to review the archives at 
> http://archive.midrange.com/java400-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.