RE: [sqlite] outputting select in cpp file?

2006-07-28 Thread Pat Wibbeler
Check out the callback parameter to sqlite_exec (the third parameter). The quickstart gives an example of this: http://www.sqlite.org/quickstart.html Alternatively, check out sqlite3_prepare, sqlite3_bind, and sqlite3_step, sqlite3_result*, and sqlite3_finalize. All of these functions are

[sqlite] Re: Project

2006-07-28 Thread Cesar David Rodas Maldonado
I found to give a preference to select and a delay to insert. :D On 7/27/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: If a SQLite Db is LOCKED can i exec an TRIGER?

Re: [sqlite] Sqlite flash and mallocs.

2006-07-28 Thread drh
[EMAIL PROTECTED] wrote: > > Is it normal it takes 13,000 mallocs > That depends on your database schema and the data you are storing. -- D. Richard Hipp <[EMAIL PROTECTED]>

[sqlite] outputting select in cpp file?

2006-07-28 Thread Keiichi McGuire
This sounds like a very simple problem, but I cannot figure it out! Basically what I have is this settings table that has a boolean data type, and I want to check it via a cpp program. sqlite_exec(db,"select flag from setting",0,0,); and I want to be able to return a 0, or a 1 according to what

[sqlite] Sqlite flash and mallocs.

2006-07-28 Thread Mario . Hebert
I am saving a simple database (4-5 tables and few records inside). The total size of the database once flashed is 9216 bytes. I execute the following query: snprintf(query, MAX_SQLITE_QUERY_LEN, "attach database %s as %s;" "BEGIN;"

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-28 Thread Dennis Cote
On 7/27/06, Peter van Dijk <[EMAIL PROTECTED]> wrote: Using double quotes to quote identifiers in sqlite is dangerous, as mistyping a fieldname will not yield an error. Currently the only safe way to quote identifiers is using backticks, as in MySQL. Sadly you are almost correct. :-(

Re: [sqlite] SQLite browser/manager + Deep SQL - testers please

2006-07-28 Thread Me
thanks - Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: Sent: Friday, July 28, 2006 12:00 PM Subject: Re: [sqlite] SQLite browser/manager + Deep SQL - testers please On 7/28/06, Me <[EMAIL PROTECTED]> wrote: Also - How do I get it listed in

Re: [sqlite] User function in WHERE clause

2006-07-28 Thread Stan
O.K. This is what I need. Thanks -- View this message in context: http://www.nabble.com/User-function-in-WHERE-clause-tf2009603.html#a5543377 Sent from the SQLite forum at Nabble.com.

Re: [sqlite] SQLite browser/manager + Deep SQL - testers please

2006-07-28 Thread Dennis Cote
On 7/28/06, Me <[EMAIL PROTECTED]> wrote: Also - How do I get it listed in the wiki - ManagementTools? It's a wiki... Just go to the page click the edit link and add it yourself. HTH Dennis Cote

Re: [sqlite] User function in WHERE clause

2006-07-28 Thread Dennis Cote
On 7/28/06, Stan <[EMAIL PROTECTED]> wrote: But there are my problems: 1) Return value xFunc is void? I have to return integer. 2) Where are described parameters in xFunc? E.g. what is it "sqlite3_context"? Stan, Check out section 2.3 User defined funcion s on this page

Re: [sqlite] WHERE with user function

2006-07-28 Thread Dennis Cote
On 7/28/06, Stan <[EMAIL PROTECTED]> wrote: Is there any example (tutorial or explanation) in C or C++ for similar problem? Stan, All the built in functions in sqlite use exactly the same API that is available to you. The source file func.c conatins many examples of user defined functions

[sqlite] SQLite browser/manager + Deep SQL - testers please

2006-07-28 Thread Me
Windows SQLite browser/manager. Four query views. View/Edit four simultaneous queries or same table in various sort orders. No limitation how a table is arranged for editing as long as the Primary Key is in the query. Transactions supported. Deep SQL: Work on blob-stored SQLite databases -

[sqlite] Re: User function in WHERE clause

2006-07-28 Thread Igor Tandetnik
Stan <[EMAIL PROTECTED]> wrote: Thanks for answer. Yes, I have read this many times, but... ...I'm dumb maybe. I understand first 5 parameters in the "sqlite3_create_function". xStep and xFinal will be NULL. But there are my problems: 1) Return value xFunc is void? I have to return integer.

