-
Hi Team, Please suggest if it is possible to run hammerDB with user defined queries/driver scripts and on user data (rather than tpcc database created by hammerdb), if yes, then please can you provide the steps? Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Yes of course - HammerDB is entirely scripted and in the GUI the file and load dialog can allow you to load your own script and run it against your own data - in the command line it is the customscript command - There is an example here of converting an Oracle trace file into a bespoke script and running it against your own data: https://www.hammerdb.com/docs/ch14.html. Even if not using Oracle it can serve as a guide on how to do this. |
Beta Was this translation helpful? Give feedback.
-
Hi Steve, Thanks for reverting, however I didn't find any oracle equivalent trace file or alternative for postgres that can be used with HammerDB. Also, I am not acquainted with TCL or python hence can't use those either to write custom script. I tried modifying the oracle driver script but wasn't able to do so as it contains everything related to oracle viz. oralogon, oraopen, orasql, etc, I dont know the equivalent keywords and syntax for postgres. Hence, I am asking if it would it be possible for you to provide an example cuctom script for postgres such as a simple 'select (*) from table_name' (queried from user created db - not created by HammerDB automatically). If I can get such a script then I will be able to edit it and use it as per my config. |
Beta Was this translation helpful? Give feedback.
-
Yes, if you look at the PostgreSQL build and driver scripts, this will show you how to interact with PostgreSQL. Nevertheless the following is an basic example that you can use as a framework. Note that by default the language used is TCL. Firstly I set the path and create a user and database for testing.
The following script is an example to connect to Postgres, create a table, insert data into it and then select the data.
When this is run in hammerdbcli the output is as follows:
|
Beta Was this translation helpful? Give feedback.
-
As per follow up message putting the insert statements in a loop of 10000 iterations inserting 3 lines per insert does insert 30000 rows as would be expected and not 60000 - perhaps the test was ran twice? query after test and test script shown below.
|
Beta Was this translation helpful? Give feedback.
-
Closed as no further update - assume that no further issues identified. |
Beta Was this translation helpful? Give feedback.
As per follow up message putting the insert statements in a loop of 10000 iterations inserting 3 lines per insert does insert 30000 rows as would be expected and not 60000 - perhaps the test was ran twice? query after test and test script shown below.