Unable to export using cbq shell commands

I am trying to export the data from the query using cbq shell but ending up with the below result always.
I also tried with the backslash but it did not work,

./cbq -o=“results.txt” -s="select name from employee_team";

And the result is ,

“requestID”: “47b62e05-d874-41bf-9909-4ac6becf0c95”,
“errors”: [
“code”: 3000,
“msg”: “syntax error - at .”
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “861.8µs”,
“executionTime”: “763.1µs”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1

How to correct this?

Are you using 4.5.1? @isha can help with this.

Yes We use 4.5.0. Please suggest what needs to be done?

Hi @Arunachalam

Back ticks aren’t necessary for “_”. They are needed for “-”.

I tried your example and it works fine for me.

P:bin isha$ ./cbq -o="results.txt" -s="select name from employee_team";
 Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit.
P:bin isha$ cat results.txt 

 Path to history file for the shell : /Users/isha/.cbq_history 
select name from employee_team
    "requestID": "17982245-3296-468f-b7ab-5fab11f2e730",
    "signature": {
        "name": "json"
    "results": [
    "status": "success",
    "metrics": {
        "elapsedTime": "5.550934ms",
        "executionTime": "5.534735ms",
        "resultCount": 0,
        "resultSize": 0

Can you try running the query within a cbq session and see if it works ?


Seems to be a problem with accepting “./” .any other workarounds?

Are you on Windows, Mac, or UNIX?

its UNIX. and the version ins 4.5.0. It works in one machine and not in the other.

Ok, this is related to your environment. Make sure the PATH is the same on both machines.