freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Strumyla, Marius" <MStrumyla AT Accordant.net>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Multiple update statements
- Date: Tue, 13 Oct 2009 11:36:25 -0400
I had a brain fart obviously. The records are inserted earlier in the
code.
The only thing that's weird is that the query works as is. No separation
of UPDATE statements. I can live with that.
Thanks
-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Frediano Ziglio
Sent: Tuesday, October 13, 2009 4:19 AM
To: FreeTDS Development Group
Subject: Re: [freetds] Multiple update statements
2009/10/9 Strumyla, Marius <MStrumyla AT accordant.net>:
> I'm maintaining someone else's code. Application is written in PHP
> with MS SQL database. Driver installed is FreeTDS 0.64. Platform
> Solaris 10 x86.
>
> I came across this query:
> mssql_query("UPDATE user_project SET membership=43 WHERE project=49
> AND usernum=2UPDATE user_project SET membership=0 WHERE project=49 AND
> usernum=9UPDATE user_project SET membership=0 WHERE project=49 AND
> usernum=10UPDATE user_project SET membership=0 WHERE project=49 AND
> usernum=12UPDATE user_project SET membership=0 WHERE project=49 AND
> usernum=14UPDATE user_project SET membership=0 WHERE project=49 AND
> usernum=15UPDATE user_project SET membership=0 WHERE project=49 AND
> usernum=16")
>
> What is interesting is that records that don't exist are inserted :)
> If I had an empty user_project table, after the execution of the above
> query I would have 7 new records in user_project.
>
> I would like to know whether this is expected and documented
somewhere.
>
> Thanks
Updates should not insert any values. Probably you have a trigger that
insert rows when update happens.
freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
-
[freetds] Multiple update statements,
Strumyla, Marius, 10/09/2009
- Re: [freetds] Multiple update statements, Robert Gonzalez, 10/09/2009
-
Re: [freetds] Multiple update statements,
Frediano Ziglio, 10/13/2009
-
Re: [freetds] Multiple update statements,
Strumyla, Marius, 10/13/2009
-
Re: [freetds] Multiple update statements,
Frediano Ziglio, 10/13/2009
-
Re: [freetds] Multiple update statements,
Strumyla, Marius, 10/13/2009
-
Re: [freetds] Multiple update statements,
Frediano Ziglio, 10/14/2009
- Re: [freetds] Multiple update statements, Robert Gonzalez, 10/16/2009
-
Re: [freetds] Multiple update statements,
Frediano Ziglio, 10/14/2009
-
Re: [freetds] Multiple update statements,
Strumyla, Marius, 10/13/2009
-
Re: [freetds] Multiple update statements,
Frediano Ziglio, 10/13/2009
-
Re: [freetds] Multiple update statements,
Strumyla, Marius, 10/13/2009
Archive powered by MHonArc 2.6.24.