gremlin - show query execution time - gremlin

How do you show the query execution time for a gremlin query while running it a console such as Datastax Studio?
I tried
clockWithResult(100) { myquery }
But I get an error saying "cannot convert from int to Supplier"

I'm pretty sure that clockWithResult() is a function provided only by Gremlin Console and is not part of the Gremlin language itself. Other Gremlin tools (like DS Studio) don't have that specific feature that I'm aware of. If you really want to use that feature you should connect Gremlin Console to DataStax Graph and execute your query from there.
That said, clockWithResult() is just a member of TimeUtil which can be found here. You could either:
Try to modify the DS Graph sandbox whitelist to allow that class to be used and then use it through Studio OR
If that approach doesn't work for some reason, just copy/paste that function code to a Studio cell and use it directly (I'm mostly sure that would work, but haven't tried).

Related

Commands out of sync you can't run this command now QMYSQL unable to execute query

I'm using MariaDB version 10.5.9.0, the application I'm writing is using MSVC 2015 with Qt 5.9.2
Today I am seeing an error from the database when I try to execute one of my stored procedures, the procedure hasn't changed and has been working without any issues for quite a while.
The error displayed is:
Commands out of sync; you can't run this command now QMYSQL: Unable to execute query
Yet, despite this error the stored procedure works and the data is added to the database.
I've tried selecting everything in the database using HeidiSQL then using the Tools > Maintenance, Check then Analyse, the Repair and finally Optimize
Still the same issue.
Resolved, the issue was calling QSqlQuery and then another subquery using QSqlQuery again without calling clear on the first query.

Same SQL query which works in Teradata doesn't work in Fitnesse

Same SQL query which works in Teradata SQL Assistant doesn't work in Fitnesse. I get below error when we run the query
"SELECT failed. 3706: Syntax error: expected something between '(' and the 'SUBSTR' keyword
I have faced the same problem in past. I understand the problem is with copy and paste. In past it was small query so I manually typed and it worked. But now my query expands over 300 lines, so I am not able to retype it. I even tried to copy and paste in plain text via notepad and notepad ++, but still unable to resolve it. Can you throw some light please?
There are some functionalities that are managed (translated) by ODBC itself (as SQL Assistant is using ODBC, it's relevant). I had similar issued when moving dem SQL Assistant to bteq.
In my case it was LENGTH (which don't exist in Teradata, but is handled by ODBC), after changing to CHAR_LENGTH it worked. Can you post the SQL? Otherwise, go Function by Function through your Query and double-check Teradata documentation (does it exist, has is the parameters I used?).
In the connection string I changed TMODE from ANSI to TERA and it started working.

How can I use SonarQube web service API for reporting purpose

I want to create a custom report. Response format for sonarqube web service API /api/issues/search is JSON or XML. How can I use that response to create a html or CSV file using "unix shell without using command line tools" so that I can use it as a Report. Or is there any other better way to achieve this?
you can generate a html file if you run an analysis in the preview mode http://docs.sonarqube.org/pages/viewpage.action?pageId=6947686
It looks as if the SonarQube team has been working hard to not allow people to do this. They appear to want people to purchase an Enterprise Subscription in order to export reports.
An old version of sonar-runner (now called sonar-scanner) had an option to allow local report output. But that feature is "no more supported".
ERROR: The preview mode, along with the 'sonar.analysis.mode' parameter, is no more supported. You should stop using this parameter.
Looks like version 2.4 of Sonar Runner does what you want. If you can find it. Of course they only have 2.5RC1 available on the site now.
Using the following command should work on version 2.4:
sonar-runner -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
There at least two open-source projects that query the SQ API to generate reports in various formats.
https://github.com/cnescatlab/sonar-cnes-report/tree/dev (Java)
https://github.com/soprasteria/sonar-report (JavaScript/Node)
At the time of writing both are active.

How to connect Dart to SQLite?

My old application used web2py with SQLite as the database. Now I want to try porting this app to Dart and again use SQLite as the database.
I can't find any documentation on how to use it. I just found out how to use MySQL with sqljocky.
I've tried to read the web_sql and indexed_db APIs, but I can't find a way to connect to SQLite. How can I use SQLite from Dart?
As far as I can tell, dart-sqlite is the only public attempt at SQLite bindings for Dart, but it's out of date. My guess is that it would actually be pretty easy to update the code and get it up-and-running.
web_sql and indexed_db are both for use in the browser, which, as far as I can tell from your question, isn't what you're looking for.
Update: I updated dart-sqlite so that all the tests now pass, at least on my machine. You're definitely venturing into uncharted territory if you use it, but it's a start.

Simplest Way to Test ODBC on WIndows

With unixODBC you can use a simple command line utility called "isql" to test your connection and permissions of some queries. Without having to write extra code or install libs or bloated programs, is there a simple way to open up X data source send some sql commands and be done with it?
Doing this on the command line would be preferable.
One way to create a quick test query in Windows via an ODBC connection is using the DQY format.
To achieve this, create a DQY file (e.g. test.dqy) containing the magic first two lines (XLODBC and 1) as below, followed by your ODBC connection string on the third line and your query on the fourth line (all on one line), e.g.:
XLODBC
1
Driver={Microsoft ODBC for Oracle};server=DB;uid=scott;pwd=tiger;
SELECT COUNT(1) n FROM emp
Then, if you open the file by double-clicking it, it will open in Excel and populate the worksheet with the results of the query.
Make a file SOMEFILENAME.udl then double click on it and set it up as an ODBC connection object, username, pwd, target server
You can use the "Test Connection" feature after creating the ODBC connection through Control Panel > Administrative Tools > Data Sources.
To test a SQL command itself you could try:
http://www.sqledit.com/odbc/runner.html
http://www.sqledit.com/sqlrun.zip
Or (perhaps easier and more useful in the long run) you can make a test ASP.NET or PHP page in a couple minutes to run SQL statement yourself through IIS.
For ad hoc queries, the ODBC Test utility is pretty handy. Its design and interface is more oriented toward testing various parts of the ODBC API. But it works quite nicely for running queries and showing the output. It is part of the Microsoft Data Access Components.
To run a query, you can click the connect button (or use ctrl-F), choose a data source, type a query, then ctrl-E to execute it and ctrl-R to display the results (e.g., if it is a SELECT or something that returns a cursor).
a simple way is:
create a fake "*.UDL" file on desktop
(UDL files are described here:
https://msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx.
in case you can also customized it as explained there. )
It's been a while but since I precisely have the answer to the question, I'll share it and maybe someone will benefit from it.
Jaime de Los Hoyos wrote a very nice program to precisely do that: ODBC Query Tool.
Unfortunately, Jaime's website is defunct but you can still find the program and its source code at this location:
https://sourceforge.net/projects/odbc-query-tool/files/latest_release/
The program is GUI based and consists of a single executable file, no need to install anything on the machine.
Jaime's profile : https://stackoverflow.com/users/878998/jaime-de-los-hoyos-m
Jaime's posts on a forum talking about his program : https://forum.powerbasic.com/forum/user-to-user-discussions/source-code/48266-odbc-query-tool-retrieve-information-from-any-database-easily

Resources