Re: Using SQL for simple IWS app server
Charles Wilt <[email protected]>
| Newsgroups | gmane.comp.systems.as400.web |
|---|---|
| Message-ID | <CAJ=Tnc5t7hCwj47a==ugT+2izcP2dU8dMYO_J1QbwDMRPHW1Nw@mail.gmail.com> |
If a VARCHAR parm, you can leave out the trim. Charles On Mon, Dec 21, 2020 at 10:22 AM Charles Wilt <[email protected]> wrote: > Jon try > > SELECT * FROM ABC WHERE TYPE LIKE(trim(?) concat '%') > > Charles > > > On Mon, Dec 21, 2020 at 10:06 AM Jon Paris <[email protected]> > wrote: > >> Yep - it needs the quotes removed - but when you do that you seem to be >> left with manually encoding any wildcarding in the URL which is a pain. I >> was looking for a way to incorporate the wildcarding in the SQL that way >> the request was simpler. Currently I have to code things like >> http://ideveloper:10010/web/services/SQL/%25c%25 >> >> Better than nothing I guess. >> >> >> Jon >> >> > On Dec 20, 2020, at 8:09 PM, Vernon Hamberg <[email protected]> >> wrote: >> > >> > Hi Jon >> > >> > Would it work to use LIKE(?) - so it could generate a parameter for >> that? TYPE LIKE('?') is looking for a match for the string that is a >> question mark, seems to me early this evening! >> > >> > Cheers >> > Vern >> > >> > On 12/20/2020 5:52 PM, Jon Paris wrote: >> >> Has anyone been able to use a SELECT that includes a LIKE clause in >> the SQL when deploying SQL statements with IWS? >> >> >> >> Unless I'm missing a PTF or something it doesn't seem to work - mainly >> because it does not recognize the ? as a parameter marker when included in >> a LIKE. >> >> >> >> So SELECT * FROM ABC WHERE TYPE = ? generates a named parameter that >> can be associated with data from the URL >> >> >> >> SELECT * FROM ABC WHERE TYPE LIKE('?') does not generate a parameter >> so there is nothing to associate. >> >> >> >> The docs don't help as they don't list any limitations on what the SQL >> can and cannot do. >> >> >> >> >> >> Jon >> > >> > -- >> > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) >> mailing list >> > To post a message email: [email protected] >> > To subscribe, unsubscribe, or change list options, >> > visit: https://lists.midrange.com/mailman/listinfo/web400 >> > or email: [email protected] >> > Before posting, please take a moment to review the archives >> > at https://archive.midrange.com/web400. >> > >> >> -- >> This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing >> list >> To post a message email: [email protected] >> To subscribe, unsubscribe, or change list options, >> visit: https://lists.midrange.com/mailman/listinfo/web400 >> or email: [email protected] >> Before posting, please take a moment to review the archives >> at https://archive.midrange.com/web400. >> >> -- This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/web400 or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/web400.