Prepared Statements

With Nexista, I've tried to keep to standards as much as possible - standard XML, XSL, SQL, etc.For SQL, I use prepared statements, using the question mark (?) as the placeholder:
INSERT INTO numbers VALUES (?, ?, ?)
but I've read that this syntax also works:
INSERT INTO numbers VALUES (:id, :name, :lang)
This all works fine because PEAR MDB2 can handle it - it even simulates prepared statement support for drivers that don't.So why the blog post about it? Well another project I'm working on (NODOWS) has led me to libdbi. It is a database abstraction layer in C, which as far as I tell does not support prepared statements. I've read that prepared statements is in the works, but I can't find any more information about that in the documentation I've found.Therefore, I've got to do a little digging into MDB2 to find out how it simulates prepared statements. No matter how things turn out with libdbi, I'm still glad that most of the queries I've written for use with Nexista are consistent. That makes it sooo much easier to manage. I might convert them somehow, either using XSL or re2c. Should be interesting!
By on February 21, 2009 8:10 AM