Quantcast

sqlparam plugin asks for /* */ commented variables

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

sqlparam plugin asks for /* */ commented variables

Federico Bruni-2
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sqlparam plugin asks for /* */ commented variables

Neville Rowe
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 <[hidden email]> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sqlparam plugin asks for /* */ commented variables

Alex Malmyguine-2

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:[hidden email]]
Sent: Wednesday, December 21, 2016 9:30 AM
To: Federico Bruni
Cc: [hidden email]
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 <[hidden email]> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users

 


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sqlparam plugin asks for /* */ commented variables

Gerd Wagner-3
In reply to this post by Federico Bruni-2
Federico,

this bug is fixed. The fix is available here:

https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20161222_0014

Please give it a try.

Thanks
Gerd

Am 21.12.2016 um 15:14 schrieb Federico Bruni:

> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
>

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sqlparam plugin asks for /* */ commented variables

Federico Bruni-2
Yes, it works as expected now.
Thanks for the quick fix!

Il giorno gio 22 dic 2016 alle 0:32, Gerd Wagner
<[hidden email]> ha scritto:

> Federico,
>
> this bug is fixed. The fix is available here:
>
> https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20161222_0014
>
> Please give it a try.
>
> Thanks
> Gerd
>
> Am 21.12.2016 um 15:14 schrieb Federico Bruni:
>> 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
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
>>


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Loading...