Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.
create or replace procedure SP_PARAMETER_TEST -- this is my table
(
       NAME_KEY in VARCHAR2 -- this contains a value assume NAME_KEY contains "Gypsum"
) 
is
begin
  ALTER TABLE PARAMETER_TEST ADD NAME_KEY VARCHAR(2);
end SP_PARAMETER_TEST;

I want to add the column which has text value "Gypsum". But I am getting errors. How can I do this?

share|improve this question

closed as unclear what you're asking by RolandoMySQLDBA, Paul White, Aaron Bertrand Jul 14 at 20:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

You can't embed DDL in a stored procedure like this.

Either use execute immediate and your DDL statement passed to it as a string, or, better, remove the stored procedure entirely an execute the DDL directly.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.