Criação de Tabela Temporária dentro da procedure
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
Curtidas 0
Respostas
Motta
09/11/2004
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
GOSTEI 0
Adilsond
09/11/2004
[url]http://www.oracle-base.com/articles/8i/Collections8i.php[/url]
GOSTEI 0