On 3/31/2011 10:12 PM, RAKESH HEMRAJANI wrote:
> 1) how to make a table read only, such that any user can only insert but 
> can't update (table schema) or drop the table
>
>       alter table / drop table arent allowed on sqlite_master, need similar 
> restrictions on my custom table.
>
>       by setting the tabFlags to TF_Readonly, i m able to prevent the user 
> from dropping the table but
>       alter table is still allowed (can add or drop columns)

SQLite doesn't support dropping columns, on read-only tables or otherwise.

> 2) How to apply constraints similar to given below as part of create table 
> statement, if not possible can it be done after create statement?
>
>      table sales(cost price, sale price)
>       i need a constraint cost price<  sale price so that i dont have to do 
> code level checks during insert statements

create table sales("cost price", "sale price", check("cost price" < 
"sale price"));
-- 
Igor Tandetnik

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

Reply via email to