Ken wrote:
Maybe your runtime library id different than the source code?
Yep, that's it. I used standard 3.5.4 binary of sqlite3.exe for the
test, but I was looking at the current CVS source files.
I'm sorry if I created any confusion.
Dennis Cote
spot the error?
During a bad call p->Separator is "," and z is "1,000", but the output
appears to come from the fprintf(out, "%s", z) line.
BTW, as a minor style issue, I think the last fprintf() call should use
out rather than p->out for the first argument for consistency reasons if
nothing else.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
for CSV files is that the separator is a single comma,
and this code will quote such field correctly.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
re
sqlite> explain query plan
...> SELECT MovieURL FROM MyTable WHERE FilePath GLOB
'/Volumes/Users/Shared/%';
0|0|TABLE MyTable WITH INDEX sqlite_autoindex_MyTable_1
GLOB uses * and ? as wildcard characters, not %
corresponding hex value in a comment, or you can generate the required
values when needed as I have suggested.
As always you should check if you are using the right tool for the job.
SQL isn't really intended for bit field manipulations. It can be done,
but perhaps it should
.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
Ken wrote:
the order by b,a seems to cause B to use asc.. Instead of the desc as written in the order by statement.
Ken,
You would need to say
order by b desc, a desc
to get the behaviour you expect.
HTH
Dennis Cote
characters where
needed.
It also specifically states that the string between the square brackets
can't be empty, so an error should be warranted in this case.
Dennis Cote
-
To unsubscribe, send email to [EMAIL
nambiguous from any of the
documentation I have seen so far.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
hen simply
document what SQLite does (instead of saying it supports standard Unix
glob syntax, since there isn't a standard).
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
of a
good reference?
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
these characters are
not allowed in filenames and hence wouldn't need to be matched by *nix
commands.
You can always trace through the source of the patternCompare function
in SQLite's source file func.c for more details.
HTH
Dennis Cote
---
han the
literal numeric value of 0.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
rsion == 0) {
begin transaction
initialize schema
db_user_version = MY_VERSION;
commit transaction
}
This will also allow you to check for and update older versions of your
schema when you make changes.
HTH
D
tion that explicitly overrides the
pad characteristic and use that for NO PAD operation.
But ultimately there is no requirement to provide any standard character
sets. So all bets are off when switching implementations (a
e performs. It is simply the case that all of SQLite's
collations have the NO PAD characteristic.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
floating point array directly into the database as a BLOB. You will have
one database record for each array, and loading and saving an array is
very straight forward.
HTH
Dennis Cote
-
To unsubscribe, send email
ood reason for this, or is there perhaps something wrong
with the amalgamation build process?
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
n't matter if the table is empty or not. After
you have the column names you can simply finalize the prepared statement.
See http://www.sqlite.org/c3ref/prepare.html,
http://www.sqlite.org/c3ref/column_count.html, and
http://www.sqlite.org/c3ref/column_name.html for more details.
HTH
D
want to add a minimum length check to prevent users from
entering an empty string (i.e. length of zero with no text, but still
not a null value).
create table t (a text not null check(length(a) >= 0 and length(a) <= 20))
-creating the
indexes after all the new data is added.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
ter is being changed somewhere along the line.
Print the value of your pointer immediately after it is set by
sqlite3_open(), and just before you call sqlite3_close(). These values
should be the same, if not you will have to find out where it is being
overwritte
versions of free to complain. Just a thought.
If you still have trouble, you will need to post your code to get better
help.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
file, or it can't
delete a journal, or perhaps all of the above at different times?
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
John,
This works for me using sqlite 3.5.3
sqlite> .mode csv
sqlite> select 1, 'test "quoted" text', 'more';
1,"test ""quoted"" text",more
What version are you using?
I seem to recall that SQLite is better about generating valid CSV
. You need to change the line that says:
if( needCsvQuote[((unsigned char*)z)[i]] ){
to:
if( needCsvQuote[((unsigned char*)z)[i]] || z[i]==p->separator ){
This will cause sqlite to quote text that contains the separator
character, which defaults to a comma.
HT
s, 2, tomorrow);
sqlite3_step(s);
sqlite3_finalize(s);
sqlite3_prepare_v2(db, "insert into t values(:a, julianday(:b))",
-1, , 0);
char* yesterday = "2007-12-16 00:00:00";
sqlite3_bind_int(s, 1, 4);
sqlite3_bind_text(s, 2, yesterday, -1, SQLITE_STATIC);
sql
result has columns j.aid and
b.bid. When you select b.* from this result there is only one column
from table b, the one sqlite returns.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
mber requires only 8 bytes
per timestamp.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions where it
says "The julian day number is the preferred internal representation of
dates."
A Julian day number is a floating point number that can be easily
compared and converted to data and time strings for display.
HTH
D
[EMAIL PROTECTED] wrote:
Dennis Cote <[EMAIL PROTECTED]> wrote:
It could be any application that uses a fixed set of predetermined SQL
statements to perform its operations. My primary application does
exactly that using SQLite with all statements prepared and cached as
needed. I
escription is correct, but your output is in the wrong order. The
default sort order is ascending so the 9 will sort after the 1.
Y
1
9
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
imagining it?
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
steveweick wrote:
the tests were done
using Windows XP SP2 and Linux FC5 on a 3GHz P4 with 1MB
That must be very slow. ;-)
I'm sure you meant 1GB for windows XP.
Dennis Cote
-
To unsubscribe, send email to [EMAIL
ts
larger, and users start storing more and larger BLOBs in the database.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
Samuel R. Neff wrote:
That also brings up the simple solution in that if you know you're db is
going to be in the 200GiB range, declare a larger page size before creating
the DB.
My thoughts exactly.
Dennis Cote
before the conversion to
integer truncates the unwanted fractional part.
141.70 is actually 141.6999... which is multiplied by 100 to give
14169.999..., after adding 0.5 you have 14170.4999...
which is truncated to 14170 by the cast.
HTH
Denni
I would say it is bug fix. The previous versions executed the queries
incorrectly.
* We have taken no steps toward fixing GROUP BY.
If I got ORDER BY wrong, I'm guessing GROUP BY
is wrong too.
And you should probably have another bug fix version release when these
bugs are fixed as
Shouldn't that be
total * 100 + 0.5
He is trying to round the last digit of the result by casting to integer
before he extracts those digits using substr.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
ave sqlite scan until
the end of the string you need to pass a negative number. Tyr this instead.
int rc = sqlite3_prepare(db, sql, -1, , 0);
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
you open it. That will cause a query to wait up to one second (1000 ms)
if the database is locked by your application when it is writing.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
racter in '+1 days' is not needed. It is simply a sign
character, it does not signify addition. You only need the sign if you
want a negative offset.
amount = 1
unit = "days"
offset = str(amount) + " " + unit
cur.execute("SELECT string, d FROM
al rule 2 in ascending
order by "c".
So SQLite should be sorting by the result column "c" not the column "c"
in the table T1 which it doing.
HTH
Dennis Cote
3) Let T be the result of evaluating the QE
immediately contained in the
.
18) If an is specifi
will be much appreciated.
You should read the optimizer docs at
http://www.sqlite.org/optoverview.html for an explanation of why this
happens.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
for the max value determination. This cast may be
done implicitly by SQLite, but it is probably safer to make it explicit.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
NOTE 98 – /Outer reference /is defined in Subclause 6.6, ‘‘reference>’’.
My reading of the outer reference definition is that is applies to
triggers and SQL procedures, and correlated subqueries.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
s in the table, it will return the wrong rowid. You
should stick with the original selects, unless you know that you are
inserting a new row.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
uot;insert or ignore into BGM (Bgm) values('Rock');"
bgm = sqlite3_last_insert_id();
"insert into MUSIC (Album_Id,Artist_Id,Bgm_Id) values(:album, :artist, :bgm,
'Track1.mp3');"
music = sqlite3_last_insert_id();
Now you can add this song to the playlist "New Music".
insert into table T
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
of sqliite that it was using:
select sqlite_version();
It will return the version as a string.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
the other sqlite3_column_* API functions.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
to switch to the
new sqlite3_prepare_v2 API instead of using the sqlite3_prepare API?
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
exes on the individual Id columns in the
music table.
create index MusicArtistId on Muisc(ArtistId);
create index MusicAlbumId on Muisc(AlbumId);
create index MusicBgmId on Muisc(BgmId);
HTH
Dennis Cote
-
To unsubscr
, or bgmId in the music table
(i.e. if this is the last record in the music table that references a
record in each of the other tables).
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
cvstrac/wiki?p=ForeignKeyTriggers
Your code won't need to do these deletes and it won't need buffer space
to store intermediate results you are using to do the deletes manualy.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
}
break;
default:
fprintf(stderr, "Error: %d : %s\n", rc, sqlite3_errmsg(db));
break;
}
}while( rc==SQLITE_ROW );
sqlite3_finalize(stmt);
}
sqlite3_close(db);
}
}
return rc!=SQLITE_DONE;
}
HTH
Dennis Cote
be compiled and processed without
complaint.
I would suggest creating a bug ticket.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
Thomas Damme wrote:
We set "page_size" and "cache_size" both at 8KB because it had the best
performance on the device.
Do you have 64 MB of ram to dedicate to sqlite for its cache? That's
what you are telling it by setting the cache to 8K pages of 8K
to check.
Your program can check the database on startup by executing a "pragma
integrity_check;" command just like you did from the command line.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
the corruption happened but my users have been
known to do things like store the live data file on a USB flash drive
and use it so it's hard to tell!
Thanks to all for the information and suggestions!
I'm glad to see you got it resolved and didn't loose your data.
Dennis Cote
to get out your backup.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
20, 2007 5:50 PM, Dennis Cote <[EMAIL PROTECTED]> wrote:
Mitchell Vincent wrote:
Here we go. I am accessing the database through an ODBC connection
using the most recent version from Christian's site..
The table schema :
CREATE TABLE invoice_items (
item_id INTEGER PRIMARY KEY,
need the ACID properties of SQLite, or can you simple repeat the
collection process if you have an OS crash or power fail while
collecting data? If not, then you can turn off the synchronous writing
with Pragma Synchronous=Off which should increase your write rate again.
HTH
Dennis Cote
base later.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
table in standard SQL).
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
[EMAIL PROTECTED] wrote:
Dennis Cote <[EMAIL PROTECTED]> wrote:
5) There is no link to the CVStrac home page on the navigation bar
Developers
Richard,
OK. I see that now.
When I saw the Developers link I thought it was a link to the bios and
pictures etc. f
serverless,
zero-configuration, transactional SQL database engine.
It already covers all the keys points in-process is supposed to mean. It
is a library. It is self-contained and serverless.
Dennis Cote
-
To unsubscribe,
he navigation menu. People certainly won't use the wiki
if they can't get to it easily.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
this overhead for a
one-liner.
Owen,
Try this instead:
sqlite3 test "insert into testable values ('value1','value2')"
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
the server, they just don't have
clickable links on the download page, so you have to enter the filename
with the desired version manually (or by editing a very similar URL
using copy and paste to minimize typing errors).
HTH
D
you want. All the old files are still on the server, there just
aren't any links so you have to type them in manually.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
#sqlite3_commit_hook). If the flag is
set the commit hook can post to the semaphore and wakeup your GUI
process, and then clear the flag.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
insert statement, to a select
statement. When you run the select it returns the values bound to the
parameters as the result of the select. This lets you see the values
that will be used if you run the first insert statement.
I thought it was a brilliant example of thinking outside the b
ct * from tmp;
2|2
1|1
sqlite>
Simon,
If you change your query to;
select rowid, * from tmp;
it will display the rowid which is different than either of the fields
in the table.
When doing a replace sqlite deletes the exi
handle the failure
in an appropriate manner.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
to sqlite3_libversion().
The prepare_v2 API was added in version 3.3.9 so it will not not be
present in earlier versions.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
efore update on table" or "before delete on table"
trigger to get the rowid of the row before it is deleted. You can access
the value old.rowid from within the trigger and save it into another
table for example. See http://www.sqlite.org/lang_createtrigger.html for
more detail
ore detail.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
big will
not load into sqlite.
Ken,
You should file a bug report at
http://www.sqlite.org/cvstrac/captcha?nxp=/cvstrac/tktnew so this gets
fixed.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
and the func.c source file at
http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/func.c=1.174 which
uses these APIs to implement all the built in SQL functions.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
and register your own collation function which does
exactly what you want. :-)
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
the column.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
you think the first such match is the best match, but
that is another issue for you to look at.
Another point, you should be using double quotes around your table name,
not single quotes.
HTH
Dennis Cote
.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
rch criteria.
I wonder if it might not be better to change this API to accept an empty
string, in addition to a NULL pointer, to find the default VFS. It seems
to me this might make life easier for those writing wrappers in
languages that don't have a concept of a NULL pointer.
Dennis C
way to round off the datestamp to the beginning of the day,
or maybe do you know if there is a list of built-in date functions
somewhere?
Andre,
Check out this page
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
I'm sure it will clear up lots of your questions.
HTH
Dennis C
gitude indexes, one in
each of the subselects), and the indexes contain the id field so it does
not have to lookup any records in the points table until the last step,
this query should run fairly quickly.
HTH
Dennis Cote
rmutations. It usually give me an error saying
'syntax error at' the start of my
Try
sqlite3 DBfile.db3 The .sql file contains SQL commands that must be executed by sqlite to
create the database, not data to be imported into the database.
HTH
D
ert statements.
.mode insert
select * from table1 where ID > 1000;
This doesn't generate the transaction wrapper, or the table's create
statement, but you can add those yourself if needed.
HTH
Denni
IFO
table in sqlite
http://article.gmane.org/gmane.comp.db.sqlite.general/16230/match=fifo
and this one gives some more info on the fifo id reset problem
http://article.gmane.org/gmane.comp.db.sqlite.general/16248/match=fifo
This should help you build a table with a maximum number of entries.
HTH
D
is executed only once. The inner loop will be executed once
for each result row.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
ile( isspace((unsigned char)zSql[0]) ) zSql++;
}
break;
}
}
sqliteFree(azCols);
azCols = 0;
}
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
te,/ in the sense "to belittle or mildly disparage," as in /He
deprecated his own contribution./ In an earlier survey, this newer sense
was approved by a majority of the Usage Panel.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
ally the callback
mechanism that has been depreciated, not sqlite3_exec itself.
The callback mechanism is still supported for backwards compatibility,
which is why the quickstart code (along with lots of other existing
sqlite client code) still works, but it should not be
primarily for
backward compatibility.
You should really look at the prepare/bind/step/column set of API
functions introduced in version 3 which is described at
http://www.sqlite.org/capi3.html
Dennis Cote
-
To unsubscribe
rt_rowid();
end;
insert into "Test View" (rowid) values (null);
select rowid || ' from view after insert' from "Test View"
where rowid=(select id from last_inserted_row);
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
that shows how to use the wrapper to do the things you need
to do. The CppSQLite wrapper library is available to download from the
site as well.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
I believe that something along the line of PostgreSQL’s syntax is
readable and compact.
Proposed Solution:
None provided with comment.
HTH
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
this was fixed so quickly.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
zy.
Is this a bug or am I simply not supposed to use such column names? (I
was reading the formal SQL-92 syntax definition recently and thought,
why not just try it out...)
Yves,
You should file a bug ticket at
http://www.sqlite.org/cvstrac/captcha?nxp=/cvstrac/tktnew since these
are all valid quoted SQL identifiers.
Dennis Cote
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
401 - 500 of 1177 matches
Mail list logo