Subject | UPDATE Bug ? |
---|---|
Author | Thomas Kellerer |
Post date | 2006-01-04T22:14:30Z |
Hello,
according to various SQL documentations the following update should
swap the contents of the two columns foo and bar (and it does work
with Postgres, Oracle, HSQLDB, SQL Server and SQL Anywhere).
Unfortunately it does not work with Firebird (neither 1.5, nor 2.0 alpha)
CREATE TABLE foobar
(
foo integer not null,
bar integer not null
);
INSERT INTO foobar(foo, bar) VALUES (1,2);
UPDATE foobar SET foo = bar, bar = foo;
COMMIT;
SELECT foo,bar FROM foobar
returns: 2,2 but should return 2,1
Thomas
according to various SQL documentations the following update should
swap the contents of the two columns foo and bar (and it does work
with Postgres, Oracle, HSQLDB, SQL Server and SQL Anywhere).
Unfortunately it does not work with Firebird (neither 1.5, nor 2.0 alpha)
CREATE TABLE foobar
(
foo integer not null,
bar integer not null
);
INSERT INTO foobar(foo, bar) VALUES (1,2);
UPDATE foobar SET foo = bar, bar = foo;
COMMIT;
SELECT foo,bar FROM foobar
returns: 2,2 but should return 2,1
Thomas