Hi Alejandro,
Thanks for researching all this. I have committed your first solution. I a somewhat hesitant to commit changes to StandardRDBMSAdapter. Perhaps there was a reason for not specifying database names before the FROM keyword. Unless someone more authoritive on these matters than me picks this up, I think it is safer to leave it as it is for now.
-- Unico
Alejandro Gu�zar wrote:
Unico,
In trying to determine whether the modified delete statements are "standard"
SQL, I looked at the documentation for several DBMSs:
- MySQL [http://dev.mysql.com/doc/mysql/en/DELETE.html]
- Sybase
[http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@ebt-link;pt=
2919?target=%25N%15_24890_START_RESTART_N%25] - SQL Server
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts
_de-dz_9lut.asp].
The documentation for MySQL says the following: "In MySQL 4.0, you should
refer to the table names to be deleted with the true table name. In MySQL
4.1, you must use the alias (if one was given) when referring to a table
name.
In MySQL 4.0: DELETE test FROM test AS t1, test2 WHERE ...
In MySQL 4.1: DELETE t1 FROM test AS t1, test2 WHERE ..."
Other providers agree on this syntax: "DELETE table_name FROM table_name [, table_name]* WHERE..."
But they don't specify whether table aliases are allowed before the FROM
keyword. So, I guess the most general form for these statements wouldn't use
table aliases at all:
"delete BINDING from BINDING, URI where BINDING.URI_ID = URI.URI_ID and URI.URI_STRING = ?"
I'm attaching an updated adapter using this notation. It'd be great if you reflected these updates in the standard adapter.
-Alejandro
-----Original Message-----
From: Unico Hommes [mailto:[EMAIL PROTECTED] Sent: Domingo 11 de Julio de 2004 1:14 a
To: Slide Users Mailing List
Subject: Re: JDBCStore with MySQL problem
Hi Alejandro,
This is great. Would you be willing to donate the code to the Slide project? Btw. do you know if this notation is non-standard SQL or do all databases understand those modified delete statements? In the latter case, I better change the standard adapter class.
--
Unico
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
