Page 1 of 1

Problem with Parameter

Posted: Mon 31 Jul 2006 10:08
by demensys
I want to use a Parameter in a SQL Statment like:

Code: Select all

SELECT * FROM contracts where `status` in (:Status) order by id desc limit 50;
Status is declaratet as a VarChar.

The Parameter Status is a list off Strings.
This is an Exampel off the SQL Statment without Parameters:

Code: Select all

SELECT * FROM contracts where `status` in ('Eingestellt','Versendet','Kein Interesse') order by id desc limit 50;
The Problem is, that the Execute Statement is:

Code: Select all

SELECT * FROM contracts where `status` in ("'Eingestellt','Versendet','Kein Interesse'") order by id desc limit 50;
Which Parameter Type i must use for this?

Thanks for your Help!

Posted: Mon 31 Jul 2006 14:55
by Alexey
You cannot use parameters this way. MySQLDirect .NET doesn't support string formatting.

Posted: Mon 31 Jul 2006 19:24
by demensys
have you an ather way to fix this problem?

Posted: Tue 01 Aug 2006 06:29
by Alexey
You may perform string formatting yourself. This is the best way to solve the problem.