ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: Some info on comments embedded in statements
Date Tue, 01 Feb 2005 16:47:37 GMT
can you use ";" chars to seperate the statements in the second case?


On Tue, 1 Feb 2005 10:42:56 -0600, Kit Cragin
<kit.cragin@entervalent.com> wrote:
> I wanted to share some info with the group regarding comments embedded in
> statements in the XML files. I found the following does not work:
> 
> 1. SQL Server comments (e.g. "--") interleaved with SQL text. This one
> should have been obvious to me in retrospect <sigh>.
> 
> <delete id="deletesomething">
> -- Delete children
> delete from thattable where thisid = #value#
> -- Delete parent
> delete from thistable where thisid = #value#
> </delete>
> 
> The reason is that new lines are removed so you end up with this SQL
> command: "-- Delete children delete from thattable where thisid = @value --
> Delete parent delete from thistable where thisid = @value" which is
> obviously just one long comment.
> 
> 2. Interleaved XML comments:
> 
> <delete id="deletesomething">
> <!-- Delete children -->
> delete from thattable where thisid = #value#
> <!-- Delete parent -->
> delete from thistable where thisid = #value#
> </delete>
> 
> This doesn't work because newlines are removed and the statements are
> concatenated without any whitespace in between: "delete from thattable where
> thisid = @valuedelete from thistable where thisid = @value"
> 
> The first one is not an ibatis bug. The second one might be, but I am not
> sure.
> 
> - Kit
> 
>

Mime
View raw message