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
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?
[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]>
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
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;"
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. :-(
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
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.
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
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
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
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 -
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.
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
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
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
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
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,
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
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
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:
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
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
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
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
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|
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
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 =
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
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
"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
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
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
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.
>
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);
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,
36 matches
Mail list logo