On 12/21/07, Mathieu Bouchard <matju@artengine.ca> wrote: On Tue, 18 Dec 2007, Mike McGonagle wrote:
> [query <srv_id> insert into mytable (id, name, token) values (?f,'?s','?s')]
> In this example, the first placeholder would expect a Float, with the next
> two expecting a Symbol (just think of this as a variation on the printf
> string substitutions).
It looks more like the types of [t] [pack] [unpack] [expr] etc.
Yes, they are PD types.
You don't really need to type your data. SQL is largely typeless: at least
at the level of what you can put in one table cell, anything is a string.
It becomes typed (but auto-cast) when put in the cell, but rebecomes
untyped when taken out of the cell.
Yes, I know that these things can be stored in a typeless manner, but the functions that bind the SQL statement with their placeholders can be of any type, as there are functions for the various datatypes.
This link shows all the different functions used to bind the data to the statement placeholders.
And if you look at how MySQL does this, while they only provide a single bind function, it does have the datatypes for the data in a structure that gets passed into the bind function.
Also, from looking at libdbi, it appears that they don't even bother with placeholders at all.