Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Scripting Question
On 18 Nov 2003 08:49:49 -0800, dave_at_simcik.com (DTS) wrote:
>Regarding...
>
>> > -Can I embed SQL DML statements inside of PLSQL blocks?
>>
>> That is what they are there for.
>
>I meant to say DDL statements, not DML statements. Perhaps the
>question is just as trivial though. Looking forward to your response!
>Thanks for all of the other great feedback!
DDL statements use the EXECUTE IMMEDIATE statement:
EXECUTE IMMEDIATE 'string variable of DDL statement';
>> > -Is creating a subprogram in a package the same as creating a
>> > standalone subprogram? In other words, will the subprograms I code in
>> > the package show up as independent objects in the schema?
The package is considered a single schema object. In the same way you can DESCRIBE a single procedure in SQL*Plus, you can DESCRIBE a package and see all the procedures and functions in it.
One nice thing about packages is that once the package spec is compiled, you can compile other things that call the package procedures and functions, even though they aren't "filled in" yet. So procedures and functions inside a package can call back and forth to each other freely, and you don't have to worry about compiling them in any particular order, as you do with standalone procedures and functions.
John
-- Photo gallery: http://www.pbase.com/john_russell/Received on Wed Nov 19 2003 - 01:39:04 CST