If each pid sees a completely separate set of rows then add the pid to each row 
and select by pid.



If 2 pid's can see any of the same records this won't work (i.e. all pid's must 
be mutually exclusive)



No views necessary but you could create a view for each pid if you wanted to 
for some reason (if it made coding simpler but I doubt it).



Adding pid also allows you to clean up the table by deleting all records where 
you don't have an active pid.







Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate



________________________________
From: [email protected] [[email protected]] on 
behalf of san long [[email protected]]
Sent: Friday, July 15, 2011 11:01 PM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Hidding records from the application

sqlite3 support a trigger on SELECT ? View is a good solution, but I
want to let different process see different records, like:
pid A sees rowid 1,2
pid B sees rowid 1,3


2011/7/16, san long <[email protected]>:
> haha, if I CREATE VIEW in process A and DROP VIEW when A dies. Process
> B could see this VIEW or not?
> A and B run at the same thime.
>
> 2011/7/16, Simon Slavin <[email protected]>:
>>
>> On 16 Jul 2011, at 4:23am, san long wrote:
>>
>>> Thanks for advice, delete or update the record in a view could affect
>>> the
>>> true table in sqlite now?
>>
>> No.  Either use the VIEW for SELECT and the TABLE for changes, or
>> implement
>> triggers so attempts to change your VIEW actually change the underlying
>> TABLE.
>>
>>> And, if I create a view dynamically using sqlite3_exec, is it visible to
>>> other process who opens the same database?
>>
>> Yes.  A VIEW is a stored SELECT statement (or it has a similar effect).
>>
>>
>> On 16 Jul 2011, at 4:25am, san long wrote:
>>
>>> right, but now I just want to hide these records to all processes.
>>
>> Then DELETE them !
>>
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to