Invalid sql statement

Clovertech Forums Cloverleaf Invalid sql statement

  • Creator
    Topic
  • #119987
    RICK L. PRITCHETT
    Participant

      If I hard code the @access_cd variable I get the expected reply.  What is the proper syntax for the declaration of @access_cd?  On cloverleaf 6.2 .

       

      Invalid sql statement: ‘declare @access_cd int

      FROM    RF_ORDER AS ro

      INNER JOIN RF_SCHEDULED_EMMI AS rse

      ON ro.ORDER_ID = rse.ORDER_ID

      WHERE   rse.ACCESS_CD = @access_cd;’.

       

    Viewing 0 reply threads
    • Author
      Replies
      • #119988
        Scott Caldwell
        Participant

          You dont decare it.  You set your  “In” variable to a name then use that name enclosed in brackets in the SQL.

          Your case would be:

          In: access_cd

          Select my_field from […] where rse.ACCESS_CD=<access_cd>

           

           

      Viewing 0 reply threads
      • You must be logged in to reply to this topic.