Toad World® Forums

Create View from an other model

Hello everyone,

I m trying to create a view from an other model than the one i m working on, when selecting: ADD VIEW SOURCE, we only get the existing tables on that same model, how can i load a custom model opened in Toad as well,

Thank you

Hi,

from where did you choose ADD VIEW SOURCE, please?

In Toad Data Modeler - if you “model” views visually, you can pick only tables that exist in the same model. In case you define view via SQL code, write whatever you want into the code ( but visual linking to other model objects is not supported).

Regards,

Vaclav

yes that s what i was trying to do, visually. but how can i execute that sql script?? i couldn t find a sql editor

Hello there,

Use the SQL tab in View Properties to write a SQL CREATE VIEW statement that refers to the entities in your other model. Make sure to check the Generate SQL Only option in General tab to assure the generation of SQL tab contents only.

Another way is to check the SELECT in Views as Text option (also General tab) and write only the SELECT statement in the SQL tab (e.g. AS SELECT FROM SOME_ENTITY...). This will save you some effort since you won't have to write the CREATE VIEW viewname part.

Then, generate the DDL script as usual and execute it in your database.

Regards,

Lukas