Re: [sqlite] Prepared Statement Interface

2005-03-27 Thread Clay Dowling
Eugene Wee wrote: But I'm still curious as to the delimiter thing, hope someone can clarify. Oh, and also, does sqlite3_prepare() ask for the length of the statement string in bytes including the null terminator, or excluding it? Or is it safe to use -1 most of the time? The delimiter thing

Re: [sqlite] Prepared Statement Interface

2005-03-26 Thread Derrell . Lipman
Thomas Fjellstrom <[EMAIL PROTECTED]> writes: >> > Change sizeof to strlen here (and in the corresponding statement below); >> > sqlite3_bind_text wants the length of the string, not the size of the >> > pointer to it. >> >> sizeof(SEX)-1 is fine. > > I hope you mean strlen(SEX)-1 > > sizeof is a

Re: [sqlite] Prepared Statement Interface

2005-03-26 Thread Thomas Fjellstrom
On March 26, 2005 07:41 pm, Mrs. Brisby wrote: > On Sat, 2005-03-26 at 15:15 -0600, Eric Bohlman wrote: > > #define SEX "'M'" > > > > >sqlite3_bind_text(stmt, index, SEX, sizeof(SEX), SQLITE_TRANSIENT); > > [note the extra ' in SEX] > > > Change sizeof to strlen here (and in the

Re: [sqlite] Prepared Statement Interface

2005-03-26 Thread Mrs. Brisby
On Sat, 2005-03-26 at 15:15 -0600, Eric Bohlman wrote: > #define SEX "'M'" > > sqlite3_bind_text(stmt, index, SEX, sizeof(SEX), > > SQLITE_TRANSIENT); [note the extra ' in SEX] > Change sizeof to strlen here (and in the corresponding statement below);

Re: [sqlite] Prepared Statement Interface

2005-03-26 Thread Gert Rijs
Eric Bohlman wrote: Eugene Wee wrote: #define SEX "'M'" And make that #define SEX "M" Gert

Re: [sqlite] Prepared Statement Interface

2005-03-26 Thread Eric Bohlman
Eugene Wee wrote: As a test, I created a database containing a single table [children]. I filled it with the names of 3 girls and 2 boys, and then tried to write a program that selects the boys and girls separately and printed their names. However, I have difficulty in binding text with

[sqlite] Prepared Statement Interface

2005-03-26 Thread Eugene Wee
Hi, Are there any tutorials available to explain SQLite3's prepared statement interface further? I adapted from: http://www.linuxjournal.com/article/7803 As a test, I created a database containing a single table [children]. I filled it with the names of 3 girls and 2 boys, and then tried to