Bug #13561 CommandBuilder gives multitable error with SQL functions
Submitted: 28 Sep 2005 12:01 Modified: 30 Oct 2005 6:27
Reporter: Scott Mankowitz Email Updates:
Status: No Feedback Impact on me:
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.6 OS:Microsoft Windows (WinXP)
Assigned to: Assigned Account CPU Architecture:Any

[28 Sep 2005 12:01] Scott Mankowitz
The MySqlCommandBuilder can not create an insertcommand when one of the elements in the select query is a database function. It reports an error about multitable queries.

How to repeat:

sql="SELECT *, now() AS stime FROM tblMaster WHERE InEDNow<>0"
da = New MySqlDataAdapter(sql, conn)               
Dim cb As New MySqlCommandBuilder(da, True)
da.InsertCommand = cb.GetInsertCommand()
[30 Sep 2005 6:27] Vasily Kishkin
Thanks for bug report. Could you please sey me exact error message. I've got "Unknow column 'InEdNow' in where clause". There is not about multitable
[4 Oct 2005 14:39] Reggie Burnett

I have not been able to verify it yet.  Can you post some code that shows this?
[11 Oct 2005 18:27] Ray Eddington
I have some information that may help.  Although I am working with the ODBCCommandBuilder rather than mySQLCommandBuilder.

I've discovered that for whatever reason, the ODBCCommandBuilder creates the insert statement as follows:
"INSERT INTO version( ProductID , Name ) VALUES ( 10 , 'Test' )"

Notice there is no space between 'version' and the first paren.  When I try this same line from mysql I also get an error.  Adding a space between the table name fixes the problem and the command executes fine.  

The question is this, should MySQL be able to handle this insert statement (without the space) or is the CommandBuilder not following the standard syntax?

[1 Nov 2005 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".