Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread How to export a query result from EDB Manager
Fri, Nov 10 2017 4:10 AMPermanent Link

Matthew Jones

In EDB Manager, I can export a table. But I have a query that I need to get the results of, and export as CSV. I get a nice table but no way to export the data. What is the easiest way for me to get that data out of the system into CSV?

--

Matthew Jones
Fri, Nov 10 2017 4:16 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> In EDB Manager, I can export a table. But I have a query that I need to get the results of, and export as CSV. I get a nice table but no way to export the data. What is the easiest way for me to get that data out of the system into CSV?

Just reading the SQL manual in case I missed an EXPORT option, I realise I could use the results to create a new table and export that. But I've never done that sort of SQL before, so anyone able to tell me how to make such instantly?

So taking

SELECT column1, column1 FROM TABLE_A
// inner join etc
MAGICALLY CREATE TABLE TABLE_RESULT WITH RESULT COLUMNS

Anyone know the incantation for the last line? 8-)

--

Matthew Jones
Fri, Nov 10 2017 4:43 AMPermanent Link

Matthew Jones


INSERT INTO Export
SELECT column1, column1 FROM TABLE_A
// inner join etc

That does the trick, but you have to create the export table and set all the columns as the right types. Pity there is no instant way to do this. Moving on...

--

Matthew Jones
Fri, Nov 10 2017 6:26 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Matthew


I think Views will work. Never tried it but the documentation says <<Exports the data from a table or view into a delimited text file.>>

Good job you're asking that question here <VBG>

Roy Lambert
Fri, Nov 10 2017 8:35 AMPermanent Link

Matthew Jones

Roy Lambert wrote:

> I think Views will work. Never tried it but the documentation says <<Exports the data from a table or view into a delimited text file.>>

Views eh? More to learn!


> Good job you're asking that question here <VBG>

8-)

--

Matthew Jones
Fri, Nov 10 2017 8:40 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> Views eh? More to learn!

Hmm, that was easy. Take my query, create view, paste, there it is. Hmm, export view is available. Same SQL as the table, so completely perfect, and no intermediate table needed.

Kisses all round! (ick!)

--

Matthew Jones
Fri, Nov 10 2017 2:28 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< In EDB Manager, I can export a table. But I have a query that I need to get the results of, and export as CSV. I get a nice table but no way to export the data. What is the easiest way for me to get that data out of the system into CSV? >>

As I mentioned in my reply in the enhancements forum, this is a big hole in the EDB Manager functionality right now that will be patched ASAP.

For now, you have to do this:

CREATE TEMPORARY TABLE QueryResult AS
SELECT .....

and then you can export the table.  But, another hole - the temporary tables don't show up in the treeview on the left, so you have to do the export in SQL.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Nov 14 2017 4:44 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> CREATE TEMPORARY TABLE QueryResult AS
> SELECT .....
WITH DATA

(Just to pop that last line on for next time I need to learn that bit...) Easy to find in the manual though.

--

Matthew Jones
Image