Empty Contents Tab in SQuirreL when Column-Names contain dashes

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

Empty Contents Tab in SQuirreL when Column-Names contain dashes

Thomas Lenarz
Hello,

we experience the problem that the contents tab in SQuirreL stays blank,
if a table contains columns whose names contain non standard characters.

For example column-name test-1. The dash is an invalid character.
For most databases this situation is solved by surrounding the
column-name by quotes as in "test-1".

By analysing the problem and looking into the log files I discovered
that SQuirreL actually
generates a SELECT-Statement without surrounding the column-name(s) by
quotes if the column-names contain invalid characters. That is why the
contents-tab does not show any data.

The problem can be reproduced easily using the following steps (in my
case with HSQL-DB):

create table test ( "test-1" char(10) )
insert into test values ('1111111111')

SELECT test-1 FROM "PUBLIC"."TEST"; --> won't work (which is correct)

SELECT "test-1" FROM "PUBLIC"."TEST" --> will work

Contents-Tab stays empty.

I consider this a bug in SQuirreL. It should double-quote columns
containing invalid characters when generating
the SELECT-Statement for the contents tab.

Your opinion about this? Is there a chance to get this changed in SQuirreL?

Thanks a lot,
Thomas

--
mailto:[hidden email]
http://twitter.com/tommesl


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Empty Contents Tab in SQuirreL when Column-Names contain dashes

Alexandre Peshansky
To quote John Hardin [[hidden email]],
[Use] SourceForge issues tracker in the Squirrel SQL project.
--
Alexandre Peshansky, MS
Senior Bioinformatics Analyst, Research Informatics Core (RIC)
Einstein-Montefiore Institute for Clinical and Translational Research (ICTR)
Albert Einstein College of Medicine
1300 Morris Park Ave, Block Bldg., Rm 534 Bronx, NY 10461
(718) 430-2440 (Mo, Th, Fr)  (718) 920-4885 (Tu) (914) 457-6792 (We)


________________________________________
From: Thomas Lenarz [[hidden email]]
Sent: Thursday, February 26, 2015 3:44 PM
To: [hidden email]; [hidden email]
Subject: [Squirrel-sql-users] Empty Contents Tab in SQuirreL when       Column-Names contain dashes

Hello,

we experience the problem that the contents tab in SQuirreL stays blank,
if a table contains columns whose names contain non standard characters.

For example column-name test-1. The dash is an invalid character.
For most databases this situation is solved by surrounding the
column-name by quotes as in "test-1".

By analysing the problem and looking into the log files I discovered
that SQuirreL actually
generates a SELECT-Statement without surrounding the column-name(s) by
quotes if the column-names contain invalid characters. That is why the
contents-tab does not show any data.

The problem can be reproduced easily using the following steps (in my
case with HSQL-DB):

create table test ( "test-1" char(10) )
insert into test values ('1111111111')

SELECT test-1 FROM "PUBLIC"."TEST"; --> won't work (which is correct)

SELECT "test-1" FROM "PUBLIC"."TEST" --> will work

Contents-Tab stays empty.

I consider this a bug in SQuirreL. It should double-quote columns
containing invalid characters when generating
the SELECT-Statement for the contents tab.

Your opinion about this? Is there a chance to get this changed in SQuirreL?

Thanks a lot,
Thomas

--
mailto:[hidden email]
http://twitter.com/tommesl


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Empty Contents Tab in SQuirreL when Column-Names contain dashes

John Hardin
In reply to this post by Thomas Lenarz
On Thu, 26 Feb 2015, Thomas Lenarz wrote:

> The problem can be reproduced easily using the following steps (in my
> case with HSQL-DB):
>
> create table test ( "test-1" char(10) )
> insert into test values ('1111111111')
>
> SELECT test-1 FROM "PUBLIC"."TEST"; --> won't work (which is correct)

By "won't work" do you mean it displays a syntax error from the database
engine?

> SELECT "test-1" FROM "PUBLIC"."TEST" --> will work
>
> Contents-Tab stays empty.

By that do you mean no syntax error, the results tab is created, but
nothing is displayed in it?

> I consider this a bug in SQuirreL. It should double-quote columns
> containing invalid characters when generating
> the SELECT-Statement for the contents tab.

Squirrel isn't generating that SQL, it's sending what you typed in.
Expecting SQuirrel to add quotes you should have added isn't (IMO)
reasonable. What if you'd typed this:

      create table test ( test int, "test-1" char(10) )
      insert into test values (0, '1111111111')
      SELECT test-1 FROM "PUBLIC"."TEST";

?

Can you trace and determine what SQL is actually being sent to the
database server?

--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   The difference is that Unix has had thirty years of technical
   types demanding basic functionality of it. And the Macintosh has
   had fifteen years of interface fascist users shaping its progress.
   Windows has the hairpin turns of the Microsoft marketing machine
   and that's all.                                    -- Red Drag Diva
-----------------------------------------------------------------------
  8 days until Dawn reaches Ceres

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users