Class DBI::SQL::PreparedStatement
In: lib/dbi/sql/preparedstatement.rb
Parent: Object

The PreparedStatement class attempts to provide binding functionality for database systems that do not have this built-in. This package emulates the whole concept of a statement.


bind   new   prepare   tokens   tokens  


unbound  [RW] 

Public Class methods

"prepare" a statement.

quoter is deprecated and will eventually disappear, it is kept currently for compatibility. It is safe to pass nil to this parameter.

sql is the statement itself.

Convenience method for consumers that just need the tokens method.

Public Instance methods

attempts to bind the arguments in args to this statement. Will raise StandardError if there are any extents issues.

Break the sql string into parts.

This is NOT a full lexer for SQL. It just breaks up the SQL string enough so that question marks, double question marks and quoted strings are separated. This is used when binding arguments to "?" in the SQL string.

C-style (/* */) and Ada-style (—) comments are handled.

Note:Nested C-style comments are NOT handled!

Private Instance methods

prepares the statement for binding. This is done by scanning the statement and itemizing what needs to be bound and what does not.

This information will then be used by bind to appropriately map parameters to the intended destinations.