Re: [sqlite] WHERE with user function

2006-07-28 Thread Christian Smith
Stan uttered: Hi, I need user function for WHERE clause. But I don't know what type of parameters to use for such function: SELECT * FROM Table WHERE MYFUNC(ColumnName, IntValue). Above all - how to returm value to WHERE and what type? Is there any example (tutorial or explanation) in C or

Re: [sqlite] User function in WHERE clause

2006-07-28 Thread Stan
Thanks for answer. Yes, I have read this many times, but... ...I'm dumb maybe. I understand first 5 parameters in the "sqlite3_create_function". xStep and xFinal will be NULL. But there are my problems: 1) Return value xFunc is void? I have to return integer. 2) Where are described parameters

[sqlite] Re: User function in WHERE clause

2006-07-28 Thread Igor Tandetnik
Stan <[EMAIL PROTECTED]> wrote: Thanks for tip. I'm happy to see it's possible. Alas, I'm rather confused. I have read documentation, but I'm not sure what parameters to use What parameters your function needs to take depends entirely on what said function is supposed to do. and what

Re: [sqlite] insert default values

2006-07-28 Thread Mario Frasca
On 2006-0728 16:47:21, Nemanja Corlija wrote: > You can get that with this query: > select seq from sqlite_sequence where name='test' [...] > > There is also a last_insert_rowid() [...] > sqlite_sequence is really the way to go. very useful comments from everybody, thanks! Mario -- Power

[sqlite] Please un subscribe me from sqlite. Dont send me email

2006-07-28 Thread prabhu kumaravelu
Please un subscribe me from sqlite From: "Rob Richardson" <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: Subject: [sqlite] The meaning of times in julianday() Date: Fri, 28 Jul 2006 10:50:52 -0400 Greetings! My test query is: select tag_key,value,

[sqlite] The meaning of times in julianday()

2006-07-28 Thread Rob Richardson
Greetings! My test query is: select tag_key,value, datetime(value_timestamp, 'localtime') AS localtime, datetime(value_timestamp) AS UTCtime from trend_view where trend_key=1 and value_timestamp >= julianday('2006-07-27 10:08:32.000') order by value_timestamp desc

Re: [sqlite] insert default values

2006-07-28 Thread Nemanja Corlija
On 7/28/06, Mario Frasca <[EMAIL PROTECTED]> wrote: On 2006-0728 16:07:47, Nemanja Corlija wrote: > You can insert default value like this: > insert into test (f) values (NULL); > > Inserting NULL into autoincrement field just increments it. While > omitting value for any other field uses

RE: [sqlite] Can I use internal variables in SQL scripts?

2006-07-28 Thread Rob Richardson
Christian, Thank you for your reply. I will be happy to develop stored procedure capability for SQLite in my copious spare time. :-) Don't hold your breath. RobR -Original Message- From: Christian Smith [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 10:10 AM To:

Re: [sqlite] insert default values

