Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: execute immediate
In article <a1ffov$ejl11_at_kcweb01.netnews.att.com>, "S.A." says...
>
>Is it possible to execute two statements in one call to execute immediate?
>
using a SCHEMA statement, yes.
tkyte_at_TKYTE816> begin
2 execute immediate 'create schema authorization ' || user || ' 3 create view v as select * from t 4 grant select on v to connect';5 end;
PL/SQL procedure successfully completed.
>for example;
>declare
>string_to_execute long;
>begin
>string_to_execute := 'create view test_view on test_table
>/
>grant select on test_view to power_users'
>
>execute immediate string_to_execute;
>end;
>/
>
>thanks for any help.
>My environment: 8.1.7 enterprise edition on sun solaris.
>
>
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Tue Jan 08 2002 - 18:13:37 CST
![]() |
![]() |