Re: [sqlite] REPLACE INTO not increase field value?

2008-03-13 Thread Dennis Cote
zaher dirkey wrote: > Thank for replay, i will use it, but that make the sql slow. > Yes, it is slower than the insert that didn't work correctly. :-) To ensure optimal speed you should have an index for the subselect to use during its search. If the table has a primary key , that would be the

Re: [sqlite] REPLACE INTO not increase field value?

2008-03-13 Thread zaher dirkey
Thank for replay, i will use it, but that make the sql slow. may be SQLite team care about it in next release. On Thu, Mar 13, 2008 at 4:59 PM, Dennis Cote <[EMAIL PROTECTED]> wrote: > zaher dirkey wrote: > > REPLACE INTO States > > (Material, Name, Qnt) > > values (1, 'MyName', Qnt + 1) > > > >

Re: [sqlite] REPLACE INTO not increase field value?

2008-03-13 Thread Dennis Cote
zaher dirkey wrote: > REPLACE INTO States > (Material, Name, Qnt) > values (1, 'MyName', Qnt + 1) > > I want to increase value of Qnt if the record already exist and insert it > with 1 value if not exist, the default value for Qnt is 1 and it is NOT NULL > The default value is only used if you d

[sqlite] REPLACE INTO not increase field value?

2008-03-12 Thread zaher dirkey
REPLACE INTO States (Material, Name, Qnt) values (1, 'MyName', Qnt + 1) I want to increase value of Qnt if the record already exist and insert it with 1 value if not exist, the default value for Qnt is 1 and it is NOT NULL But the record done with these values (1, 'MyName, 1) Thanks in Advance -