Discussion:
Special character in SqlQuery caused wrong parameters!
(too old to reply)
Ahmadi
2008-07-17 23:05:11 UTC
Permalink
I tried to run following query :
Insert into myTable(f1,f2) values('":Hi','v2');
SQL Query Show me that 'Hi' is not defined!? but why!?
":Hi is only a string value why SQL Query don't allow it in my table?

Im using Delphi 2007
And Driver=DBX, DBMS=SQLServer 2005
--
~~~~~~~~~~~
Best Regards
H.Ahmadi
Dennis Passmore
2008-07-17 23:31:25 UTC
Permalink
Insert into myTable(f1,f2) values('":'+'Hi','v2');
Ahmadi
2008-07-18 00:17:04 UTC
Permalink
Post by Dennis Passmore
Insert into myTable(f1,f2) values('":'+'Hi','v2');
DBX Query think that after ": is a paramater, then your query mean that
'+'Hi','v2'); is a parameter.
with your quert i have also the error but in your query '+'Hi','v2'); is
parameter of the error !!!

If you want see the error just do following steps:
1-create a form with one SQL Connection
2-create a SQL Query and set it's connection to the SQLConnection of step1
3-activate your connection
4-type your query in SQLQuery1.SQL and right click on SQLQuery and select
execute, you will see the error.

Thanks
Martijn Tonies
2008-07-23 16:57:02 UTC
Permalink
Post by Ahmadi
Insert into myTable(f1,f2) values('":Hi','v2');
SQL Query Show me that 'Hi' is not defined!? but why!?
":Hi is only a string value why SQL Query don't allow it in my table?
Im using Delphi 2007
And Driver=DBX, DBMS=SQLServer 2005
Because parameter parsing in Delphi is *****

You can use, yeah, parameters to avoid these issues :-)
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
delfo
2008-07-24 07:09:07 UTC
Permalink
Post by Martijn Tonies
Because parameter parsing in Delphi is *****
Not in Delphi, but in dbExpress. A query like:

SELECT NVL(FIELD, '?')
FROM TABLE

works perfectly in BDE, but gives a catastrophic error in dbExpress.
Martijn Tonies
2008-07-25 07:10:12 UTC
Permalink
Post by delfo
Post by Martijn Tonies
Because parameter parsing in Delphi is *****
SELECT NVL(FIELD, '?')
FROM TABLE
works perfectly in BDE, but gives a catastrophic error in dbExpress.
That surprises me too, but believe me, there's plenty of problems
in TParams ...
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Loading...