3 Replies Latest reply on Mar 11, 2013 1:59 PM by rareddy

    Virtual procedure with Function=true

    virtualdatabase

      I've created a virtual procedure with one input and one ouput... I've set the property Function=true

      I've deployed the vdb

      I can exec the function without incidient but when I include the call to the function within a query I get the folowing error

       

       

      Error: Error Code:ERR.015.008.0039 Message:Remote org.teiid.api.exception.query.QueryResolverException: Error Code:ERR.015.008.0039 Message:The function 'getLanguage('2819')' is an unknown form.  Check that the function name and number of arguments is correct.

      SQLState:  ERR.015.008.0039

      ErrorCode: 0

       

       

      What am I missing??

       

       

      This is a 5.3.1 server

        • 1. Re: Virtual procedure with Function=true
          rareddy

          You can fully qualify the function using "model-name.func-name".

           

          Ramesh..

          • 2. Re: Virtual procedure with Function=true
            shawkins

            isFunction is effectively ignored for calling virtual procedures in 5.3.1.  For later versions of Teiid/Teiid Designer setting isFunction to true will mean that the virtual procedure is supposed to functionally equivalent to a UDF definition (you then won't be able to define the function with Teiid procedure sql).  So there is no current or future provision for calling Teiid virtual procedure logic as if it were a function.

             

            The workaround is to just use a scalar subquery.

             

            Steve

            1 of 1 people found this helpful
            • 3. Re: Virtual procedure with Function=true
              rareddy

              In that case use Function model to define your Function rather than using the Virtual Model's procedure as Function. You need to provide the function implementation in a java class. Check the documentation on User Defined Functions. Note in Teiid 8.x series Function Model is deprecated, and what you doing will work in Teiid 8.2.

               

              Ramesh..