Re: [sqlite] Widen output of file field for .databases CLI command

2011-08-25 Thread Clark Christensen
Hi Keith, How about pragma database_list;  -Clark From: Keith Christian To: sqlite-users@sqlite.org Sent: Thursday, August 25, 2011 8:55 AM Subject: [sqlite] Widen output of file field for .databases CLI command Is there a

Re: [sqlite] SQLite version 3.7.5

2011-02-01 Thread Clark Christensen
- Original Message From: Richard Hipp To: General Discussion of SQLite Database ; sqlite-annou...@sqlite.org Sent: Mon, January 31, 2011 5:32:15 PM Subject: [sqlite] SQLite version 3.7.5 >As of this release, the popular ADO.NET provider for

Re: [sqlite] EXTERNAL:Re: Can't delete a row

2011-01-28 Thread Clark Christensen
- Original Message From: Puneet Kishor To: General Discussion of SQLite Database Sent: Fri, January 28, 2011 9:33:15 AM Subject: Re: [sqlite] EXTERNAL:Re: Can't delete a row >Because I find using bind values easier, clearer, and safer,

Re: [sqlite] using SQLite with mod_perl

2010-10-11 Thread Clark Christensen
>So, I want all the perl modules to be loaded when Apache2 starts, and >then a $dbh created for each user when the user comes to the web site, >but not recreated for the same user on every reload. I am assuming >that would be the correct way to work speedily. I had the same problem, and it's a

Re: [sqlite] BUG - Documentation

2010-01-15 Thread Clark Christensen
Perhaps "...to whole underlying operating system..." should be "...to the whole underlying operating system..." - Original Message From: Dennis Cote To: General Discussion of SQLite Database Sent: Thu, January 14, 2010 4:38:48 PM

Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-23 Thread Clark Christensen
>SQLiteSpy (www.yunqa.de) is OK, but unless I missed the option, it >won't let me copy the output of a SELECT into the clipboard so I can >paste it elsewhere. FWIW, I'm pretty happy with SQLiteSpy, even though I don't use it for copy/paste of results. I used SQLite Explorer before, and am happy

Re: [sqlite] suggestions for avoiding "database locked" on ajax

2009-10-19 Thread Clark Christensen
suitable for a web application? Mind it, I am not talking about Amazon.com here. But, even with a few hundred users, someone is likely to hit the db at the same time someone else is hitting it. How do you all manage this situation? On Sun, Oct 18, 2009 at 2:28 PM, Clark Christensen <cdcmi..

Re: [sqlite] suggestions for avoiding "database locked" on ajax

2009-10-18 Thread Clark Christensen
ink it would help prove it's a timing issue (or not). - Original Message From: P Kishor <punk.k...@gmail.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Sat, October 17, 2009 8:07:09 PM Subject: Re: [sqlite] suggestions for avoiding "data

Re: [sqlite] suggestions for avoiding "database locked" on ajax

2009-10-17 Thread Clark Christensen
Sorry for top-posting... What's running on the the server? A Perl CGI script? Apache HTTPD? mod-perl? Is the AJAX exchange asyncronous? Are you sure the first AJAX exchange is finished when the second one fires? Does the AJAX request wait for a 200 response? Assuming Perl, are you

Re: [sqlite] regular expression search

2009-10-15 Thread Clark Christensen
The current dev branch of DBD-SQLite (1.26_05) includes an implementation of SQLite's unimplemented REGEX function (http://search.cpan.org/~adamk/DBD-SQLite/lib/DBD/SQLite.pm#REGEXP_function). Presumably, this will survive to the next production release. Otherwise, DBD-SQLite offers a custom

Re: [sqlite] Scalability.

2009-08-14 Thread Clark Christensen
> Your only problem is that you're at Stanford and Dr Hipp was at > Duke so he hates you. Not much humor on this list, but you made my day :-) Very funny. -Clark ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-23 Thread Clark Christensen
> Matt, > Just wanted to say publicly that DBD::SQLite is the greatest thing > since, well, SQLite. Thanks for making our lives easy. +1 Great stuff. -Clark - Original Message From: P Kishor To: General Discussion of SQLite Database

Re: [sqlite] Newbie question

2009-03-18 Thread Clark Christensen
SQLite treats double-quoted strings as column and table identifiers. Use single-quotes for literals. SELECT * FROM tbl1 WHERE description='someval' AND foreign_key_id=(select id from tbl2 where name='Joe'); -Clark - Original Message From: Dermot To:

