Good afternoon,
There is a function on Oracle called sql_execute that I've used to be able to execute queries that are stored in tables. We've used this as a means of limiting the queries folks can run in the database. Is this possible in vertica? For example if I store SELECT * FROM DUAL; in a table column I'd like to be able to dynamically query the table to run that statement.
Execute queries stored as text in table
Moderator: NorbertKrupa
Execute queries stored as text in table
Last edited by Brett on Sun Oct 27, 2013 5:33 am, edited 2 times in total.
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Execute queries stored as text in table
You can do it in vsql like this:
Code: Select all
dbadmin=> select * from sql;
c
---------------------
select * from dual;
(1 row)
dbadmin=> \! /opt/vertica/bin/vsql -At -c "select * from sql" | vsql
dummy
-------
X
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Re: Execute queries stored as text in table
knicely,
Thanks for your reply. Do you think I can do what you gave as an example in a tool such as Tableau?
Thanks for your reply. Do you think I can do what you gave as an example in a tool such as Tableau?