Re: [sqlite] INSERT OR Replace Help

2010-03-25 Thread jose isaias cabrera
"P Kishor" wrote... > In any case, for OP's purpose, and esp. since he seems to be inserting > numbers as strings, as implied by the quoted numbers, he might benefit > from > > CREATE TABLE test ( > t1 TEXT, > t2 TEXT, > t3 TEXT, > t4 TEXT, > PRIMARY KEY(t1, t2) > ); > > I don't know if

Re: [sqlite] INSERT OR Replace Help

2010-03-25 Thread Igor Tandetnik
P Kishor wrote: > With regards to having a PK on a column with no affinity, I guess > things will just default to strings, no? No. Just as with any other column with no affinity, no conversions will take place. Thus, 1 and '1' will be considered distinct, and 20 will sort

Re: [sqlite] INSERT OR Replace Help

2010-03-25 Thread P Kishor
On Thu, Mar 25, 2010 at 5:06 PM, Igor Tandetnik wrote: > P Kishor wrote: >> On Thu, Mar 25, 2010 at 4:44 PM, jose isaias cabrera >> wrote: >>> Create table test (t1 primary key, t2 secundary key, t3, t4); >> >> >> I am pretty

Re: [sqlite] INSERT OR Replace Help

2010-03-25 Thread Igor Tandetnik
P Kishor wrote: > On Thu, Mar 25, 2010 at 4:44 PM, jose isaias cabrera > wrote: >> Create table test (t1 primary key, t2 secundary key, t3, t4); > > > I am pretty certain that SQLite has no idea what 't1 primary key' > means. No, it's perfectly OK.

Re: [sqlite] INSERT OR Replace Help

2010-03-25 Thread P Kishor
On Thu, Mar 25, 2010 at 4:44 PM, jose isaias cabrera wrote: > Create table test (t1 primary key, t2 secundary key, t3, t4); I am pretty certain that SQLite has no idea what 't1 primary key' means. Perhaps you meant to say 't1 integer primary key'? I am completely certain

[sqlite] INSERT OR Replace Help

2010-03-25 Thread jose isaias cabrera
the following is sqlite> Create table test (t1 primary key, t2 secundary key, t3, t4); sqlite> INSERT or REPLACE into test values ('1','2','3','4'); sqlite> select * from test; 1|2|3|4 sqlite> INSERT or REPLACE into test values ('1','2','3','5'); sqlite> select * from test; 1|2|3|5 sqlite>