Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dynamice SQL in Oracle
"Maxim Demenko" <mdemenko_at_gmail.com> wrote in message
news:d633jh$jds$02$1_at_news.t-online.com...
> DA Morgan schrieb:
> > Maxim Demenko wrote:
> >
> >> As the table t was created with execute immediate, he didn't have
> >> another choice ;-)
> >>
> >> Best regards
> >>
> >> Maxim
> >
> >
> > Actually he did. Anyone creating a table using EXECUTE IMMEDIATE has
> > a choice.
> >
> > The choice to not try to kludge SQL Server habits into Oracle and
> > to do their DDL according to "best practices" using global
> > temporary tables.
> >
> > What is, in effect, being said here is: "If I do something stupid
> > it doesn't work." And on that I will agree.
>
> What you wrote is just context substitution of my posting. It is
> obvious, that there are "always" a choise between static sql and dynamic
> sql. It is obvious that static sql is mostly to prefer ( at least on
> Oracle databases). The meaning of my remark was: If you create a table
> within an plsql block by dynamic sql and you *have* to do an insert in
> *this* table in the *same* block - you have no another choice as to do
> it by dynamic sql too - as contradiction to previous posting. If my
> message was unambiguously, i'm sorry, i'll try to improve my english.
>
> Best regards
>
> Maxim
Yes, but it is a really bad idea. If you need a temp table (and usually you
don't) then use a global temporary table. See Oracle docs. Then you don't
need the dynamic SQL in pl/sql.
Jim
Received on Fri May 13 2005 - 20:38:38 CDT
![]() |
![]() |