Improving DBD::Sybase support, suggestion

Brian Bruns camber at ais.org
Thu Dec 16 16:18:11 EST 1999


On 12/16/99, "Michael Peppler <mpeppler at peppler.org>" wrote:
> Adrian Blakey writes:
>  > In some offline email with Michael Peppler I was told that ct_capability()
>  > currently always returns false. The result from this is used by DBD::Sybase
>  > to determine whether things like parameterized queries are supported (?
>  > placeholders).
>  > 
>  > Is improving ct_capability on the near-term todo list? ( :-) )
> 
We started returning false to make DBD::Sybase test happy.  It then went on 
the  long term todo list. Problem is I know that sybase supports some of 
this from the server end, but I'm not exactly sure how.  If somebody sends 
me a script that uses placeholders I can probably see what is going on, and 
then we'll know how difficult it is.  The other approach is to simply 
implement it all on the client side, which has the advantage of working 
against older Sybase engines and MS SQL as well.

Brian

> Specifically there are a few calls that would need to be supported:
> 
> 	CS_BOOL val;
> 	CS_RETCODE ret = ct_capability(imp_dbh->connection, CS_GET, CS_CAP_REQUEST,
> 			    CS_REQ_DYN, (CS_VOID*)&val);
> 
> is used to test for the "dynamic sql" capability.
> 
> 	ret = ct_dynamic(imp_sth->cmd, CS_PREPARE, imp_sth->dyn_id,
> 			 CS_NULLTERM, statement, CS_NULLTERM);
> 
> is needed to "prepare" a "dynamic" statement (one that includes
> ?-style placeholders)
> 
> 	ret = ct_dynamic(imp_sth->cmd, CS_DESCRIBE_INPUT, imp_sth->dyn_id,
> 			 CS_NULLTERM, NULL, CS_UNUSED);
> 
> Is used to get information on the parameters that are represented by
> the ? placeholders (this is btw much superior to most other data
> engines - most don't provide this capability (or at least that's what
> I understand from the DBI mailing list...)
> 
> 	if(ct_dynamic(imp_sth->cmd, CS_EXECUTE, imp_sth->dyn_id, CS_NULLTERM,
> 			 NULL, CS_UNUSED) != CS_SUCCEED)
> 
> Execute the dynamic statement.
> 
>     ret = ct_dynamic(imp_sth->cmd, CS_DEALLOC, imp_sth->dyn_id,
> 		     CS_NULLTERM, NULL, CS_UNUSED);
> 
> Dealloc (drop) the dynamic statement.
> 
> Michael
> -- 
> Michael Peppler         -||-  Data Migrations Inc.
> mpeppler at peppler.org    -||-  http://www.mbay.net/~mpeppler
> Int. Sybase User Group  -||-  http://www.isug.com
> Sybase on Linux mailing list: ase-linux-list at isug.com



More information about the FreeTDS mailing list