« More about Xojo 2014r… | Home | Xojo Cloud »

SQLPreparedStatementMBS improvements

You can now bind parameters by name with next plugin version:
// by index dim r as PreparedSQLStatement = db.Prepare("Insert into test_tbl(fid, fvarchar20) values(:1, :2)") r.BindType(0, SQLPreparedStatementMBS.kTypeLong) r.BindType(1, SQLPreparedStatementMBS.kTypeString) r.SQLExecute 12345, "Hello World by index" // by name dim sql as string = "Insert into test_tbl(fid, fvarchar20) values(:fid, :fvarchar20)" dim v as Variant = db.Prepare(sql) dim p as SQLPreparedStatementMBS = v p.BindType("fid", SQLPreparedStatementMBS.kTypeLong) p.BindType("fvarchar20", SQLPreparedStatementMBS.kTypeString) p.Bind("fid", 2345) p.Bind("fvarchar20", "Hello World by name") p.SQLExecute
12 03 14 - 12:13