SqlDbx Forum

SqlDbx

You are not logged in.

#1 2011-07-12 04:29:30

moro
Member

Send results directly to a file output

Hi,

I am a SQLDBXPro users and I can not find a way to send the results of a sql request directly to a file output.
CSV, Excel, TXT what ever.

That could be really usefull for extract of large amount of data.

Is their any way to perfom such operation ?

Thx,

Antoine

Offline

#2 2011-07-12 08:05:38

sqldbxhelp
Administrator

Re: Send results directly to a file output

I am not sure what you mean by directly to a file.
You can right click in result grid and select "Export to" option.
If you are looking for automatic export to a file without displaying results than this will be implemented in a one of the next releases.
Also currently you can do following to export results to excel automatically:
  select * from table_name
  go
  cmd export = excel

Offline

#3 2011-07-12 10:08:42

moro
Member

Re: Send results directly to a file output

Yes I am trying to export to a file without displaying the results. Very usefull when working on large amount of data.

Thx for the cmd export = excel

Offline

#4 2011-07-25 11:05:08

qx5
Member

Re: Send results directly to a file output

Can someone provide an example of how to use the cmd statements?

Do I place them after my SQL statement?

I am getting:

SQL command not properly ended.

For simplicity lets jsut say my SQL is:

SELECT *
FROM Table1

Where would i stick:
"GO
CMD EXPORT = Excel" ?

Offline

#5 2011-07-25 11:25:26

sqldbxhelp
Administrator

Re: Send results directly to a file output

The below should work for Sybase and MS SqlServer

SELECT * FROM table
go
cmd EXPORT = Excel

Please not that currently you have to select all three lines above and then execute.

Offline

#6 2011-07-25 13:27:09

qx5
Member

Re: Send results directly to a file output

thanks is there a way to do this for Oracle?

Offline

#7 2011-07-25 13:31:29

sqldbxhelp
Administrator

Re: Send results directly to a file output

Sure. Replace go with ;

Offline

#8 2011-07-25 13:39:24

qx5
Member

Re: Send results directly to a file output

The SQL now runs but i get "ORA-00900: invalid SQL statement" on cmd EXPORT = Excel

I am using 3.46 Pro, could I possibly be using an old version that doesnt support this?

Offline

#9 2011-07-25 14:24:10

sqldbxhelp
Administrator

Re: Send results directly to a file output

That is the problem. You need at least 3.47 for this to work

Offline

#10 2011-08-04 10:20:46

moro
Member

Re: Send results directly to a file output

But is their a way to achieve the same without displaying the results in the result tab ?

Offline

#11 2011-08-04 16:25:00

sqldbxhelp
Administrator

Re: Send results directly to a file output

Not in a current version. There will be changes to this feature in one of the next releases
and it will be possible to export results without displaying them first.

Offline

#12 2011-08-09 10:09:59

moro
Member

Re: Send results directly to a file output

great thx

Offline

#13 2011-12-09 10:31:54

moro
Member

Re: Send results directly to a file output

Do you know when it will be delivered ?

Offline

#14 2011-12-09 12:54:56

sqldbxhelp
Administrator

Re: Send results directly to a file output

Offline

#15 2012-01-10 12:56:31

moro
Member

Re: Send results directly to a file output

Good to know but I might be missing something.
How should it be used ?

When I run the following:

cmd export = "C:TEMPCache    est.csv"
select top 100 * from client

Nothing happens.

What am I doing wrong ?

Offline

#16 2012-01-10 20:30:27

sqldbxhelp
Administrator

Re: Send results directly to a file output

This is how it should be done:

cmd export = file C:TEMPCache    est.csv
select top 100 * from client

Please note that both lines have to be executed as one batch

Offline

#17 2012-01-11 03:28:27

moro
Member

Re: Send results directly to a file output

It works thanks !

I was wondering, could it be possible to link the cmd to a shortcut (like F6 or anything) that would automatically export the data to a predefined folder using a standard file name and time stamp ?

That would easier to use and would be I think a great improvement.

Offline

#18 2012-01-25 09:04:29

moro
Member

Re: Send results directly to a file output

Any news about this ?

That would be really use full on a daily basis.

Offline

#19 2012-01-25 20:28:43

sqldbxhelp
Administrator

Re: Send results directly to a file output

I am not sure I understand what you mean by linking cmd to shortcut

Offline

#20 2012-01-26 06:29:13

moro
Member

Re: Send results directly to a file output

Well running the cmd command is a little bit painfull.

What would be perfect for example is to be able to select a query and instead of running ctrl + e to execute it use ctrl + k for example and directly run the request into a file.

Is it more clear ?

Offline

#21 2012-01-30 09:17:59

moro
Member

Re: Send results directly to a file output

So is it more clear ?

Offline

#22 2012-01-31 00:44:41

sqldbxhelp
Administrator

Re: Send results directly to a file output

Yes it is, but I am not sure why would you need another shortcut for this.

Offline

#23 2012-01-31 03:54:28

moro
Member

Re: Send results directly to a file output

is there already a shortcut ?

I only know the use of a command (ie: cmd export = file C:TEMPCache    est.csv) before the script execution to have the output directly sent to a file and this is quite painful.

Offline

#24 2012-01-31 20:46:29

sqldbxhelp
Administrator

Re: Send results directly to a file output

I am not sure what is not right with the way it currently works. Why adding a shortcut makes it easier. Should results go to Excel of File?
If to a file what should be the file name? What if you want results of multiple queries saved to a file? I do not see any easy way to configure something like this.

Offline

Board footer

Powered by FluxBB