Re: [sqlite] parameters

2009-03-17 Thread Clark Christensen
Difficult to read, so it's unclear what your intention is. But you mention JavaScript, so I'll take a stab... Bound parameters can only contain literal values. You can't use a bound parameter as an identifier for a table or column. Do you really mean this: ... WHERE users.user_id = ?

Re: [sqlite] UPDATE Field based on matching value in different Table

2009-02-23 Thread Clark Christensen
I've been meaning to ask this myself. I've been writing it like update TableA set Field2 = (select Field4 from TableB where Field3 = TableA.Field1) where Field1 = ?; --perhaps But it feels wrong. -Clark - Original Message From: Greg Robertson To:

[sqlite] Attached database atomic-ness

2009-02-20 Thread Clark Christensen
Hello, In the docs for ATTACH, I see this information: Transactions involving multiple attached databases are atomic, assuming that the main database is not ":memory:". If the main database is ":memory:" then transactions continue to be atomic within each individual database file. But if the

Re: [sqlite] A list as an SQL paramater

2009-01-14 Thread Clark Christensen
> What I'm comparing is the speed of SELECTing the list from a temporary > table, vs. building a new query string with printf and calling > sqlite3_prepare each time I want to execute it with a different $list. Please forgive me if I'm missing a key point, but it sounds like you already have

Re: [sqlite] request to become co-maintainer of DBD::SQLite

2009-01-14 Thread Clark Christensen
> One of my first code changes will be to require DBI 1.607+ The current DBD-SQLite works fine under older versions of DBI. So unless there's a compelling reason to do it, I would prefer you not make what seems like an arbitrary requirement. Otherwise, it sounds like a good start. Matt must

Re: [sqlite] Query Crashing SQLite

