[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] NULL always greater?

2007-01-31 Thread Clark Christensen
ving 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, &g

Re: [sqlite] NULL always greater?

2007-01-31 Thread Clark Christensen
02 AM Subject: 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,

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 fir

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, u

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 = D

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 like

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, '1

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 s

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] 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: Friday,

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 Dennis

[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 bi

Re: [sqlite] Finding linked peers

2007-03-20 Thread Clark Christensen
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 migh

Re: [sqlite] Finding linked peers

2007-03-20 Thread Clark Christensen
arate integers (a field for major and 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-

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 3.0.

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

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

[sqlite] SQL help

2007-04-03 Thread Clark Christensen
I have a table, as described below, where I need to find out if the tech_id in question has at least some modules in a particular collection (coll_id), and they're all complete. At this point, I'm working with variations on: select (select count(*) from tech_modules where t

Re: [sqlite] SQL help

2007-04-03 Thread Clark Christensen
(at least 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

Re: [sqlite] SQL help

2007-04-03 Thread Clark Christensen
To: sqlite-users@sqlite.org Sent: Tuesday, April 3, 2007 3:07:44 PM Subject: Re: [sqlite] SQL help Clark Christensen wrote: > > Yeah, that's much cleaner. Just once through the tech's module set instead > of twice, and it satisfies both requirements (at least some modules, and all &

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 Perl

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] 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 1:24:39 PM Subject: [sqlite

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 Sent: Tuesday, April 3, 2007 12:20:57 PM Subject: [sqlite] Re: SQL help Clark Christensen wrote: > I hav

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 trans

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 the

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

2007-04-05 Thread Clark Christensen
. Pagaltzis <[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 se

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 w

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 source

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, w

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 v

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 from

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 someth

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 12, 2007 3:47:37 PM Subje

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] 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 Ex

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 litt

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 back

Re: [sqlite] SQLite and html character entities

2007-09-20 Thread Clark Christensen
it back 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 &

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, Tr

Re: [sqlite] Most basic of questions

2007-10-10 Thread Clark Christensen
As you've discovered, $sth->finish doesn't quite do the job. I've found if I simply undef $sth; before disconnecting, it eliminates the message about closing $dbh with active statement handles. -Clark - Original Message From: Brian Rowlands (Greymouth High School) <[EMAIL PROTECTE

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 http://sqlite.org:8080/cgi-bin/mai

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 f

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 explici

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

2009-10-18 Thread Clark Christensen
ink, etc), do you still get the locked DB? If not, I think it would help prove it's a timing issue (or not). - Original Message From: P Kishor To: General Discussion of SQLite Database Sent: Sat, October 17, 2009 8:07:09 PM Subject: Re: [sqlite] suggestions for avoiding &

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

2009-10-19 Thread Clark Christensen
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 wrote: >>Ajax is always asynchronous. That

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] 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] 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 http://www.sqli

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

2007-11-21 Thread Clark Christensen
ginal 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

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 Subject

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 9:22:

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 - Origi

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 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', 'unix

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, any

Re: [sqlite] Cache for SQLite

2008-01-24 Thread Clark Christensen
you have any interesting ideas or knowledge - it'll be great if you share it with me. On Jan 24, 2008 6:06 PM, Clark Christensen <[EMAIL PROTECTED]> wrote: > I don't think you're going to get the kind of caching you want using

[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 i

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 sure

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 i

[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] [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 looks

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 .read I get a "can't open" mes

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 C:\usr\lib

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 ha

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] Finding Missing Table Rows

2008-05-15 Thread Clark Christensen
= fs.comp); This "not exists (select 1 from ...)" has been pretty reliable for me. -Clark - Original Message From: Rich Shepard <[EMAIL PROTECTED]> To: Clark Christensen <[EMAIL PROTECTED]> Sent: Thursday, May 15, 2008 5:05:47 PM Subject: Re: [sqlite] Finding Miss

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] DBD Sqlite

2006-04-04 Thread Clark Christensen
You can get the underlying SQLite version from DBD-SQLite as $dbh->{sqlite_version}; Make sure you set $dbh->{AutoCommit=>0}. This will ensure you're always in a transaction. Without it, you're probably committing every row. From what I can tell, you can twiddle AutoCommit at any point in

Re: [sqlite] sqlite driven web-site

2006-05-05 Thread Clark Christensen
I have dynamic apps running on my company's website using Perl and SQLite. There's a very good wrapper for using SQLite with the Perl DBI. Check out http://search.cpan.org/~msergeant/DBD-SQLite-1.12 It works well for a low-volume app on a public site. I'm working on a new app (also all Perl)

Re: [sqlite] SQLITE3.exe from Windows CMD

2006-05-05 Thread Clark Christensen
SQLite itself supports reading SQL and SQLite stmt/commands from a file, so the equivalent to the piped SQL would be sqlite3 foo.db ".read bar.sql" -Clark - Original Message From: Josef Hlawatschek (JT) <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Friday, May 5, 2006 12:28:38

Re: [sqlite] sqlite driven web-site

2006-05-05 Thread Clark Christensen
L Server, but don't blame me for that). So high traffic isn't a problem with a good design. On 5-May-06, at 11:30 AM, Clark Christensen wrote: > I have dynamic apps running on my company's website using Perl and > SQLite. There's a very good wrapper for using SQL

Re: [sqlite] C++ Arrays in sqlite

2006-05-15 Thread Clark Christensen
I'm not a C++ guy, but I don't think the question and answer are specific to C++. I would use a child table. Think of the two "columns" in your example as two tables in your database. In its simplest form, it might be: create table names (id integer primary key, name); insert into names (name

Re: [sqlite] Purging the mailing list roles. Was: Please Restore Your Account Access

2006-05-31 Thread Clark Christensen
> And yet somehow, the spammer still managed to get signed up > using a "paypal.com" address. How did they do that? > -- As others have pointed-out, there's probably a simple autoresponder on many [EMAIL PROTECTED] mailboxes. It replied, and that was good enough :-) I think if the list confirm

Re: [sqlite] ALTER table command

2006-06-19 Thread Clark Christensen
Assuming a schema like: create table t1 (a,b); Add another column, "c" alter table t1 add column c; -Clark - Original Message From: Anish Enos Mathew <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, June 19, 2006 12:42:46 AM Subject: [sqlite] ALTER table command Hi al

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 3

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! -Clark

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 Sent: Friday, August 18, 2006 11:22:18 AM Subject: [sqlite] Re: Re: Using Wrong Date Format Clark Christensen wrote: >> update tableName set >> DOB=subst

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 the

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 migh

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 CPan

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 -- SOLVED! On Thu, 21 Sep 2006,

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 fi

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] 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 mor

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 to

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, 20

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 SQLite?

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

2006-11-15 Thread Clark Christensen
sure how that would work from VBA. Did you mean to run this with Shell or the Windows API? RBS -Original Message- From: Clark Christensen [mailto:[EMAIL PROTECTED] Sent: 15 November 2006 21:37 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Importing text file via .bat file RBS, Sorry t

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

2006-11-16 Thread Clark Christensen
November 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@sqlit

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: sqlite-us

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, Ba

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 determinatio

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 - O

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] 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] 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 String literals in SQL are s

[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 ro

  1   2   >