Andreas <mcbokassa-gM/[EMAIL PROTECTED]> wrote:
I'm trying to let a Trigger create a View. The first Trigger
('resetSyncMarker') cares for unique-keying in the config-table. The
second Trigger('makeView') shall create a View on insert into the
config-table. The View's name shall be the content of the inserted
shortName-field.

There is no syntax in SQLite to create a view (or anything else) with name generated at runtime from field values. A view name is a plain identifier hardcoded into the statement - it is not evaluated as an expression.

What you can try is call a custom function from the trigger (see sqlite3_create_function), which function can then create a view. The function can use string manipulation to generate an appropriate SQL statement from the values of its parameters.

I wonder - do you have any plans to eventually drop some of these views? Or are you just going to keep creating them, exploding the size of the database schema? In fact, why on earth do you need so many views in the first place?

Igor Tandetnik

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

Reply via email to