Please bear with me here,
as this list may seem rather long.
1) Which of the C API routines allocate memory that my code must free?
2) Can COMMIT TRANSACTION and ROLLBACK TRANSACTION fail?
3) Which of the C API routines cannot fail?
4) C API routines with pointer return values return NULL
2007/1/25, anis chaaba <[EMAIL PROTECTED]>:hello
1-I'm trying to remember and i think that all routines that execute queries
need to free the error message variable like sqlite_exec or others.
2- No transactions fail while you're writing clean code
3- While u'r allocationg and freeing all your
[EMAIL PROTECTED] schrieb:
> dear all:
> i am a programmer from China, i use sqlite in my project.
> from sqlite, i know lemon.
> i work on windows, using vc6.0, i am trying to do something using lemon,
> but i have some issues.
> i write a my_calculator.y file, and generate
RB Smissaert wrote:
'these speed up inserts enormously, particulary the first one
'
sqlite_get_table lDBHandle, "PRAGMA synchronous=off;", strErrors
sqlite_get_table lDBHandle, "PRAGMA encoding='UTF-8';",
>From os_unix.h:... After reading this, locking makes more sense!
Although the Lock may physically be an exclusive lock, the
implementation is actually a logcially "SHARED" lock.
/* The following describes the implementation of the various locks and
** lock transitions in terms
I need a way to drop a table only if that table exists. How would I do
that?
Thanks,
jim
NOTICE: If received in error, please destroy and notify sender. Sender does not
intend to waive confidentiality or privilege. Use of this email is
On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
> that?
>
> Thanks,
Are you asking if http://sqlite.org/lang_droptable.html works or have
you had problems?
--
G. Roderick Singleton <[EMAIL PROTECTED]>
PATH
Sorry, I should have checked the site first. My background is sybase and
I didn't expect anything so simple.
Thanks very much,
jim
-Original Message-
From: G. Roderick Singleton [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 25, 2007 10:49 AM
To: sqlite-users@sqlite.org
Subject:
For select, update, insert, or delete is there a way to get the number
of rows affected?
Thanks,
jim
NOTICE: If received in error, please destroy and notify sender. Sender does not
intend to waive confidentiality or privilege. Use of this
>For select, update, insert, or delete is there a way to get the number
>of rows affected?
http://www.sqlite.org/capi3ref.html#sqlite3_changes
Ralf
-
To unsubscribe, send email to [EMAIL PROTECTED]
Thanks.
-Original Message-
From: Ralf Junker [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 25, 2007 11:37 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Another (possibly dumb) question
>For select, update, insert, or delete is there a way to get the number
>of rows
If you find a way to drop a table which dosn't exist. let us know how
you do it.
G. Roderick Singleton wrote:
On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
I need a way to drop a table only if that table exists. How would I do
that?
Thanks,
Are you asking if
On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> If you find a way to drop a table which dosn't exist. let us know how
> you do it.
>
> G. Roderick Singleton wrote:
> > On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> >
> >>I need a way to drop a table only if that
G. Roderick Singleton wrote:
On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
If you find a way to drop a table which dosn't exist. let us know how
you do it.
Thanks for your insight. However what's your point? That the OP didn't
check the website, that my reference was incorrect
> -Original Message-
> From: G. Roderick Singleton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 25, 2007 12:06 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] How to conditionally drop a table?
>
>
> On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> > If you find a
Fred,
I got it right away. And I just don't laugh for the fun of it. :-) It's
gotta be funny. Was it a tad harsh? Yeah... But it was funny.
- Original Message -
From: "Fred Williams" <[EMAIL PROTECTED]>
To:
Sent: Thursday, January 25, 2007 1:42 PM
On Thu, Jan 25, 2007 at 10:35:23AM -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
> that?
You'd think this would work:
SELECT CASE WHEN
(SELECT count(*) FROM sqlite_master WHERE
type = 'table' AND name = 'foo') > 0
On Thu, 2007-01-25 at 18:40 +, Martin Jenkins wrote:
> G. Roderick Singleton wrote:
> > On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> >
> >> If you find a way to drop a table which dosn't exist. let us know how
> >> you do it.
> >>
> > Thanks for your insight. However
DROP TABLE [IF EXISTS]
DROP INDEX [IF EXISTS]
CREATE TABLE [IF NOT EXISTS]
and so on...
On 1/25/07, Nicolas Williams <[EMAIL PROTECTED]> wrote:
On Thu, Jan 25, 2007 at 10:35:23AM -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
>
Hello,
I just downloaded the latest version (3.3.11). It configures and
build fine out-of-the-box on OSX (10.4.8) BUT I can't seem to get the
Full Text Search extension working and / or linked into the library /
sqlite shell.
I tried adding the suggested flags in the Makefile to no
Martin Jenkins wrote:
G. Roderick Singleton wrote:
On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
If you find a way to drop a table which dosn't exist. let us know how
you do it.
Thanks for your insight. However what's your point? That the OP didn't
check the website, that
Hello,
I am trying to get started with sqlite3. Seams there is still
something wrong with my setup.
I am stuck and was wondering if someone could give me a hand.
I can select but it wont let me insert or update the database. The
error is "unable to open database file" however it does open the
> -Original Message-
> From: Joe Wilson [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 24, 2007 5:04 PM
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] Fix for sqlite3.h in version 3.3.10
>
> --- James Dennett <[EMAIL PROTECTED]> wrote:
> > Joe Wilson wrote:
> > > The
jose isaias cabrera wrote:
I got it right away. And I just don't laugh for the fun of it. :-)
It's gotta be funny. Was it a tad harsh? Yeah... But it was funny.
See http://c2.com/cgi/wiki?ZenSlap
Martin
-
To
Hi Y'all,
Please forgive what I think is probably a dumb question, but...
I am porting my app's data model from C++/STL to sqlite. My goal is
scalability - even if I implement my data model in C++ using data
structures that give me good O(N) time (e.g. use trees, hash tables,
etc.) the
Hi,
I get the "Error: database is locked" when trying to do anything
(select, pragma, getting file version etc) with a database stored on a
DVD-ROM under OS X.
This happens with the (fairly old) version 3.1.3 bundled with OS X, and
also with the (less old) version 3.3.8 in a custom-built
Hi All,
I am new to sqlite, and liking it a lot so far. My only problem is there is
no native foreign key/data integrity. Are there plans to include FKs in
future releases? I have been reading,
http://www.rcs-comp.com/site/index.php/view/Utilities-SQLite_foreign_key_trigger_generator
But this
On 1/25/07, Ben Supnik <[EMAIL PROTECTED]> wrote:
Hi Y'all,
Please forgive what I think is probably a dumb question, but...
I am porting my app's data model from C++/STL to sqlite. My goal is
scalability - even if I implement my data model in C++ using data
structures that give me good O(N)
Can someone tell me how to unsubscribe. I have sent
two messages to the link and have had no luck thank
you.
--- Mag Gam <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am new to sqlite, and liking it a lot so far. My
> only problem is there is
> no native foreign key/data integrity. Are there
>
Dan McDaniel wrote:
Can someone tell me how to unsubscribe. I have sent
two messages to the link and have had no luck thank
you.
--- Mag Gam <[EMAIL PROTECTED]> wrote:
Send a mail to [EMAIL PROTECTED] - it has directions on how
to unsubscribe if the standard method fails. I just tried it
1. given a non-sequential id, select all the ids
2. grab a random id
3. select the row with that id.
is there a better way of accomplishing this, one that requires a
single round-trip to the db?
--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison
P Kishor <[EMAIL PROTECTED]> wrote:
1. given a non-sequential id, select all the ids
2. grab a random id
3. select the row with that id.
is there a better way of accomplishing this, one that requires a
single round-trip to the db?
If you can somehow keep track of the number of rows (N) in the
select * from table1 order by random(id) limit 1
?
--- P Kishor <[EMAIL PROTECTED]> wrote:
> 1. given a non-sequential id, select all the ids
> 2. grab a random id
> 3. select the row with that id.
>
> is there a better way of accomplishing this, one
> that requires a
> single round-trip to the
On 1/25/07, Artem Yankovskiy <[EMAIL PROTECTED]> wrote:
select * from table1 order by random(id) limit 1
Yes, very nice, thank you. I am not familiar with the "ORDER BY
random(col)" idiom. How does this work? (It does work alright).
--- P Kishor <[EMAIL PROTECTED]> wrote:
> 1. given a
P Kishor <[EMAIL PROTECTED]> wrote:
On 1/25/07, Artem Yankovskiy
wrote:
select * from table1 order by random(id) limit 1
Yes, very nice, thank you. I am not familiar with the "ORDER BY
random(col)" idiom. How does this work? (It does work alright).
random(anything) produces a random
> select * from table1 order by random() limit 1
If you're performing a select on a single table (not a view, join
or a subquery) and you are selecting many columns (say > 6) and the
table has a very large number of rows, then this query will run faster
on recent versions of sqlite3:
select *
This is not strictly random, but will select a row in near
constant time regardless of the number of rows in the select:
-- let's assume you know you only have 65535 rows...
select * from table1 where rowid = random() & 65535
union all select * from table1 where rowid = random() &
(Pardon me if this email is a duplicate, but I think the last copy
was interpreted as spam due to the repetition of rows in the SQL.)
This is not strictly random, but will select a pseudo-random row
in near constant time regardless of the number of rows in the table:
-- let's assume you know
38 matches
Mail list logo