2 Replies Latest reply on Jun 15, 2016 11:58 AM by Mauricio Magnani Jr

    Stored Procedure With Parameters Teiid 8.7.1

    Mauricio Magnani Jr Master

      Folks,

      I'm trying to create a stored procedure that uses a boolean as a parameter. I would like to use this parameter in an IF, something like:

       

      BEGIN
      IF (AllCustomer.getCustomersByParam.value = TRUE) THEN
          SELECT A.CUSTOMERID, A.FIRSTNAME, A.LASTNAME, A.COUNTRY FROM AllCustomer.Customers AS A;
      ELSE
        SELECT A.CUSTOMERID, A.FIRSTNAME, A.LASTNAME, A.COUNTRY FROM AllCustomer.Customers AS A  OPTION NOCACHE;
      END IF;
      END;
      

       

      What is the correct syntax for creating this Stored Procedure?

      I would like to use the option NOCACHE when the client passed the value FALSE. What better way to do this?

       

      Thanks in Advance.