2008-11-26 Thread Clark Christensen
Older versions result in an SQL error: SQLite version 3.3.13 Enter ".help" for instructions sqlite> create table a (b); sqlite> select max(b) as q from a where q = 1; SQL error: misuse of aggregate: Same on Linux, Solaris, and Win32 - Original Message From: Daniel Zingaro <[EMAIL

[sqlite] Concatenation question

2008-09-11 Thread Clark Christensen
Hello, Using SQLite v3.3.13, this query: select oid || '|' || email_addr || '|' || residual_value as RD from gl_claims c where --RD is not null and status = 1 and not exists (select 1 from gl_claim_tickets where ticket_type = 'coupon' and claim_id = c.oid); I expect one

Re: [sqlite] Proposed removal of (mis-)feature

2008-08-07 Thread Clark Christensen
+1 in favor of removing non-standard quoting mechanism #3. - Original Message From: D. Richard Hipp <[EMAIL PROTECTED]> To: General Discussion of SQLite Database Sent: Thursday, August 7, 2008 10:26:07 AM Subject: [sqlite] Proposed removal of (mis-)feature

Re: [sqlite] Setting where AUTOINCREMENT starts?

2008-06-30 Thread Clark Christensen
Looks like you can insert and delete a row to set whatever you want as the starting number: sqlite> create table t1 (oid integer primary key autoincrement, a); sqlite> insert into t1 values (100, 'foo'); sqlite> delete from t1; sqlite> insert into t1 (a) values ('bar'); sqlite> select * from t1;

Re: [sqlite] Listing duplicate entries

2008-04-28 Thread Clark Christensen
select * from mytable where last in ( select last from mytable group by last_name having count(*) > 1 ) Probably slow on a big table. -Clark - Original Message From: flakpit <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, April 28, 2008 8:33:36 AM Subject: [sqlite]

Re: [sqlite] What is the standard way to store dates and do operations with dates please?

2008-04-05 Thread Clark Christensen
Near as I can tell, there's no 'standard' way to store dates. SQLite's date functions can deal with dates as floating-point julian numbers, -mm-dd hh:mm:ss strings (with or without the time portion), or Unix time integers. As arguments to SQLite's date/time functions, Unix times usually

Re: [sqlite] Windows XP, where should I place the Sqlite .DLL's for best Sqlite operation, for usage with other COM components?

2008-04-03 Thread Clark Christensen
Pretty much any folder in the PATH will do. You can put it \windows\system32\ but that can be a pain to get to and remember. I usually create one or more folders to hold non-Windows misc binaries, and add those to the system PATH. The most recent is C:\usr\bin\ for executables, and

Re: [sqlite] When I try to .read I get a "can't open" message

2008-03-31 Thread Clark Christensen
It's the trailing semicolon. The dot commands don't require them, while SQL statements do. - Original Message From: Douglas McCarroll <[EMAIL PROTECTED]> To: "sqlite-users@sqlite.org" Sent: Monday, March 31, 2008 2:11:35 PM Subject: [sqlite] When I try to

Re: [sqlite] [C] Getting results doesn't work properly

2008-03-25 Thread Clark Christensen
Well, I'm no C programmer, so I might be full of crap, but it looks like you're closing the db connection inside your while block (after you get the first row's data). Not sure about the exact usage for reset() and finalize(), but they don't seem proper inside a loop like yours. Last, it

[sqlite] drh interviewed on FLOSS Weekly podcast

2008-03-07 Thread Clark Christensen
I see drh and SQLite are the subjects this week in the FLOSS Weekly podcast. Check it out at http://www.twit.tv/floss26. -Clark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question on Queries

2008-03-03 Thread Clark Christensen
I'm sure the real experts will chime-in, but it looks like you might be executing the subquery once for every row in main. Maybe if you use a join, it would go faster select L.data from list L, main m where m.name='something' and L.mid = m.id; Or, maybe you could just use

Re: [sqlite] DBD::SQLite 1.14 prepare_cached bug?

2008-02-05 Thread Clark Christensen
> Conclusion: avoid using $dbh->disconnect() for DBD::SQLite, instead use "undef $dbh". Good info. I don't use usually use prepare_cached(), but I'm adding your observation to my notes for when I'm trying to resolve the same. > What kind of SQL injection is possible here? Good point. Not

[sqlite] DBD::SQLite 1.14 prepare_cached bug?

2008-02-04 Thread Clark Christensen
Sorry, this was mis-addressed. Should have gone to the list... - Forwarded Message From: Clark Christensen <[EMAIL PROTECTED]> To: Alexander Batyrshin <[EMAIL PROTECTED]> Sent: Monday, February 4, 2008 9:46:49 AM Subject: Re: [sqlite] DBD::SQLite 1.14 prepare_cached bug? ba

Re: [sqlite] Mailing List Changes

2008-02-04 Thread Clark Christensen
So, I sent a reply this morning to a list message, and it seems to have gone to the OP's email address rather than to the list (sorry bash). I don't remember having that issue with the old software (ezmlm). To fix, is it a client configuration, or is there a reply-to header that should be set

Re: [sqlite] Cache for SQLite

2008-01-24 Thread Clark Christensen
I don't think you're going to get the kind of caching you want using Perl and a web server (Apache, right?). There's just no persistence across processes, no shared memory, no database connections. Now, Apache's mod_perl and some associated modules could get you all that and more. For me,

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Clark Christensen
sqlite> select datetime('1201561222', 'unixepoch'); 2008-01-28 23:00:22 OK, so now it's clear your values are Unix times. sqlite> select strftime('%s', date('1201561222', 'unixepoch')); 1201478400 Effectively strips the time portion of your time value sqlite> select datetime('1201478400',

Re: [sqlite] free excel-like COLORFUL gui for sqlite

2008-01-08 Thread Clark Christensen
I'm not big on either Excel or ODBC, so I can't help with the details, but... There's an ODBC driver for SQLite you could install on your customer's system, and I'm pretty sure Excel can render data from an ODBC data source. So, if what you really want is to view query result data in Excel, it

Re: [sqlite] How to truncate the hour

2007-12-19 Thread Clark Christensen
I think your description of 1198990800 is a little off sqlite> select datetime(1198990800, 'unixepoch'); 2007-12-30 05:00:00 To "truncate the hour", as you say: sqlite> select strftime('%s', date(1198990800, 'unixepoch')); 1198972800 Which translates to 2007-12-30 00:00:00 -Clark -

Re: [sqlite] How to truncate the hour

2007-12-19 Thread Clark Christensen
select date(startTime, 'unixepoch','-8 hours'); SQLite's date/time functions are documented at http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions -Clark - Original Message From: Joanne Pham <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Wednesday, December 19, 2007

Re: [sqlite]:Using sqlite3_progress_handler for GUI application

2007-12-18 Thread Clark Christensen
FWIW, I notice the window title on the CVSTrac-generated pages at sqlite.org is "Sqlite CVSTrace". I'm guessing it should be "SQLite CVSTrac". - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, December 18, 2007 4:18:52 AM

Re: [sqlite] Detailed notes on compiling full-text search

2007-11-21 Thread Clark Christensen
Message From: P Kishor <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Wednesday, November 21, 2007 8:53:24 AM Subject: Re: [sqlite] Detailed notes on compiling full-text search On 11/21/07, Clark Christensen <[EMAIL PROTECTED]> wrote: > Were you able to build D

Re: [sqlite] Detailed notes on compiling full-text search

2007-11-21 Thread Clark Christensen
Were you able to build DBD-SQLite using the resulting library? Thanks! -Clark - Original Message From: P Kishor <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Wednesday, November 21, 2007 7:18:20 AM Subject: [sqlite] Detailed notes on compiling full-text search

Re: [sqlite] Suggests for improving the SQLite website

2007-11-09 Thread Clark Christensen
Richard, I just recently discovered that IE supports "conditionl comments", which allow you to, among other things, load specific CSS in IE. For detail, see http://msdn2.microsoft.com/en-us/library/ms537512.aspx I was able to use this feature to my advantage on a project to load the main CSS

Re: [sqlite] SQLite and html character entities

2007-09-21 Thread Clark Christensen
Wow! Excellent summary, Trevor. - Original Message From: Trevor Talbot <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, September 20, 2007 11:35:42 PM Subject: Re: [sqlite] SQLite and html character entities On 9/20/07, P Kishor <[EMAIL PROTECTED]> wrote: > On 9/20/07,

Re: [sqlite] SQLite and html character entities

2007-09-20 Thread Clark Christensen
to the browser, does it display correctly? -Clark - Original Message From: P Kishor <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, September 20, 2007 9:12:30 AM Subject: Re: [sqlite] SQLite and html character entities On 9/20/07, Clark Christensen <[EMAIL

Re: [sqlite] SQLite and html character entities

2007-09-20 Thread Clark Christensen
The META tag you include looks correct to me. Does perl get the chars right after CGI decodes them? The browser, ultimately, will escape the accented characters into urlencoded chars based on the utf-8 charset you specify in the HTML META tag. Then Perl (via CGI) is going to decode those

Re: [sqlite] like operator

2007-08-16 Thread Clark Christensen
You have to test your incoming values, and reject requests that have "%" (and other illegal) chars. I never allow real deletes from a web form, and especially not from trusted users. Consider adding a "deleted" column, and update the affected rows to indicate they've been deleted. It's a

Re: [sqlite] Need To Export A Table From a SQLite Database as a TAB Character Delimited Text File

2007-08-13 Thread Clark Christensen
I think .mode tabs does much the same as .separator "\t" but without the ambuguity of single vs double quotes. -Clark - Original Message From: "Griggs, Donald" <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, August 13, 2007 2:37:06 PM Subject: RE: [sqlite] Need To

Re: [sqlite] how to create C functions and refer to them in sql

2007-08-06 Thread Clark Christensen
I think you'd have to actually add your function into the SQLite source, and recompile. My guess, not being a C guy, would be for you to have a look at the SQLite source (maybe in func.c?). Since you already have a C function to do what you want, it seems pretty straightforward :-)) -Clark

Re: [sqlite] DELETE using a join?

2007-07-12 Thread Clark Christensen
delete from Payments where UserID in (select UserID from Users where UserName = 'John Smith'); will get the job done. And I'm sure there's a more elegant method. -Clark - Original Message From: Scott Baker <[EMAIL PROTECTED]> To: SQLITE Sent: Thursday, July

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Clark Christensen
http://www.mail-archive.com/sqlite-users@sqlite.org/msg10803.html Describes a patch that implements a sequence table, and functions to deal with it. You could use something like that to implement a unique-across-all-tables ID scheme. Though I think someone else (Igor?) already suggested

Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-15 Thread Clark Christensen
In SQLite null is not equal to anything, including null. I'm not sure what the best solution for your application is. With help from the others here, I have learned to use coalesce() to convert nulls into a value, and to not allow null in key fields. select tableA.path, tableA.value

Re: [sqlite] Select the top N rows from each group

2007-05-11 Thread Clark Christensen
I'm sure somebody can do better, but I I came up with this: create table fruits (type text, variety text, price number); create index fruit_type_price on fruits (type, price); insert into fruits values ('apple', 'gala', 2.79); insert into fruits values ('apple', 'fuji', 0.24); insert into fruits

Re: [sqlite] May I ask why the source distribution mechanism was changed starting with 3.3.14?

2007-05-02 Thread Clark Christensen
Richard, For what it's worth, it would be very convenient to have shell.c included in the preprocessed source distro. sqlite3.def would also be convenient, but the nm sqlite3.o | grep ... | sed ... >>sqlite3.def method seems to correctly generate sqlite3.def on my Windows system - EXCEPT,

Re: [sqlite] May I ask why the source distribution mechanism was changed starting with 3.3.14?

2007-04-27 Thread Clark Christensen
In general, I agree. I miss the zipped set of pre-processed C source. Since you have the Linux-based build system at your disposal, you can get what you're used to having with make target_source on the Linux system. This creates a tsrc directory containing the familiar pre-processed C

Re: [sqlite] Version 3.3.15

2007-04-09 Thread Clark Christensen
The sqlite3.def file is included in the Zip archive with the precompiled Windows DLL (http://www.sqlite.org/sqlitedll-3_3_15.zip). For me, it's a minor annoyance to have to download the precompiled DLL when I'm making the DLL from source. I've been meaning to ask to have sqlite3.def included

Re: [sqlite] Re: storing funky text in TEXT field

2007-04-05 Thread Clark Christensen
altzis <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, April 5, 2007 9:19:19 AM Subject: [sqlite] Re: storing funky text in TEXT field * Clark Christensen <[EMAIL PROTECTED]> [2007-04-05 17:25]: > I hate it when the CGI transaction clobbers characters. You > can

Re: [sqlite] storing funky text in TEXT field

2007-04-05 Thread Clark Christensen
I hate it when the CGI transaction clobbers characters. You can set the content-encoding in the HTML to UTF-8, and it might help, but I think the conversion from the urlencoded value is dependent on the web server platform's encoding (OS codepage, app platform settings, etc.) Plus, you run

Re: [sqlite] API for backups

2007-04-05 Thread Clark Christensen
I don't know if there are any APIs for backing-up. I don't think there are. I use this algorithm: open database using sqlite3_open() or equivalent in your wrapper. begin immediate or exclusive transaction to lock the database from all other access copy the file on the file system rollback

Re: [sqlite] Re: SQL help

2007-04-04 Thread Clark Christensen
Igor, Amazing. Thanks very much for your help. You get credit in my code comments :-)) -Clark - Original Message From: Igor Tandetnik <[EMAIL PROTECTED]> To: SQLite <sqlite-users@sqlite.org> Sent: Tuesday, April 3, 2007 12:20:57 PM Subject: [sqlite] Re: SQL help Clark

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-04 Thread Clark Christensen
Personally, I use "sequel" and "sequel-light". I think I remember from DRH's Google presentation video he uses "ess cue el ite" for his product. -Clark - Original Message From: Dennis Cote <[EMAIL PROTECTED]> To: sqlite-users Sent: Wednesday, April 4, 2007

Re: [sqlite] Novice help

2007-04-03 Thread Clark Christensen
Once you create a table, new.db will appear on disk in the default directory. Have a look at SQLite Spy (http://www.yunqa.de/delphi/sqlitespy/) and SQLite Explorer (http://www.singular.gr/sqlite/). Both are decent Windows GUI tools for SQLite. Neither provides much of a UI for data entry, but

Re: [sqlite] sqlite and generate dynamic html

2007-04-03 Thread Clark Christensen
Vivek, You ask a very broad question. I wouldn't know where to begin with code samples. If you were to ask for some specific, "how do I do...?" questions, I'm sure you'd get some code examples. You'll need to get the DBI modules installed, and the DBD-SQLite driver module installed into

Re: [sqlite] SQL help

2007-04-03 Thread Clark Christensen
some modules, and all complete). Thanks again! -Clark - Original Message From: Dennis Cote <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, April 3, 2007 12:27:54 PM Subject: Re: [sqlite] SQL help Clark Christensen wrote: > I have a table, as described below, whe

Re: [sqlite] Version 3.3.14

2007-04-02 Thread Clark Christensen
Excellent. All tests passed. Thanks for the quick fix. -Clark - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, April 2, 2007 3:20:45 PM Subject: Re: [sqlite] Version 3.3.14 Clark Christensen <[EMAI

Re: [sqlite] Version 3.3.14

2007-04-02 Thread Clark Christensen
Subject: Re: [sqlite] Version 3.3.14 Clark Christensen <[EMAIL PROTECTED]> wrote: > I'm seeing an error in make test for 3.3.14: > > /tmp/ccDdRRCh.o: In function `Sqlitetest1_Init': > /home/cchriste/sqlite-3.3.14/src/test1.c:4321: undefined reference to > `sqlite3_xferopt_c

Re: [sqlite] Version 3.3.14

2007-04-02 Thread Clark Christensen
I'm seeing an error in make test for 3.3.14: /tmp/ccDdRRCh.o: In function `Sqlitetest1_Init': /home/cchriste/sqlite-3.3.14/src/test1.c:4321: undefined reference to `sqlite3_xferopt_count' collect2: ld returned 1 exit status make: *** [testfixture] Error 1 $ Red Hat Linux 7.2 (2.4.7.10); gcc

Re: [sqlite] Finding linked peers

2007-03-20 Thread Clark Christensen
nd minor version). HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: Clark Christensen [mailto:[EM

Re: [sqlite] Finding linked peers

2007-03-20 Thread Clark Christensen
for identifying a release's predecessor. -Clark - Original Message From: Dennis Cote <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, March 20, 2007 11:27:39 AM Subject: Re: [sqlite] Finding linked peers Clark Christensen wrote: > So, finally, the question: What might the

[sqlite] Finding linked peers

2007-03-20 Thread Clark Christensen
I'm having trouble wrapping my head around a solution here. Any advice is appreciated. I'm working on a SQLite-based app for keeping track of PC BIOS releases. One obvious requirement is to be able to track and document change history. So, using this sample schema/data code: create table

Re: [sqlite] Format lf csv file RE: [sqlite] date/time implementation question

2007-03-14 Thread Clark Christensen
Hi Rafi, If it were mine to do, I would concentrate on getting the data into a table where I can work with it using SQL. It sounds like your best bet is to write some simple code to read through your CSV, validate its consistency (ignore the dates), and insert it into a table. Then use

Re: [sqlite] sin and similar functions

2007-03-09 Thread Clark Christensen
A poster here, "Mikey C", wrote some math functions and posted them a month or so ago. You might have a look at http://www.mail-archive.com/sqlite-users@sqlite.org/msg21791.html -Clark - Original Message From: Jakub Ladman <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent:

Re: [sqlite] Is there an inverse for .import?

2007-03-09 Thread Clark Christensen
>From the SQLite shell, you can send the output to a file using .output myfile.txt So .output myfile.txt select * from mytable; .output stdout will get you a pipe-delimited myfile.txt. You can change the delimiter using the .separator command, or you can use .mode to use a predefined format.

Re: [sqlite] Installing & Running Sqlite on Linux Webserver?

2007-02-28 Thread Clark Christensen
I've had good results with Vizaweb. They have PHP, and Perl by default, as well as MySQL and Postgres. Plus, they've expressed their willingness to consider installing other stuff. My guess is your part of the site runs in its own VM of some kind, so the impact to the host system, and other

Re: [sqlite] UPDATE base on certain values

2007-02-13 Thread Clark Christensen
Maybe coalesce() would work just as well: > UPDATE table SET > ID = '88', > parent = (SELECT CASE WHEN parent IS NULL THEN '1171291314642' > END FROM table WHERE ProjID = '88'), > .. > WHERE ProjID = '88'; becomes: UPDATE table SET ID = '88', parent = coalesce(parent,

Re: [sqlite] What does this mean???

2007-02-08 Thread Clark Christensen
WOW. Good to know. Thanks Jim (and Matt). -Clark - Original Message From: "Anderson, James H (IT)" <[EMAIL PROTECTED]> To: Matt Sergeant <[EMAIL PROTECTED]> Cc: sqlite-users@sqlite.org Sent: Thursday, February 8, 2007 8:36:31 AM Subject: RE: [sqlite] What does this mean??? Looks

Re: [sqlite] What does this mean???

2007-02-07 Thread Clark Christensen
Jim, Line 398 in dbdimp.c appears to be in DBD-SQLite's $sth->execute code. I agree with Puneet. If you wrap your DBI calls in eval blocks and test $@, you might get more info about the error (or maybe not). Also, setting RaiseError, and ShowErrorStatement in $dbh wouldn't hurt. $dbh =

Re: [sqlite] What does this mean???

2007-02-07 Thread Clark Christensen
What version of SQLite, and what version of DBD-SQLite? I saw this predictably with DBD-SQLite 1.09 and SQLite 3.2.7 where I did something like: $sth = $dbh->prepare("select foo, bar from mytable where rowid = ?"); for $i (1..5) { ($myfoo, $mybar) = $dbh->selectrow_array($sth,

Re: [sqlite] Appropriate uses for SQLite

2007-02-02 Thread Clark Christensen
FWIW, I'm not convinced Samba has locking working correctly. Using a very recent Samba version, I managed to corrupt a SQLite database last fall by (I think) doing simultaneous writes from the Linux host box, and my WinXP client box (via a SMB drive map). I'm guessing the XP writes started

Re: [sqlite] NULL always greater?

2007-01-31 Thread Clark Christensen
ect: Re: [sqlite] NULL always greater? Clark Christensen wrote: > I've read through numerous discussions here about comparing values with null, > and how SQLite functions work with null values, and I thought I understood. > > Now it seems appropriate to use the max(col1, col2) function

Re: [sqlite] NULL always greater?

2007-01-31 Thread Clark Christensen
olving a NULL value (including comparing against another NULL) is NULL. See the following for the details: http://www.sqlite.org/nulls.html Dan. On Tue, 2007-01-30 at 16:41 -0800, Clark Christensen wrote: > I've read through numerous discussions here about comparing values with null, > an

[sqlite] NULL always greater?

2007-01-30 Thread Clark Christensen
I've read through numerous discussions here about comparing values with null, and how SQLite functions work with null values, and I thought I understood. Now it seems appropriate to use the max(col1, col2) function to find the latest of two dates (integer Unix times), and some rows will contain

Re: [sqlite] SQLite documentation

2007-01-29 Thread Clark Christensen
Puneet, How about "make doc"? If you have TCL, that seems to generate the HTML output in ./doc. If you don't, I'd be happy to send it to you. -Clark - Original Message From: P Kishor <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, January 29, 2007 10:13:05 AM Subject:

Re: [sqlite] enforcing Foreign Keys

2007-01-29 Thread Clark Christensen
To unsubscribe, send email to [EMAIL PROTECTED] - Original Message From: Mag Gam <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Saturday, January 27, 2007 9:13:11 AM Subject: Re: [sqlite] enforcing Foreign Keys So...anyone? On 1/25/07, Martin Jenkins <[EMAIL PROTECTED]> wrote:

Re: [sqlite] Restricting integer primary key values

2007-01-15 Thread Clark Christensen
Brett, Have a look at http://www.sqlite.org/cvstrac/tktview?tn=1476 There may still be some custom function work to do for the OP's app, but this idea was a great start for me in implementing/managing a foreign sequence. Not sure if his wrapper supports custom SQL functions. -Clark -

Re: [sqlite] calculate age

2006-12-23 Thread Clark Christensen
I see Microsoft is already offering a patch for Windows XP to handle the new U.S. DST rules. -Clark - Original Message From: Joe Wilson <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Saturday, December 23, 2006 9:52:02 AM Subject: Re: [sqlite] calculate age Holiday

Re: [sqlite] REPLACE INTO Only Executes last SELECT?

2006-11-30 Thread Clark Christensen
utes last SELECT? Clark Christensen <[EMAIL PROTECTED]> wrote: > I don't think SQLite supports "REPLACE INTO..." I'm pretty sure "REPLACE" = > is a conflict action in SQLite. > > Perhaps "INSERT OR REPLACE INTO Memb= > erAccounts (MemberId, Balance) SEL

Re: [sqlite] REPLACE INTO Only Executes last SELECT?

2006-11-30 Thread Clark Christensen
I don't think SQLite supports "REPLACE INTO..." I'm pretty sure "REPLACE" is a conflict action in SQLite. Perhaps "INSERT OR REPLACE INTO MemberAccounts (MemberId, Balance) SELECT..." will do what you want? -Clark - Original Message From: Cnichols <[EMAIL PROTECTED]> To:

Re: [sqlite] Importing text file via .bat file

2006-11-16 Thread Clark Christensen
15, 2006 5:11:38 PM Subject: RE: [sqlite] Importing text file via .bat file Not sure if Shell can do something like that. What would the VB code be? RBS -Original Message----- From: Clark Christensen [mailto:[EMAIL PROTECTED] Sent: 15 November 2006 23:53 To: sqlite-users@sqlite.org Subj

Re: [sqlite] Importing text file via .bat file

2006-11-15 Thread Clark Christensen
RBS, Sorry to jump in late here. Others have given good advice, but I'm wondering, since this is all running from VB, why not do all the work in VB and skip the batch (or cmd) file. I'm not a VB guy, but I do know it's pretty powerful. Are you having some trouble with a VB wrapper for

Re: [sqlite] Q about new SQLite API

2006-11-07 Thread Clark Christensen
Q1: sqlite3_prepare_ex Q3: SQLITE_SCHEMA I don't currently use the APIs directly (though I have a project in mind), but these seem to make the most sense. -Clark - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, November 7,

Re: [sqlite] Date data type

2006-11-07 Thread Clark Christensen
IMO, dates are a pain. I spent considerable time trying to decide how best to store dates in my app(s), and eventually chose to use Unix times (integers). It seemed an easy choice as I program in Perl and JavaScript. Lately, I've begun to regret the choice I made. Every ad-hoc query I need

Re: [sqlite] SQLite and McAfee Anti-Virus

2006-10-31 Thread Clark Christensen
With the bigger companies, like McAfee, the phone support people are often not employees at the companies they represent. Phone support these days is largely outsourced. The first level tech you get usually does triage from a script. If you get to a second level (or higher) tech, they are

Re: [sqlite] Re: Re: Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Clark Christensen
Possible typo in the first sub condition of your WHERE clause. I'm sure you mean to say, "Data.title LIKE ", instead of "Data.titleLIKE". Also, I don't think SQLite lets you write a parameterized query like this. I think you have to concatenate the percents and your input string and pass the

Re: [sqlite] The term "flat-file" as applied to sqlite

2006-09-25 Thread Clark Christensen
In a project team I was on recently, the PM, and some other team members seemed to think "database" meant either Access, or client-server (Oracle/MS SQL Server). They kept wanting to "access the database directly". I ended-up telling them if they think of this database as if it were a "flat

Re: [sqlite] Re: Re: Cannot Find Syntax Error -- SOLVED!

2006-09-21 Thread Clark Christensen
>From the command line, you can use sqlite3 foo.db ".read load_hedges.sql" -Clark - Original Message From: Rich Shepard <[EMAIL PROTECTED]> To: SQLite Sent: Thursday, September 21, 2006 9:25:02 AM Subject: Re: [sqlite] Re: Re: Cannot Find Syntax Error --

Re: [sqlite] List of web hosting providers who provide/support SQLite?

2006-08-25 Thread Clark Christensen
I've been thinking about that myself. Then I started to wonder if the more common MySQL or PostgreSQL wouldn't be just as good (or better) for websites - particularly remote-hosted ones. I see there are a lot of hosting companies out there that offer the traditional LAMP stuff, as well as

Re: [sqlite] running a script?

2006-08-23 Thread Clark Christensen
It should work fine with filenames with semicolons. My problem is when I include the trailing semicolon, and it isn't really part of the filename or table name. You _might_ need to use forward slashes instead of backslashes as the path separator inside the SQLite shell on Windows. Or you

Re: [sqlite] running a script?

2006-08-23 Thread Clark Christensen
>From the SQLite shell .read myfile Or, from the OS command shell sqlite3 foo.db ".read myfile" .help in the SQLite shell will give you the available commands Note. For me, it's a habit to end lines in the SQLite shell with a semicolon. That breaks the .read and .import commands because

Re: [sqlite] Re: Re: Using Wrong Date Format

2006-08-18 Thread Clark Christensen
Duh! Nice. Sorry I missed it. -Clark - Original Message From: Igor Tandetnik <[EMAIL PROTECTED]> To: SQLite <sqlite-users@sqlite.org> Sent: Friday, August 18, 2006 11:22:18 AM Subject: [sqlite] Re: Re: Using Wrong Date Format Clark Christensen wrote: >> update ta

Re: [sqlite] Re: Using Wrong Date Format

2006-08-18 Thread Clark Christensen
> update tableName set DOB=substr(DOB,7,4)||substr(DOB,3,4)||substr(DOB,1,2); Am I missing some magic here? To me, this looks like it'll result in MMDD. Does SQLite convert MMDD date strings? I would've gone with the original -MM-DD date string that Igor posted. Thanks!

Re: [sqlite] Altering a table when field(column) names are unknown

2006-07-24 Thread Clark Christensen
I have had success using: create temp table my_temp as select * from my_table; Of course, if you don't know the column names, it might be a challenge getting the data back into the new (altered) table. If all you need is to add a column, ALTER TABLE does a good job in later releases. I'm on

  1   2   >