Hi Gerd,
Thanks for your advice.
It seemed this can prevent the typo error to happen again.
Regards,
Paulus
----- Original Message -----
From: Gerd Wagner <ger...@t-...>
To: Paulus Gunawan <pau...@ya...>
Cc: "squ...@li..." <squ...@li...>
Sent: Friday, January 13, 2012 1:38 AM
Subject: Re: [Squirrel-sql-users] A wrong SQL Update statement and Squirrel detect it, but still the first part of SQL statement is being executed
On 12.01.2012 15:02, Paulus Gunawan wrote:
> Hello,
> Sorry to disturb.
> I'm currently using SquirreL SQL Client v3.1.2. This is a great SQL tools.
> Recently I got a very bad accident because I wrongly wrote the SQL
> statement as follows:
> UPDATE TABLE_A WHERE STATUS = 'X' ; AND KEY='Y';
> I found that SquirreL detect the error (there is an ':' in the mid of
> statement there), however I found that SquirreL actually is executing
> this part:
> UPDATE TABLE_A WHERE STATUS = 'X';
> This incident had given me a lot of problems.
> My question is whether this kind of problem had been resolved in later
> Squirrel release?
I'm really sorry you this happened to you.
Please go to menu File --> New Session Properties --> Tab SQL and see if the statement separator is set to ";". This will probably be the reason for your troubles:
SQuirreL interpreted "UPDATE TABLE_A WHERE STATUS = 'X' ; AND KEY='Y'" as two statements. The first "UPDATE TABLE_A WHERE STATUS = 'X'" was executed correctly and the second "AND KEY='Y'" was erroneous.
To prevent this problem you may change the separator to a different character or string.
Hope this helps
Gerd |