[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Feeding a where statement



Opps, I didn't send the whole thing
promptmgr:
  input $mgr 'Enter Manager''s last name, enter Terhorst for all'
  let $mgr = upper($mgr)
  evaluate $mgr
   When = 'BEYER'
    let $dyna_craft = 'leadcraft in ' ||'(' ||'''578-6'''||','  ||
'''579-6'''||',' ||'''580-6'''||')'
    break
   When = 'WALTON'
    let $dyna_craft =  'leadcraft in ' ||'('||'''578-1T'''||','||
'''583-6E'''||','||
'''580-6T'''||','||'''583-1E'''||','||'''578-6T'''||','||'''578-8T'''||','||
'''583-8E'''||')'
    break
   When = 'PIAZZA'
    let $dyna_craft = 'leadcraft in '
||'('||'''578-1'''||','||'''580-1'''||','||'''579-1P'''||','||'''579-1'''||'
,'||'''580-1P'''||','||'''578-10'''||','||'''579-10'''||','||'''580-10'''||'
,'||'''579-1'''||')'
    break
   When = 'TERHORST'
    let $dyna_craft = '1=1'
   break
   When-other
    goto promptmgr
   end-evaluate

Wes Williams
Hamilton Sundstrand
815.226.6196


-----Original Message-----
From: McCown, Larry [mailto:MCCOWLA@MAIL.NORTHGRUM.COM]
Sent: Thursday, April 12, 2001 11:06 AM
To: SQR-USERS@list.iex.net
Subject: Feeding a where statement


Hello,
Not sure how to state this but here it goes.
I am attempting to build a where statement that is fed from an if statement
using the in command.
Sample:
begin-procedure
        if $site = 1  (user input as to which site)
                move ''('ES-02','PS-08','SM-01',SM-02') ''  TO $SITE
        end-if
Begin-select
        from workorder
        where [$where]
        and crewid in $site
end-select
end-procedure

I am receiving error (SQR 4114) Expecting 'to', found  move
''('ES-02','PS-08','SM-01',SM-02') ''  TO $SITE

If you were able to follow this and have any suggestions I would appreciate
it.
Thank you
SQLServer 7
VisualSQRIBE 5.0

Larry McCown
Northrop Grumman
Western Region Facilities
One Hornet Way WG00/W9
El Segundo, Ca. 90245
mccowla@mail.northgrum.com
Phone (310)628-3939
Fax      (310)331-7452