can oracle inline views be used across java statements instead of creating temporary table
i have a java program executing 3 separate sqls with a same inline view - it takes about 20 minutes each time to build the inline view when the sqls are executed - is there a way to cache or reuse it ? - trying to avoid temporary table solution because it needs to be delegated to a plsql since the java program does not have rights to create schema objects. ps: 开发者_StackOverfloworacle 10g
Oracle will do its best to cache the result if you let it. But you can still have a temp table if you really want to, and it is fairly small. If you use a package you can create the temp table the first time it is called and use the cached data the other 2 times -- try out the package variables and see if that does what you want.
Oracle temp tables should not be created on the fly. Docs here. If you use a temporary table for this create it once and just use it in the procedure.
Another option may be a materialized view. Docs here. The materialized view would be either refreshed on demand or on a schedule.
With the information given it is not possible to tell you which would fit your situation better.
精彩评论