[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Problem with SQR string concatenation ? Please help!
Thanks a million to everyone who responded. I enclosed
the variable in [] and that solved the problem..
-Ferd
--- Geetha kethireddy <kgreddy@yahoo.com> wrote:
> Hello,
>
> Within the select statement the variable needs to be
> used like this [$Variable].
>
> begin-select
> agy_wc &agywc
> agt_wc &agtwc
> agt_seq &agtseq
> .....
> .....
> from t_agents .....
> where
> agy_wc = [$agycodes] and .....
> .....
> end-select
> Hope this helps...
>
> Geetha
>
> --- Larry Roux <lroux@syr.edu> wrote:
> > Hate to ask a silly question, but it is always
> good
> > to start from the basics - are you spelling the
> > variable ($agycodes) the same in the select clause
> > as outside it?
> >
> > Try this: Make the variable the full clause - ie
> > add "AND agy_wc IN " to the front of the $agycodes
> > variable so it reads
> > and agy_wc IN ('A6','A7','M4')
> >
> > Last thing I can suggest...are you running the SQR
> > under the same id as the SQL test you are doing?
> do
> > the 2 have different access? are you hitting 2
> > different schemas? If the code is correct then
> > there must be something else wrong...
> >
> >
> > ******************************
> > Larry Roux
> > Syracuse University
> > lroux@syr.edu
> > *******************************
> > >>> ezfred0131@yahoo.com 01/29/03 23:57 PM >>>
> > Hi,The problem is that the concatenated string
> > appears
> > fine (I've checked it thru debug commands) outside
> > the
> > select (begin-select....end-select) statement.
> > However, inside the select statement, it fails to
> be
> > recognized. Any reasons ? Please help!
> >
> > Thanks!
> > Ferd.
> >
> > --- Ferdinand de Lesseps <ezfred0131@yahoo.com>
> > wrote:
> > > Hi,,
> > > I had "in" in my original code, I put "=" by
> > > mistake
> > > in this example..
> > >
> > > Thanks for your response.
> > >
> > > -Ferd
> > > --- Larry Roux <lroux@syr.edu> wrote:
> > > > You don't want = you want "in"
> > > >
> > > > where
> > > > agy_wc in $agycodes and ....
> > > >
> > > >
> > > > ******************************
> > > > Larry Roux
> > > > Syracuse University
> > > > lroux@syr.edu
> > > > *******************************
> > > > >>> ezfred0131@yahoo.com 01/29/03 19:42 PM >>>
> > > > I formed a string concatenating few of the
> > command
> > > > line arguments. I checked for the
> wellformedness
> > > of
> > > > the resultant string, it was exactly what I
> > > wanted..
> > > >
> > > > I went into a procedure, there I concatenated
> > the
> > > > string with parenthesis; it looked good. But,
> > when
> > > I
> > > > try using this string inside sql select
> > statement
> > > > (begin-select...end-select), it won't be
> > > > recognized..don't know why..
> > > >
> > > > Code fragments:
> > > > >>>string<<<
> > > > $agycodes = 'A6'||','||'A7'||','||'M4' =>
> > > > 'A6','A7','M4'
> > > > >>>inside procedure<<<
> > > > let $agycodes = '('||$agycodes||')'
> > > > #debug show $agycodes.....would give me
> > > > ('A6','A7','M4') which is what I want.
> > > >
> > > > >>>inside select statement<<<
> > > > begin-select
> > > > agy_wc &agywc
> > > > agt_wc &agtwc
> > > > agt_seq &agtseq
> > > > .....
> > > > .....
> > > > from t_agents .....
> > > > where
> > > > agy_wc = $agycodes and .....
> > > > .....
> > > > end-select
> > > >
> > > > Works when I hard-code ('A6','A7','M4') in
> place
> > > of
> > > > $agycodes, but won't work otherwise. It won't
> > give
> > > > me
> > > > any error or exception, however the sqr will
> > > > terminate
> > > > immediately, which makes it even more
> difficult
> > to
> > > > debug..Any idea what's happening ? Is it
> > something
> > > > to
> > > > do with parens, commas ? Would really
> appreciate
> > > any
> > > > help..
> > > >
> > > > Thanks in advance..
> > > >
> > > >
> > __________________________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Mail Plus - Powerful. Affordable. Sign
> up
> > > > now.
> > > > http://mailplus.yahoo.com
> > > >
> > > >
> _______________________________________________
> > > > sqr-users mailing list
> > > > sqr-users@sqrug.org
> > > >
> http://www.sqrug.org/mailman/listinfo/sqr-users
> > > >
> > > >
> > > >
> _______________________________________________
> > > > sqr-users mailing list
> > > > sqr-users@sqrug.org
> > > >
> http://www.sqrug.org/mailman/listinfo/sqr-users
> > >
> > >
> > >
> __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > > now.
> > > http://mailplus.yahoo.com
> > >
> > > _______________________________________________
> > > sqr-users mailing list
> > > sqr-users@sqrug.org
> > > http://www.sqrug.org/mailman/listinfo/sqr-users
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > http://mailplus.yahoo.com
> >
> > _______________________________________________
> > sqr-users mailing list
> > sqr-users@sqrug.org
> > http://www.sqrug.org/mailman/listinfo/sqr-users
> >
> >
> > _______________________________________________
> > sqr-users mailing list
> > sqr-users@sqrug.org
> > http://www.sqrug.org/mailman/listinfo/sqr-users
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
>
=== message truncated ===
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users