Subject Re: effect of CREATE VIEW not visible to transaction?
Author mikcaau
--- In firebird-support@yahoogroups.com, "unordained"
<unordained_00@c...> wrote:
> I'm not going nuts, right?
>
> If a transaction creates a view, it can't see the view (can't drop
it, either)? But if it commits,
> then that view is visible to new transactions, and if it rolls back,
the view (that it can't see)
> is dropped?
>
> I have a use for temporary views (creating uniquely-named views on
the fly that need to be visible
> within the transaction, but will ultimately be dropped by the end of
the transaction) ... I wasn't
> planning on having to commit after every CREATE VIEW to make this
work. (I -can-, but it feels
> rather unsafe.)
>
> -Philip
Creating a View is a Data Definition task.
Selecting data is a Data Manipulation task.
They cannot be mixed in the same transaction.

Changing db Meta data whilst other users are connected is fraught with
danger, there are two ways to learn this either listen to me or do as
I did.

A view is at heart a select without a where clause (also no triggers...).
You can make a select in your client that acts like a view with the
added advantage that you can constrain (add a where clause) your
result set.

I doubt that anything else is needed.

Mick