I can’t see any logical reason for this, but working through the Framework UserGuide, and on page 138 there are 2 examples.
In both cases, the sql select statement is duplicated :
sql = "SELECT * FROM Player WHERE Team = ? SELECT *
FROM Player WHERE Team = ?"
Dim ps As SQLitePreparedStatement
Is this just a typo, or is there a logical reason for duplicating the statement ?
That’s not the whole example right?
They differ at setting the type of each parameter.
(If I’m looking at the same as you…)
Dim sql As String
sql = "SELECT * FROM Player WHERE Team = ? SELECT *
FROM Player WHERE Team = ?"
Dim ps As SQLitePreparedStatement
ps = db.Prepare(sql)
// Identify the type of the first parameter
ps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
// Bind the first parameter to a value
[b]ps.Bind(0, "Seagulls")[/b]
Dim rs As RecordSet
[b]rs = ps.SQLSelect[/b]
Dim sql As String
sql = "SELECT * FROM Player WHERE Team = ? SELECT *
FROM Player WHERE Team = ?"
Dim ps As SQLitePreparedStatement
ps = db.Prepare(sql)
// Identify the type of the first parameter
ps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
Dim rs As RecordSet
[b]rs = ps.SQLSelect("Seagulls")[/b]
Hmm, tried to use BOLD on some lines…look at the lines thats surrounded by the “b”…
sorry, maybe I was not clear.
In both cases, the following SELECT statement is duplicated in the same line :
sql = "SELECT * FROM Player WHERE Team = ? SELECT *
FROM Player WHERE Team = ?"
so even if the sql line is correct, shouldn’t there be 2 parameters passed, as there are two ’ ? ’ in the line.
haha! Didn’t see that!
Yepp, your right. The SQL query seems to be wrong, there are two queries in the same query
File an FR on that.
Oh sorry. File a “bug” report on the Users Guide in Feedback
Many Thanks Albin. Have sent in the bug report.