On 09/22/2004 09:43 PM, Ron Aaron wrote:
> In my membership database, I have a 'people' table and a 'userviews' table.
> This second table consists of a (name,sql) pair.
>
> What it does is allow my users to load a particular list of people from the
> people table. So for example, ('LA','where city like "LA"') might be the
> entry for a "view" called "LA".
>
> But now the users want to view a list of *specific* people, e.g. by people.id.
>
< skip>
>
> Because what I ultimately want to do is a statement like:
> insert into userviews values ('coolview', 'where id in (1,2,6,34)');
>
> But I don't see any way to generate this insert statement from the prior
> select. Any ideas?
Write a "flatten" aggregate function for sqlite with
sqlite3_create_function() or sqlite_create_aggregate() for sqlite3 resp.
sqlite 2.
This is what I've done for my project. The function will take a field
name and append the content of it to some string buffer. Probably
interleaving field values with "," At the end, the contents of string
buffer is the result of the function.
> Thanks!
>
>
HTH
--
Konstantin Malakhanov <[EMAIL PROTECTED]