plsql - PL/SQL CREATE OR REPLACE PROCEDURE Using CREATE TABLE Statement -


I am currently busy with some serious PL / SQL programming. Format for creating process

  [create [or change]] process process_name [[parameter [, parameter] ...)] [AUTHID {DEFINER | CURRENT_USER}] {IS | AS} [Predma Atonomos_TRACection;] [Local announcements] BEGIN Executable Statement [EXCEPTION Exception Handlers] End [Name];  

and I place under the executable statement BEGIN . Why is not I allowed to keep the CREATE TABLE statement as an executable statement in a process?

Because create table is a DDL statement, and you can use PD / SCL DDL can not execute the details from at least not directly).

If (and this is one, you really need to do this, then you can either use the DBMS_SQL package or execute immediately (Easy):

  to create or replace the practicable do_it, such as immediately execute 'CREATE TABLE foo (pk number not null)'; end;  
< P> But it is not generally necessary that people coming from the SQL Server background often have too many floats with their stored procedures Are trained to make the tables - Oracle, you generally use a global temporary table for it.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -