The standards are grand, but between DB2 UDB, SQL Server, MySQL, PostgreSQL and Oralce, their market share of almost 100% suggests that it would be wise to support the /**/ comments anyway.
From: Neville Rowe [mailto:row...@ho...]
Sent: Wednesday, December 21, 2016 9:30 AM
To: Federico Bruni
Cc: squ...@li...
Subject: Re: [Squirrel-sql-users] sqlparam plugin asks for /* */ commented variables
Hi Federico,
I think I wrote that code, but I cannot remember how I did it. Quickly checking the SQL 92 standard, — is the standard comment introducer
<comment> ::=
<comment introducer> [ <comment character>... ] <newline>
<comment character> ::=
<nonquote character>
| <quote>
<comment introducer> ::= <minus sign><minus sign>[<minus sign>...]
6) There shall be no <space> nor <newline> separating the <minus
sign>s of a <comment introducer>.
7) SQL text containing one or more instances of <comment> is equiv-
alent to the same SQL text with the <comment> replaced with
<newline>.
So I suspect we are working to spec but that isn’t the same as being compatible
with different dialects for different databases.
Neville
On 21 Dec 2016, at 14:14, Federico Bruni <fe...@in...<mailto:fe...@in...>> wrote:
Hi all
I thought that I was still affected by a bug fixed in 2014:
https://sourceforge.net/p/squirrel-sql/bugs/618/
Example:
SELECT * FROM CARS
WHERE NAME LIKE 'TOY%' /*IN (:var1, :var2, :var3) */ ;
Instead of just executing the LIKE 'TOY%' statement, I'm prompted for
the variables which are in a commented block and should be therefore
ignored.
I've looked at commit e785904a6563f90d34bc1fc570fe472259c9903a in git
and found out that if I use '--' for commenting then sqlparam won't
prompt for variables:
SELECT * FROM CARS
WHERE NAME LIKE 'TOY%'; -- IN (:var1, :var2, :var3);
I don't know what's the recommended way to do this sort of things in
SQL, but I wanted to share this with you.
Thanks
Federico
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Squirrel-sql-users mailing list
Squ...@li...<mailto:Squ...@li...>
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
|