SQLite does not support stored procedures.
[quote=55831:@Norman Palardy]Are you inserting data ?
You don’t need to BIND for inserts - bind is for SELECT as the execution then places the values directly in the given variable - and it has to be a variable as you can’t place values into a literal[/quote]
Norman, I was following the code from the Xojo example database. Copy and pasted below…
[code] db = New SQLiteDatabase
If Not db.Connect Then
MsgBox(“The example could not create an in memory database and cannot be used without it. The demo app will now quit.”)
Quit
End If
// Create the tables for the database
DB.SQLExecute "create table Customers (FirstName varchar, LastName varchar, Address varchar, Email varchar, "+ _
"Company varchar, Phone varchar, Fax varchar, City varchar, State varchar, PostalCode varchar, "+ _
“ID integer NOT NULL PRIMARY KEY)”
// and insert some sample data
Dim sql As String = “insert into Customers (FirstName, LastName, Address, Email, Company, Phone, Fax, City, State, PostalCode, ID ) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)”
Dim prepInsert As SQLitePreparedStatement = db.Prepare(sql)
Dim lines(-1) As String = Split(ReplaceLineEndings(Customers,EndOfLine), EndOfLine)
For ID As Integer = 0 To UBound(lines)
If "" <> Trim(lines(id)) Then
Dim fields(-1) As String = Split(lines(ID), ChrB(9))
Const firstname = 0
Const lastname = 1
Const address = 2
Const email = 3
Const company = 4
Const phone = 5
Const fax = 6
Const city = 7
Const state = 8
Const postalcode = 9
Const idField = 10
Dim cid As Integer = Val(fields(idFIeld))
prepInsert.BindType(0, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(0, fields(firstname))
prepInsert.BindType(1,REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(1, fields(lastname))
prepInsert.BindType(2,REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(2, fields(address))
prepInsert.BindType(3, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(3, fields(email))
prepInsert.BindType(4, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(4, fields(company))
prepInsert.BindType(5, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(5, fields(phone))
prepInsert.BindType(6, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(6, fields(fax))
prepInsert.BindType(7, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(7, fields(city))
prepInsert.BindType(8, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(8, fields(state))
prepInsert.BindType(9, REALSQLPreparedStatement.SQLITE_TEXT)
prepInsert.Bind(9, fields(postalcode))
prepInsert.BindType(2,REALSQLPreparedStatement.SQLITE_INTEGER)
prepInsert.Bind(2, cid)
prepInsert.SQLExecute
db.Commit
End If
Next
[/code]