[freetds] Begginer question about binding parameterswith placeholders

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Fri Jun 9 04:13:59 EDT 2006


> 
> Leandro Conde a écrit :
> 
> >Greetings people! Hi all:
> >
> >My name is Leandro, and I'm a beginner in the FreeTDS library world,
> >
> >First of all: thanks you all for producing this excellent product.
> >It's really nice!
> >
> >Situation:
> >I'm trying to create a simple program written in C++ that issues some
> >simple data operations (SELECT, and INSERTs mostly) to a MSSQL 2000
> >server.
> >
> >Problem:
> >I'm found some problems while executing prepared statements with
> >parameters binded using placeholders.
> >
> >[...]
> >
> >Thank you for any help! And please forgive me if this problem is a
> >known issue or something, I've really done some research and found
> >nothing about it.
> >
> >  
> >
> Hello Leandro,
> 
> I discussed about this topic a few days ago, facing the same problem 
> with Perl scripts. It appears FreeDTS does not support 
> placeholders and 
> you cannot use prepare ans execute as you would do with ODBC. 
> I solved 
> my problem by placing values directly in my sql queries, even 
> if this is 
> less secure, particulary when you have to built queries with 
> data coming 
> from user inputs (you have to escape simple-quotes, for example, or 
> check typed values are numbers when some numeric fields are expected).
> 
> Maybe this will be solved or implemented in next versions.
> 

This is not 100% accurate... you were using CTlib (via DBD::Sybase) to access mssql and we suggested to either try to update FreeTDS or use ODBC (via DBD::ODBC) which has better placeholder support. And I still encourage you to try ODBC.

freddy77



More information about the FreeTDS mailing list