Like Teradata Macro do we have any objects in Vertica?

To exucte group of SQL Statements ( with parameter values)  we can create Macro in Teradata. In the similar way do we have any objects in Vertica?


  • Options
    Navin_CNavin_C Vertica Customer

    Hi Wahab,


    You can certainly create a vsql / sql file and put all your statements into it and run he file all together.

    the only thing to take care is, the SQL statements should be seperated by a semicolon ';'


    Regarding parameters, Vertica is less flexible in this area, but the kind of requirement you have, it is possible.

    You can declare variable and use the varaible in place of paramters, then while executing the script, you need to pass the variables with values and use these variables inside the script / sql to get replaced.


    Hope this helps.


  • Options



    It depends on your client, too. Our drivers (JDBC, ODBC, etc) has support for prepared statements. See the API documentation for details. `vsql` has the "\set name value" syntax to store a value and the :name syntax to retrieve it.



Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file