Criação de Tabela Temporária dentro da procedure
09/11/2004
0
Gostaria de saber se algúem já criou uma tabela temporario dentro de uma procedure ? como faço isso no Oracle? a partir de qual versão posso fazer isso ?
Icefox
Curtir tópico
+ 0
Responder
Posts
10/11/2004
Motta
Para criar tabela vc deve executar um comando de ddl.
Para executar um comando ddl use o
execute_immediate (...)
exemplo
Can one call DDL statements from PL/SQL?
One can call DDL statements like CREATE, DROP, TRUNCATE, etc. from PL/SQL by using the ´EXECUTE IMMEDATE´ statement. Users running Oracle versions below 8i can look at the DBMS_SQL package (see FAQ about Dynamic SQL).
begin
EXECUTE IMMEDIATE ´CREATE TABLE X(A DATE)´;
end;
NOTE: The DDL statement in quotes should not be terminated with a semicolon.
Back to top of file
fonte http://www.orafaq.com/faqplsql.htm
Para executar um comando ddl use o
execute_immediate (...)
exemplo
Can one call DDL statements from PL/SQL?
One can call DDL statements like CREATE, DROP, TRUNCATE, etc. from PL/SQL by using the ´EXECUTE IMMEDATE´ statement. Users running Oracle versions below 8i can look at the DBMS_SQL package (see FAQ about Dynamic SQL).
begin
EXECUTE IMMEDIATE ´CREATE TABLE X(A DATE)´;
end;
NOTE: The DDL statement in quotes should not be terminated with a semicolon.
Back to top of file
fonte http://www.orafaq.com/faqplsql.htm
Responder
11/11/2004
Adilsond
[url]http://www.oracle-base.com/articles/8i/Collections8i.php[/url]
Responder
Clique aqui para fazer login e interagir na Comunidade :)