On 27/12/2012, at 11:49 PM, Alem Biscan <biscana...@gmail.com> wrote:

> So user decides to modify a record. He changes *primary, field2,
> field3*values trough textboxes, and the app sends parametarised update
> query to
> sqlite engine.
> 
> UPDATE MYVIEW
>     SET *primary = @a*,
>            *field2    = @b*.
>            *field3    = @c*;

You seem to be building a user interface for data entry into SQLite tables and 
views. Whether your app (or web page) is entering data into a table or a view, 
you still need to uniquely identify the edited row to SQLite. In other word, 
you need to include a "where" clause in your update statement. So you should be 
passing on a statement like this:

update MyView
set     primary = @userEnteredNewPrimaryValue
,       field2 = @userEnteredNewField2Value
,       field3 = @userEnteredNewField3Value
where primary = @originalPrimaryValue

This applies whether you're entering into a table or a view.

Tom

Tom Brodhurst-Hill
BareFeetWare

--
iPhone/iPad/iPod and Mac software development, specialising in databases
develo...@barefeetware.com
--
Follow us on Twitter: http://twitter.com/barefeetware/
Like us on Facebook: http://www.facebook.com/BareFeetWare

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to