Problem with Parameter

Problem with Parameter

Postby demensys » Mon 31 Jul 2006 10:08

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!
demensys
 
Posts: 2
Joined: Mon 17 Jul 2006 13:28

Postby Alexey » Mon 31 Jul 2006 14:55

You cannot use parameters this way. MySQLDirect .NET doesn't support string formatting.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby demensys » Mon 31 Jul 2006 19:24

have you an ather way to fix this problem?
demensys
 
Posts: 2
Joined: Mon 17 Jul 2006 13:28

Postby Alexey » Tue 01 Aug 2006 06:29

You may perform string formatting yourself. This is the best way to solve the problem.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL