Pass variable to stored procedure call

Clovertech Forums Cloverleaf Pass variable to stored procedure call

  • Creator
    Topic
  • #120016
    RICK L. PRITCHETT
    Participant

      I am trying to use the below-stored procedure call. I am trying to pass today’s date without hard coding it.  I have tried to pass it to the call as a variable but received a syntax error. Any suggestions?  Can you pass a variable to the call or should use the sql option instead of the stored procedure?

      {CALL usp_get_Integration_Transition_Child_Programs_V2(‘D088AD5B-F17F-4368-9B5E-6AFCDF3E7599’, ‘firstCompletionDate’, ‘2022-10-18 00:00’, ‘2022-10-18 23:59’)}

      Attachments:
      You must be logged in to view attached files.
    Viewing 0 reply threads
    • Author
      Replies
      • #120018
        Peter Heggie
        Participant

          If it is a syntax error, I’m not sure. It looks right. But I’ve never hard-coded arguments to a stored procedure called in a DBLookup.

          To invoke with variables, use the right and left arrows just as you would when passing in values from a db schema or vrl:

          {CALL prMyStoredProcedure( <@var1>, <@var2>)} ;

          If your stored procedure has OUT parameters, or if it returns values from a Select, you have to use the other form:

          {?=CALL prMyStoredProcedure( <@var1>, <@var2>, @var3 OUT , @var4 OUT )};

          Notice that OUT parameters do not need surrounding right and left arrows.

          The Out: text box in the table definition will have to indicate the type of variable, either OUT parameter or Record Set column, example:

          OUT_@var3, OUT_@var4

          or

          RS_var5

          Peter Heggie
          PeterHeggie@crouse.org

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