[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



Hey Larry,
here is an example of what I have used. It defaults to non PM workorder
status (WAPPR). If it is a PM then uses WSCH in the where clause
begin-program
  prompt:
  input $wotype  'Enter worktype'
  input #days_parameter 'Enter Number of Days'

  let $wotype = upper($wotype)
  let $dyna_INPRGClause = 'w.status = ''INPRG'' and wx.status = ''WAPPR'' '
  let $dyna_CompClause = 'w.status = ''COMP'' and wx.status = ''WAPPR'' '
  evaluate $wotype
    when = 'FS'
      break
    when = 'OML'
      break
    when = 'OMS'
     break
    when = 'SW'
     break
    when = 'PM'
    let $dyna_INPRGClause = 'w.status = ''INPRG'' and wx.status = ''WSCH'' '
    let $dyna_CompClause = 'w.status = ''COMP'' and wx.status = ''WSCH'' '

     break
    when-other
     !show (3,30) ' Invalid choice, re-enter value' beep
   goto prompt


HTH
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