[sqlite] need a CURRENT_USER() function

2009-01-15 Thread Hoover, Jeffrey
Can anyone tell me set-by-step how to add a CURRENT_USER() function to SQLLITE that will return the current linux login? I'm not a C programmer and I have JUST picked up SQLite. I am trying to convert a Sybase schema to SQLite. The schema has triggers triggers but so far they convert in a

Re: [sqlite] 'UPDATE shop_orders SET comments=comments||? WHERE oid=?', ('test', '1')

2009-01-20 Thread Hoover, Jeffrey
if comments is null then comments||? is also null, try this: comments=coalesce(comments,'')||? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gert Cuykens Sent: Sunday, January 18, 2009 10:15 AM To: sqlite-users@sqlite.org

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
You are comparing the values as strings. Instead, format your dates as -MM-DD and use the date function to convert strings to dates for comparison: select date from envelope where date > date('2009-01-20') limit 3; here are some examples: sqlite> select date('2009-07-01')

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
ice if it understood some other formats, too, such as 02-JAN-09 or 11/17/2004... -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Hoover, Jeffrey Sent: Wednesday, January 21, 2009 10:35 AM To: General Discussion of SQLite Database Subject:

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Wednesday, January 21, 2009 10:57 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date datatype Hoover, Jeffrey <jhoo...@jcvi.org> wrote: > You are comparing the values as strings. > > Instead, format your dates as -MM-DD and use th

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
that's what date masks are for.. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Wednesday, January 21, 2009 10:56 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date datatype Hoover, Jeffrey <j

Re: [sqlite] Little SQL help please..

2009-02-17 Thread Hoover, Jeffrey
Use the min function (since they are all have the same value) -Jeff -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of johnny depp (really!) Sent: Tuesday, February 17, 2009 3:44 AM To: sqlite-users@sqlite.org Subject: [sqlite]

Re: [sqlite] Using result of subquery both as value and conditional test...

2009-02-24 Thread Hoover, Jeffrey
use the coalesce function coalesce(xxx,'A') returns 'A' if xxx is null, otherwise returns the value of xxx (but remember that '' is NOT null in SQLite). coalesce((select y_value from y where y_id = x_id),'darn') replaces your case statement -Original Message- From:

Re: [sqlite] Newbie question

2009-03-18 Thread Hoover, Jeffrey
Assumming this is only one row in tbl2 where name='Joe'... this should work: SELECT * FROM tbl1 WHERE description='someval' AND foreign_key_id=(select id from tbl2 where name='Joe'); this is better: select tbl1.* from tbl1, tbl2 where tbl1.description='someval' AND tbl2.name='Joe' and

Re: [sqlite] Newbie question

2009-03-18 Thread Hoover, Jeffrey
I think its because sqlite (and most rdbms's) expect literal strings to be enclose in ' not ". I think sybase is an except, accepting either. In SQLite you use " to enclose table/column names that contain non0standard characters or where object id is case sensitive, such as select "grant#" from

Re: [sqlite] Newbie question

2009-03-19 Thread Hoover, Jeffrey
] On Behalf Of Dermot Sent: Wednesday, March 18, 2009 12:05 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Newbie question 2009/3/18 Hoover, Jeffrey <jhoo...@jcvi.org>: > > Assumming  this is only one row in tbl2 where name='Joe'... > > this should work: &g

Re: [sqlite] What am I doing wrong ?

2009-03-19 Thread Hoover, Jeffrey
is autocommit on? try adding a manual commit. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Olivier FAURAX Sent: Thursday, March 19, 2009 10:56 AM To: General Discussion of SQLite Database Subject: [sqlite] What am I doing

Re: [sqlite] Database inserts gradually slowing down

2009-06-16 Thread Hoover, Jeffrey
Wouldn't a period VACUUMing of the database alleviate fragmentation? - Jeff -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Konrad J Hambrick Sent: Tuesday, June 16, 2009 1:43 PM To: General Discussion of SQLite Database

Re: [sqlite] Database inserts gradually slowing down

2009-06-16 Thread Hoover, Jeffrey
to run before a backup or something, if your application would be prone to this sort of fragmentation. Wes On Tue, Jun 16, 2009 at 1:44 PM, Hoover, Jeffrey<jhoo...@jcvi.org> wrote: > Wouldn't a period VACUUMing of the database alleviate fragmentation? &

Re: [sqlite] Repost: Accessing a DB while copying it causes Windows toeat virtual memory

2009-07-07 Thread Hoover, Jeffrey
Maybe if you write-protected the file before starting the copy... My guess is that the process that connects to do the query opens the file in read/write mode causing the operating system to think someone is trying to write to the file. So the OS tries to keep a copy of the data being read by

Re: [sqlite] Repost: Accessing a DB while copying it causes Windowsto eat virtual memory

2009-07-08 Thread Hoover, Jeffrey
Why not just make the file read-only before copying it, then restoring write-access when the copy finishes? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Stan Bielski Sent: Tuesday, July 07, 2009 6:39 PM To: General

Re: [sqlite] Insert multiple entries in a single INSERT statement

2009-07-28 Thread Hoover, Jeffrey
if your are using Perl you can "bulk insert" the data... . . . use DBI; our $errorMessage; . . . my @mydata = (); { my @myrow = (1,1); push @mydata, \...@myrow; } { my @myrow = (2,2); push @mydata, \...@myrow; } {

Re: [sqlite] Insert multiple entries in a single INSERT statement

2009-07-28 Thread Hoover, Jeffrey
(apologies, I had a typo in my code sample, here is a correction) if your are using Perl you can "bulk insert" the data... . . . use DBI; our $errorMessage; . . . my @mydata = (); { my @myrow = (1,1); push @mydata, \...@myrow; } {

Re: [sqlite] MySQL makes me wish for SQLite

2009-09-11 Thread Hoover, Jeffrey
I saw something about an ODBC module for SQLite. Could you workaround the PHP-SQLite issues via ODBC? -Jeff -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Fred Williams Sent: Friday, September 11, 2009 4:24 PM To: General

Re: [sqlite] cannot add data to sql tables

2009-09-22 Thread Hoover, Jeffrey
Could you be omitting the database commit? Try adding an explicit commit after your inserts. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kavita Raghunathan Sent: Tuesday, September 22, 2009 5:59 PM To: sqlite-users

Re: [sqlite] how to represent a tree in SQL

2009-10-14 Thread Hoover, Jeffrey
Isn't most of the complexity in the software? Representing a tree is fairly simple, it just requires a foreign key in the table referencing the primary key of the same table... Create table tree_node ( node_id integer primary key, distance_from_root integer not null,-- 0

[sqlite] import failing

2013-10-02 Thread Hoover, Jeffrey
I am trying to import a tab delimited file into a table containing 21 columns. It fails on this record Sapurv10037426m 176 RPS-BLAST(BLASTP) cdd gnl|CDD|239293 72 159 1 89 33.756.5174 70.792 cd02995, PDI_a_PDI_a'_C, PDIa family,