RaghavendraK 70574
<[EMAIL PROTECTED]> wrote:
we have given a web interface which receive delete request.
Now in the req we get "%" and in the delete impl we do this
delete from table where itemName like xxx.%;

since the key is % the above statement becomes,
"delete from table where itemName like %.%";And result in fatal
problem of erasing all records.

Try

delete from table
where itemName >= 'xxx.' and itemName < 'xxx/';

(a slash '/' character happens to come after period '.' in ASCII). Or

delete from table
where substr(itemName, 1, length('xxx.')) = 'xxx.';

The first query would run much faster than the second if you have an index on itemName.

Igor Tandetnik

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

Reply via email to