Hi,
I've a big problem with setting user variables in MySQL.
Always when I try to use the syntax with ":", e.g. "SET @A := 1",
I get a strange error message (Exception EDatabaseError):
"Fehlender Wert fuer Parameter '='" --> "Missing value for parameter '='".
Example in Delphi:
SQLQLocalOnly.SQL.Add('SET @counter := 0; ');
SQLQLocalOnly.SQL.Add(
'UPDATE tbl1, ' +
'( ' +
'SELECT ' +
'(@counter := @counter+1) AS nummerierung, ... ' +
'FROM tbl3 ' +
'WHERE (...) ' +
'ORDER BY ... DESC ' +
') AS tbl2 ' +
'SET tbl1.platzierung = tbl2.nummerierung ' +
'WHERE (...) ';
SQLQLocalOnly.ExecSQL;
This example is working with phpMyAdmin properly, so Database and Statement should be OK.
All other MySQL-Statements are working properly with the corelab driver so far, so Installation should be OK.
In the first line I can use 'SET @counter = 0; ' instead of 'SET @counter := 0; ' which is working, but this syntax isn't allowed in the SELECT statement.
EDIT: I use dbexpmda.dll version 3.0 in TSQLConnection (Delphi 7.0)
Please give me any advices to solve this issue.
Best Regards
Ingolf
user variables with ":="
user variables with ":="
Last edited by Odelaine on Wed 30 Aug 2006 08:44, edited 1 time in total.
Re: user variables with ":="
Odelaine wrote:Hi,
I've a big problem with setting user variables in MySQL.
Always when I try to use the syntax with ":", e.g. "SET @A := 1",
I get a strange error message (Exception EDatabaseError):
"Fehlender Wert fuer Parameter '='" --> "Missing value for parameter '='".
Example in Delphi:
SQLQLocalOnly.SQL.Add('SET @counter := 0; ');
SQLQLocalOnly.SQL.Add(
'UPDATE tbl1, ' +
'( ' +
'SELECT ' +
'(@counter := @counter+1) AS nummerierung, ... ' +
'FROM tbl3 ' +
'WHERE (...) ' +
'ORDER BY ... DESC ' +
') AS tbl2 ' +
'SET tbl1.platzierung = tbl2.nummerierung ' +
'WHERE (...) ';
SQLQLocalOnly.ExecSQL;
This example is working with phpMyAdmin properly, so Database and Statement should be OK.
All other MySQL-Statements are working properly with the corelab driver so far, so Installation should be OK.
In the first line I can use 'SET @counter = 0; ' instead of 'SET @counter := 0; ' which is working, but this syntax isn't allowed in the SELECT statement.
EDIT: I use dbexpmda.dll version 3.0 in TSQLConnection (Delphi 7.0)
Please give me any advices to solve this issue.
Best Regards
Ingolf
Re: user variables with ":="
That easy is this!
Many Thanks for giving me this small, but vital hint.
Ingolf
Many Thanks for giving me this small, but vital hint.
Ingolf