I try to execute the following SQL INSERT statement:
INSERT INTO FulltextEntry (FTContent, ID) VALUES ('ANNE":', 999)
I get the following error message (german):
EDatabaseError: Fehlender Wert für Parameter ', 999)
Is it a bug in dbExpress driver?
What can I do?
When executing the SQL statement in Query Analyzer, it works.
Using MS SQL Server 2000, Delphi 7, dbexpsda.dll 3.0.4
SQL INSERT with double quote and colon: missing parameter value
-
- Posts: 6
- Joined: Wed 27 Sep 2006 12:52
You should use parameters in this case. Try to change your code to something like this:
Code: Select all
SQLQuery1.SQL.Text := 'INSERT INTO FulltextEntry (FTContent, ID) VALUES (:param, 999');
SQLQuery1.ParamByName('param').AsString := 'ANNE":';
-
- Posts: 6
- Joined: Wed 27 Sep 2006 12:52
This problem concerned some bugs of dbExpress. Setting CheckParams to False does not work in design time. Even if you set CheckParams to False SQLQuery tries to create params. Your query should work after performing following steps:
1) set CheckParams to False;
2) place space after colon in the string constant of the query;
3) remove parameters in parameters editor of SQLQuery.
1) set CheckParams to False;
2) place space after colon in the string constant of the query;
3) remove parameters in parameters editor of SQLQuery.