John Machin wrote:
On 19/08/2007 4:01 AM, Jef Driesen wrote:
Suppose I have two related tables:
CREATE TABLE events (
id INTEGER PRIMARY KEY NOT NULL,
place_id INTEGER
);
CREATE TABLE places (
id INTEGER PRIMARY KEY NOT NULL,
name TEXT
);
INSERT INTO places (id, name
When using sqlite3_bind_text() (or a similar function) with
SQLITE_STATIC, how long does the pointer have to remain valid? As long
as the sqlite3_stmt is not finalized?
It is clear to me the following will cause no problem:
sqlite3_bind_text (stmt, column, "some text", -1, SQLITE_STATIC);
Suppose I have a simple table with an integer primary key:
CREATE TABLE table (
id INTEGER PRIMARY KEY NOT NULL,
name TEXT
);
and insert values without supplying a value for the primary key:
INSERT INTO table (name) VALUES (@name);
Is it guaranteed that the primary key is always
Dan Kennedy wrote:
On Wed, 2007-07-04 at 09:58 +0200, Jef Driesen wrote:
Igor Tandetnik wrote:
Mario Figueiredo wrote:
I'm a tad bit confused with sqlite3_finalize() usage when the query
fails. As it is, I'm assuming it releases resources and I use it in
this context
Igor Tandetnik wrote:
Mario Figueiredo wrote:
I'm a tad bit confused with sqlite3_finalize() usage when the query
fails. As it is, I'm assuming it releases resources and I use it in
this context:
rc = sqlite3_prepare_v2(/* ... */);
if (rc != SQLITE_OK)
{
Scott McDonald wrote:
Jef Driesen wrote:
Scott McDonald wrote:
Jef Driesen wrote:
I have some questions on the usage of sqlite3_reset (or
sqlite3_finalize) after sqlite3_step.
In the legacy interface I use sqlite3_reset after sqlite3_step to obtain
a more specific error code
Scott McDonald wrote:
Jef Driesen wrote:
I have some questions on the usage of sqlite3_reset (or
sqlite3_finalize) after sqlite3_step.
In the legacy interface I use sqlite3_reset after sqlite3_step to obtain
a more specific error code for SQLITE_ERROR (to be able to detect schema
errors
Igor Tandetnik wrote:
Jef Driesen wrote:
I'm trying to execute a query from the callback function that is
registered with sqlite3_update_hook. But sqlite3_prepare_v2 always
returns SQLITE_MISUSE. Is it not allowed to execute queries from the
callback function?
I'm was trying to use
I'm trying to execute a query from the callback function that is
registered with sqlite3_update_hook. But sqlite3_prepare_v2 always
returns SQLITE_MISUSE. Is it not allowed to execute queries from the
callback function?
I'm was trying to use the callback function as a notification mechanism
to
A. Pagaltzis wrote:
* Jef Driesen <[EMAIL PROTECTED]> [2007-04-11 16:10]:
I managed to solve this problem now. I had to write my solution
(see below) in pseudo sql code (e.g some extra non-sql code was
required) because sqlite does not support stored procedures. It
think it is
I have some questions on the usage of sqlite3_reset (or
sqlite3_finalize) after sqlite3_step.
In the legacy interface I use sqlite3_reset after sqlite3_step to obtain
a more specific error code for SQLITE_ERROR (to be able to detect schema
errors and automatically reprepare the statement,
Dennis Cote wrote:
Jef Driesen wrote:
I can give you the example of an application using sqlite as the on-disk
file format. As mentioned on the sqlite website [1], the traditional
File/Open operation does an sqlite3_open() and executes a BEGIN
TRANSACTION. File/Save does a COMMIT followed
Dennis Cote wrote:
[EMAIL PROTECTED] wrote:
It appears that my requirements are to be able to do the following:
BEGIN parent;
insert into t values ('a');
BEGIN child;
insert into t values ('b');
insert into t values ('c');
ROLLBACK child; // child aborts
insert
Jef Driesen wrote:
I want to store a tree in an sqlite database. My first choice was the
adjacency list model:
CREATE TABLE tree (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
parent_id INTEGER
);
But this method requires multiple queries to display the entire tree
A. Pagaltzis wrote:
Hi Jef,
* Jef Driesen [2007-04-06 11:20]:
Q1. Which is more efficient? Two simple queries or one self
join?
I have seen two different types of queries to retrieve a tree.
The first one uses two very simple queries:
SELECT lft, rgt FROM tree WHERE name = @name;
SELECT
Dennis Cote wrote:
Jef Driesen wrote:
I want to store a tree in an sqlite database. My first choice was the
adjacency list model:
CREATE TABLE tree (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
parent_id INTEGER
);
But this method requires multiple queries to display the entire
I want to store a tree in an sqlite database. My first choice was the
adjacency list model:
CREATE TABLE tree (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
parent_id INTEGER
);
But this method requires multiple queries to display the entire tree (or
a subtree) in my GUI (a gtk+
Dan Kennedy wrote:
On Mon, 2007-03-12 at 10:51 +0100, Jef Driesen wrote:
I was planning to use the sqlite3_update_hook function to notify my GUI
about changes. The idea was that every part of the GUI can update itself
when a database change is detected. But during testing, I encountered
some
I was planning to use the sqlite3_update_hook function to notify my GUI
about changes. The idea was that every part of the GUI can update itself
when a database change is detected. But during testing, I encountered
some problems with this approach together with transactions.
When I group some
Jef Driesen wrote:
[EMAIL PROTECTED] wrote:
Jef Driesen wrote:
I did. sqlite3_close is called automatically for SQLITE_NOMEM, but not
for other cases. So I guess sqlite3_close is still needed. But then it
shouldn't return an error, or am I wrong?
I don't think any error other than
Jef Driesen wrote:
Do I need to use sqlite3_close if the call to sqlite3_open indicated an
error? The documentation for sqlite3_open says "An sqlite3* handle is
returned in *ppDb, even if an error occurs." So I assumed the answer is yes.
But if I try this code (on a non-exi
[EMAIL PROTECTED] wrote:
"Jef Driesen" <[EMAIL PROTECTED]> wrote:
I did. sqlite3_close is called automatically for SQLITE_NOMEM, but not for
other cases. So I guess sqlite3_close is still needed. But then it
shouldn't return an error, or am I wrong?
I don't think any
Jay Sprenkle wrote:
On 1/24/07, Jef Driesen <[EMAIL PROTECTED]> wrote:
Do I need to use sqlite3_close if the call to sqlite3_open indicated an
error? The documentation for sqlite3_open says "An sqlite3* handle is
returned in *ppDb, even if an error occurs." So I assumed the ans
Do I need to use sqlite3_close if the call to sqlite3_open indicated an
error? The documentation for sqlite3_open says "An sqlite3* handle is
returned in *ppDb, even if an error occurs." So I assumed the answer is yes.
But if I try this code (on a non-existing file and no write permissions):
24 matches
Mail list logo