Re: [sqlite] problem in deleting

2006-10-12 Thread Mario Frasca

Narendran wrote:


I like to say it properly,
i am deleting ,it does delete. but i am trying to delete again, no error
code is returned,
 


there is no error...

"""delete from hai  where ;"""
means:
delete all records from table hai for which the test  is true.

doing the same delete a second time means:
delete nothing.

which causes no error.

also, if I was you I would avoid using a name like 'key' (a reserved 
word for other database systems -not sure what the standard says-) as an 
identifier.  people more familiar with sqlite will tell you if it is a 
good idea to have a translation table with a key with type name 'text'.  
I would use 'integer'.


hth,
Mario

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] problem in deleting

2006-10-12 Thread Markus Hoenicka
Narendran <[EMAIL PROTECTED]> was heard to say:

>  i am deleting ,it does delete. but i am trying to delete again, no error
> code is returned,

See http://www.sqlite.org/lang_delete.html:

"If a WHERE clause is supplied, then only those rows that match the expression
are removed."

If no rows match the where clause, no rows will be deleted. This is not an error
but the expected behaviour.

regards,
Markus


-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] problem in deleting

2006-10-12 Thread Narendran

 
hi ,

 I like to say it properly,
 i am deleting ,it does delete. but i am trying to delete again, no error
code is returned,

Narendran

-- 
View this message in context: 
http://www.nabble.com/problem-in-deleting-tf2428522.html#a6771299
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] problem in deleting

2006-10-12 Thread Narendran

hi ,
  i got a confusion in deleting a entry,
sqlite> create table hai (key text primary key,value text) ;
sqlite> create table hai (key text primary key,value text) ;
SQL error: table hai already exists
sqlite> insert into hai (key,value) values ('hai1','value1');
sqlite> insert into hai (key,value) values ('hai1','value1');
SQL error: column key is not unique
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> insert into hai (key,value) values ('hai1','value1');
sqlite> insert into hai (key,value) values ('hai1','value1');
SQL error: column key is not unique
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = hai1;
SQL error: no such column: hai1
sqlite> delete from hai  where key = hai1;
SQL error: no such column: hai1
sqlite> delete from hai  where key = hai1;
SQL error: no such column: hai1
sqlite> delete from hai  where key = 'hai1';
sqlite> delete from hai  where key = 'hai1';
sqlite>


i think ,it should delete the record,it doesn't delete,with api's or thro
shell.

please do tell me what am i doing wrong

Thanks & Regards
Narendran B
-- 
View this message in context: 
http://www.nabble.com/problem-in-deleting-tf2428522.html#a6771178
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-