ALTER TABLE in PL/SQL procedure [message #115774] |
Thu, 14 April 2005 06:41  |
shooter
Messages: 44 Registered: February 2005
|
Member |
|
|
I am working on Oracle 9i.
I wrote and compiled the following function:
create or replace procedure altermytable is
begin
alter table mytable disable constraint mytable_fk;
end;
Compilation returned the error PLS-00103 "Encountered the symbol ALTER when expecting one of the following..."
What is the problem?
How can I use ALTER TABLE statements in my PL/SQL procedures?
|
|
|
|
|
|
Re: ALTER TABLE in PL/SQL procedure [message #115793 is a reply to message #115791] |
Thu, 14 April 2005 08:48   |
dmitry.nikiforov
Messages: 723 Registered: March 2005
|
Senior Member |
|
|
SQL> create table z_tmp (id number(10));
Table created.
SQL> edit
Wrote file afiedt.buf
1 begin
2 execute immediate 'alter table z_tmp modify (id number(11))';
3* end;
SQL> /
PL/SQL procedure successfully completed.
SQL> desc z_tmp;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER(11)
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
PL/SQL Release 8.1.7.0.0 - Production
CORE 8.1.7.0.0 Production
TNS for Linux: Version 8.1.7.0.0 - Development
NLSRTL Version 3.4.1.0.0 - Production
As you can easily see, it works in 8i.
Rgds.
|
|
|
|