5 Replies Latest reply on Nov 16, 2012 12:47 PM by Samier Nadji

    Virtual Procedure Syntax

    Samier Nadji Newbie

      Hi,

       

      Can I use virtual procedures to create virtual views? If yes, what is the syntax? I am trying to do something like the following:

       

      <model visible="true" type="VIRTUAL" name="myschema">

        <metadata type="DDL"><![CDATA[

         

          CREATE VIRTUAL PROCEDURE myproc1

          BEGIN

          CREATE LOCAL TEMPORARY TABLE temptable1 (a string, b string); 

          ... load the temp table with data from multiple sources

          ... do some stuff

          SELECT * FROM temptable1;

          END

       

       

          CREATE myview1VIEW ppp (

            a bigdecimal,

            b string

            )

            AS SELECT * FROM myproc1;

       

        </metadata>

      </model>       

       

      I tried different variations of the above, but always got errors.

       

      Thanks