HI all,
How to access the database and quries through the procedures.
The following one i tried to access , but I couldnt get the exact out put.
ShellScript:
#!/bin/bash
vsql -c "select MFR_PART_KEY from vmro.DIM_ATA limit 10;"
exit 0
Creating procedure:
dbadmin=> create procedure query(arg1 varchar) AS 'query1.sh' LANGUAGE 'external' USER 'dbadmin';
CREATE PROCEDURE
Executing procedure:
dbadmin=> select query('vmro.dimata');
query
-------
0
(1 row)
Please correct me where i went wrong .
Thanks,
Malar
How to access the database and quries through the procedures
Moderator: NorbertKrupa
-
- Newbie
- Posts: 23
- Joined: Mon Feb 04, 2013 10:54 am
Re: How to access the database and quries through the proced
Hello,
This topic can solve your doubt.
http://www.vertica-forums.com/viewtopic ... DURE#p2777
Hope this helps
This topic can solve your doubt.
http://www.vertica-forums.com/viewtopic ... DURE#p2777
Hope this helps
-
- Newbie
- Posts: 23
- Joined: Mon Feb 04, 2013 10:54 am
Re: How to access the database and quries through the proced
Thanks
This post helped to acheive my goal.
This post helped to acheive my goal.
-
- Newbie
- Posts: 21
- Joined: Tue Aug 27, 2013 10:31 am
Re: How to access the database and quries through the proced
Hi
What is the command used to view the external procedures created ?
What is the command used to view the external procedures created ?
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: How to access the database and quries through the proced
Query the V_CATALOG.USER_PROCEDURES table:
Code: Select all
dbadmin=> SELECT * FROM v_catalog.user_procedures;
procedure_name | procedure_arguments | schema_name
----------------+---------------------+-------------
(0 rows)
dbadmin=> CREATE PROCEDURE public.truncate_table(arg1 VARCHAR) AS 'truncate_table.sh' LANGUAGE 'external' USER 'dbadmin';
CREATE PROCEDURE
dbadmin=> SELECT * FROM v_catalog.user_procedures;
procedure_name | procedure_arguments | schema_name
----------------+---------------------+-------------
truncate_table | arg1 Varchar | public
(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.