Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PROMPT in SQL PLUS within Begin End Block

user8941550Nov 30 2012 — edited Nov 30 2012
Hi,

We have the following sql script:


PROMPT Starting The script
DECLARE
v_counter INT;
BEGIN
SELECT COUNT (*)
INTO v_counter
FROM user_tables
WHERE table_name = UPPER ('TableName');

IF v_counter > 0
THEN
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE
Table_Name1
RENAME TO Table_Name2';

-- I WANT TO PLACE A PROMPT HERE THAT ALTERED THE ABOVE TABLES. Like I did at the begining of the code

EXECUTE IMMEDIATE
'ALTER TABLE Table_Name2 RENAME CONSTRAINT PK_Cns TO
PK_Cons_New';

EXECUTE IMMEDIATE
'ALTER INDEX Ind_Index1 RENAME TO Ind_Index2';
END;
END IF;
END;


How do I add some Prompt to be displayed in SQL PLUS in the commented section in this code..

Please suggest..
This post has been answered by BluShadow on Nov 30 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 28 2012
Added on Nov 30 2012
3 comments
3,360 views