Home > database >  Oracle, how to use the stored procedure dynamically add columns
Oracle, how to use the stored procedure dynamically add columns

Time:09-22

Oracle, how to use the stored procedure dynamically add columns
Or do you have any other better solution, column turned to store the data volume is too big, it won't work

CodePudding user response:

Add columns: the alter table table name add column type
Modify column: the alter table table name modify (column type)
Adding constraints: the alter table table name add constraint constraint of the primary key (field) using the index;

CodePudding user response:

Is to use stored procedures dynamically add columns, you this is the foundation to add columns of statements

CodePudding user response:

Create procedure sp_add_column
As
The begin
The execute immediate 't add the alter table name varchar2 (30)';
end;

CodePudding user response:

Can try to write a trigger, add new data, then the incoming value, determine whether need to add to the column, is to use dynamic SQL, not leave