2006-07-28 Thread Mario Frasca
Hi Gerry, yes, your help was quite useful... now we have two problems here, I would say: the first one is that, of all the things you have tried, only one is correct but two more are accepted without causing an error. On 2006-0728 06:55:22, Gerry Snyder wrote: > sqlite> create table test(f int

Re: [sqlite] insert default values

2006-07-28 Thread Nemanja Corlija
On 7/28/06, Gerry Snyder <[EMAIL PROTECTED]> wrote: Finally, get it right: sqlite> create table test(f integer primary key autoincrement, v int default 0); sqlite> insert into test (v) values (1); sqlite> insert into test (v) values (2); sqlite> insert into test (v) values (NULL); sqlite> select

Re: [sqlite] Can I use internal variables in SQL scripts?

2006-07-28 Thread Christian Smith
Rob Richardson uttered: In SQL Server, I can write a stored procedure that looks something like this: [snip] Other features available in SQL Server stored procedures include while loops, temporary tables, and the FETCH command to retrieve data from a resultset one row at a time. I have

Re: [sqlite] insert default values

2006-07-28 Thread Gerry Snyder
Mario Frasca wrote: and how do I insert a 'all-default' record? After getting everything else right (see my previous post): sqlite> insert into test (f) values (NULL); sqlite> select * from test; 1|1 2|2 3| 4|0 And this answers my previous comment, too. Inserting a NULL into v overrides

Re: [sqlite] insert default values

2006-07-28 Thread Christian Smith
Gerry Snyder uttered: Finally, get it right: sqlite> create table test(f integer primary key autoincrement, v int default 0); sqlite> insert into test (v) values (1); sqlite> insert into test (v) values (2); sqlite> insert into test (v) values (NULL); sqlite> select * from test; 1|1 2|2 3|

Re: [sqlite] insert default values

2006-07-28 Thread Gerry Snyder
Mario Frasca wrote: I'm trying to use default values and autoincrementing primary keys. [EMAIL PROTECTED]:~$ sqlite3 /data/mariof/test.db_scia.db SQLite version 3.3.4 Enter ".help" for instructions sqlite> create table test(f int auto_increment primary key, v int default 0); The above is

[sqlite] Can I use internal variables in SQL scripts?

2006-07-28 Thread Rob Richardson
In SQL Server, I can write a stored procedure that looks something like this: CREATE PROCEDURE MyProc AS DECLARE @someVariable INT SELECT @someVariable = someColumn FROM someTable WHERE someConditionThatReturnsOneRow SELECT someOtherColumn FROM someOtherTable WHERE thePrimaryKey =

[sqlite] WHERE with user function

2006-07-28 Thread Stan
Hi, I need user function for WHERE clause. But I don't know what type of parameters to use for such function: SELECT * FROM Table WHERE MYFUNC(ColumnName, IntValue). Above all - how to returm value to WHERE and what type? Is there any example (tutorial or explanation) in C or C++ for similar

Re: [sqlite] Problem parsing comments from SQL?

2006-07-28 Thread drh
Jeff Nokes <[EMAIL PROTECTED]> wrote: > Hi, > I've run into a weird situation where SQLite seems to not like in-line > comments depending on where they are placed. This is not the SQLite core but the sqlite command-line shell. The command line shell accumulates input until it sees a line that

Re: [sqlite] Another question about RAM

2006-07-28 Thread drh
"Sarah" <[EMAIL PROTECTED]> wrote: > Can anyone give me some guide? > SQLite memory requirements depends on how it is compiled and how it is used. You should use experiments to determine how much memory is required for your particular project. If SQLITE_ENABLE_MEMORY_MANAGEMENT is defined when

Re: [sqlite] sqlite using whole-file (not byte-range) locking

2006-07-28 Thread drh
Adam Megacz <[EMAIL PROTECTED]> wrote: > I'm interested in using SQLite with AFS (the Andrew FileSystem). > Unlike NFS, AFS has solid, reliable support for *whole-file* advisory > locking across the network. > > AFS does some very sophisticated caching, so an SQLite database in AFS > accessed by

Re: [sqlite] Another question about RAM

2006-07-28 Thread Martin Jenkins
Sarah wrote: >> Because uc/os-II doesn't provide malloc(), free() to manage memory, >> instead, it divides the memory into fixed-length blocks and >> provides OSMemGet() and OSMemPut() to get and put fixed-length >> memory block. >> >> In order to port SQLite, I have to wrap uc/os-II with a set

Re: [sqlite] Another question about RAM

2006-07-28 Thread Sarah
Can anyone give me some guide? - Original Message - From: "Sarah" <[EMAIL PROTECTED]> To: Sent: Thursday, July 27, 2006 3:47 PM Subject: [sqlite] Another question about RAM > Hi, all > > I want to build SQLite on the uc/os-II kernel in an embedded device. >

[sqlite] insert default values

2006-07-28 Thread Mario Frasca
I'm trying to use default values and autoincrementing primary keys. [EMAIL PROTECTED]:~$ sqlite3 /data/mariof/test.db_scia.db SQLite version 3.3.4 Enter ".help" for instructions sqlite> create table test(f int auto_increment primary key, v int default 0); sqlite> insert into test (v) values (1);

Re: [sqlite] User function in WHERE clause

2006-07-28 Thread Stan
Thanks for tip. I'm happy to see it's possible. Alas, I'm rather confused. I have read documentation, but I'm not sure what parameters to use and what return value for WHERE clause. Can you be so kind and show me a skeleton (C++) function for this: SELECT * FROM Table WHERE MYFUNC(ColumnName,