Export Resultset

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Export Resultset

Stefan Grewe-3
Hi

using Squirrel 3.5.3 I connect to a MS-SQL 2008R2 DB.
I´ve got a select Script using Variables.
Unfortunately I cannot export the resultset directly to file.

A minimal example Script looks like this:
declare @A varchar(4);           
set @A = 2014;
select
*
from Table
I expect some 10,000 rows so I want to directly export results but Squirrel tells me:
    The selected SQL is not a SELECT statement.
I can see the export window but exporting results throws a NullPointerException.

Any hints on how to export a script like this or is this a bug?

Cheers Stefan

2014-09-26 11:30:29,068 [Thread-2] ERROR net.sourceforge.squirrel_sql.client.session.MessagePanel  - privateShowMessage: Exception was null
java.lang.reflect.InvocationTargetException
    at java.awt.EventQueue.invokeAndWait(Unknown Source)
    at java.awt.EventQueue.invokeAndWait(Unknown Source)
    at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand.createProgressAbortDialog(CreateFileOfCurrentSQLCommand.java:229)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand$2.create(CreateFileOfCurrentSQLCommand.java:124)
    at net.sourceforge.squirrel_sql.fw.gui.action.ResultSetExportCommand.createProgressController(ResultSetExportCommand.java:143)
    at net.sourceforge.squirrel_sql.fw.gui.action.AbstractExportCommand.execute(AbstractExportCommand.java:257)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand.doCreateFileOfCurrentSQL(CreateFileOfCurrentSQLCommand.java:136)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand.access$000(CreateFileOfCurrentSQLCommand.java:58)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand$1.run(CreateFileOfCurrentSQLCommand.java:93)
    at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at net.sourceforge.squirrel_sql.client.util.codereformat.CodeReformatorKernel.getStatesOfPosition(CodeReformatorKernel.java:188)
    at net.sourceforge.squirrel_sql.client.util.codereformat.CodeReformator.flatenWhiteSpaces(CodeReformator.java:597)
    at net.sourceforge.squirrel_sql.client.util.codereformat.CodeReformator.reformat(CodeReformator.java:56)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand$4.run(CreateFileOfCurrentSQLCommand.java:240)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at net.sourceforge.squirrel_sql.client.Main$1.dispatchEvent(Main.java:99)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|

Re: Export Resultset

Alex Malmyguine

I am getting the same in 3.5.0:

 

The selected SQL is not a SELECT statement.

java.lang.reflect.InvocationTargetException

Could not create the Progress Monitor.

 

Removing the variable declaration fixes the error.

 

10k result rows is not too much, so the workaround would be to output to the grid and export from there. That seems to work for me.

 

Thank you

Alex

 

From: Stefan Grewe [mailto:[hidden email]]
Sent: Friday, September 26, 2014 5:32 AM
To: [hidden email]
Subject: [Squirrel-sql-users] Export Resultset

 

Hi

using Squirrel 3.5.3 I connect to a MS-SQL 2008R2 DB.
I´ve got a select Script using Variables.
Unfortunately I cannot export the resultset directly to file.

A minimal example Script looks like this:

declare @A varchar(4);           
set @A = 2014;
select
*
from Table

I expect some 10,000 rows so I want to directly export results but Squirrel tells me:
    The selected SQL is not a SELECT statement.
I can see the export window but exporting results throws a NullPointerException.

Any hints on how to export a script like this or is this a bug?

Cheers Stefan

2014-09-26 11:30:29,068 [Thread-2] ERROR net.sourceforge.squirrel_sql.client.session.MessagePanel  - privateShowMessage: Exception was null
java.lang.reflect.InvocationTargetException
    at java.awt.EventQueue.invokeAndWait(Unknown Source)
    at java.awt.EventQueue.invokeAndWait(Unknown Source)
    at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand.createProgressAbortDialog(CreateFileOfCurrentSQLCommand.java:229)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand$2.create(CreateFileOfCurrentSQLCommand.java:124)
    at net.sourceforge.squirrel_sql.fw.gui.action.ResultSetExportCommand.createProgressController(ResultSetExportCommand.java:143)
    at net.sourceforge.squirrel_sql.fw.gui.action.AbstractExportCommand.execute(AbstractExportCommand.java:257)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand.doCreateFileOfCurrentSQL(CreateFileOfCurrentSQLCommand.java:136)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand.access$000(CreateFileOfCurrentSQLCommand.java:58)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand$1.run(CreateFileOfCurrentSQLCommand.java:93)
    at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at net.sourceforge.squirrel_sql.client.util.codereformat.CodeReformatorKernel.getStatesOfPosition(CodeReformatorKernel.java:188)
    at net.sourceforge.squirrel_sql.client.util.codereformat.CodeReformator.flatenWhiteSpaces(CodeReformator.java:597)
    at net.sourceforge.squirrel_sql.client.util.codereformat.CodeReformator.reformat(CodeReformator.java:56)
    at net.sourceforge.squirrel_sql.plugins.sqlscript.table_script.CreateFileOfCurrentSQLCommand$4.run(CreateFileOfCurrentSQLCommand.java:240)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at net.sourceforge.squirrel_sql.client.Main$1.dispatchEvent(Main.java:99)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|

Re: Export Resultset

Stefan Grewe-3
Hi Alex,

thanks for your reply.
The workaround is working for me.
But I think I'll fill a bugreport because I'm expecting some results with 100.000 rows on other Databases.

Stefan
--
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users