You can translate the question and the replies:

Shell Scripting

Can you please provide a shell script through which I can connect to a particular Database in Denodo using "Driverclassname", "URL" , USERID , PASSWORD or other details of a JDBC connection. Please let me know incase of any other information needed.
user
13-11-2018 02:24:39 -0500

6 Answers

Hello! The Denodo Platform comes with a integrated query execution environment called VQL Shell, which is a module on Virtual DataPort, but Denodo does not provide a command line Client interface (like Sqlplus of oracle or mssql-cli for SQL Server). If the certain VQL needs to be executed out of VQL Shell, I would download generic JDBC CLI Testers (like SQLLine or jisql) which comes with a java type invocation to connect to a database through JDBC connection. Denodo provides a JDBC driver which can be used by any client to secure connection to Denodo and execute VQL queries. You can refer the [Using the VQL Shell](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/installation_and_execution/launching_the_virtual_dataport_administration_tool/using_the_vql_shell ) of the Virtual Data Port Administration Guide and [Access Through JDBC](https://community.denodo.com/docs/html/browse/7.0/vdp/developer/access_through_jdbc/access_through_jdbc) of Virtual DataPort Developer Guide for more details. Hope this helps!
Denodo Team
13-11-2018 07:55:11 -0500
Yes. Correct. I need to execute a VQL out of VQL shell and hence I need to connect to a database and driver. Need to connect to a view in a particular database and fetch the data into .CSV. Please provide a sample script which can help me in getting this achieved.
user
14-11-2018 01:14:01 -0500
Hello, Denodo Scheduler would help achieve your goal, you can set up a job with job type VDB and provide the VQL Query that needs to be executed. On exporter section, setup a CSV exporter which will export the results of the Query to a path specified on the Exporter section of the Job. Please refer the [Configuring New Jobs](https://community.denodo.com/docs/html/browse/7.0/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/configuring_new_jobs ) of the Scheduler Administration Guide. Once this setup is done, you can launch this Denodo Scheduler Jobs through Scheduler Client API. You can find the sample scripts and instructions on the <Denodo_home>/samples/scheduler/scheduler-api and you can refer the [Scheduler Client API](https://community.denodo.com/docs/html/browse/7.0/scheduler/administration/developer_api/scheduler_client_api/scheduler_client_api ) Note: The extracted file will be available on the Server where the Virtual DataPort is installed. Hope this helps.
Denodo Team
21-11-2018 07:24:48 -0500
Thanks team for your response. I understand that we can export the data using Denodo scheduler by setting up VDB job. However, my task is to execute a VQL and export the result with out using a Denodo scheduler tool. For eg : I have a view in a LOCATION database in DENODO.Now , I would like to connect to that database in Denodo and then need to export the result of below VQL into a .txt file. VQL :- select * from dv_View1 Can you please let me know if this can be acheived using any scripting or is there any other way to acheive it without using Denodo scheduler.
user
21-11-2018 07:34:27 -0500
Hello, Denodo installation comes with the stub client which can be compiled and used for connecting to Denodo through JDBC. The stub is available on <DENODO_HOME>/samples/vdp/vdp-clients, Under /src the stub Java Program which implements a rudimentary JDBC Client which can be used as CLI. I used the batch script compile_jdbcclient.bat under <DENODO_HOME>/samples/vdp/vdp-clients/scripts to compile the java stub, I used the predefined test JDBC client and did not implement further capabilities. The samples folder also has the test_jdbcclient.bat which i used to test the client that was compliled,, the call format is like below. Test_jdbcclient.bat <JDBC URI( jdbc:vdb:<host>:<port>/<database>)> <user id> <password> “<query to be executed>”. Hope this helps!
Denodo Team
30-11-2018 05:32:34 -0500
Thanks for the responses here. I too need a way to automate some SQL queries for some testing pipelines. I will give this a shot. Also would like to +1 any Feature Request for being able to use a VQL command line from any terminal so its easier to shell script denodo set ups in the future
user
09-12-2020 17:28:18 -0500
You must sign in to add an answer. If you do not have an account, you can register here