0

oracle execute immediate command concatenation. e.g.

BEGIN EXECUTE IMMEDIATE 'DROP TABLE Foo'; END;

works.

BEGIN EXECUTE IMMEDIATE '''DROP TABLE ' || tableName || ''''; END;
BEGIN EXECUTE IMMEDIATE '''DROP TABLE ' || 'Foo'''; END;

not working.

Table name is an input parameter in stored procedure.

0

1 Answer 1

0

Your single quotes are improper.

Use following:

BEGIN EXECUTE IMMEDIATE 'DROP TABLE ' || tableName; END;
BEGIN EXECUTE IMMEDIATE 'DROP TABLE ' || 'Foo'; END;

Cheers!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.