Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2014

    Post Unanswered: How to create view in if statement in oracle

    When No Data Found

    if (condition)

    create view a as select * from abc;



    end if;

    Error show at line create view .This code present in one exception block procedure.

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 4
    This sounds as a very wrong approach to any problem you might have.

    I can't imagine scenario which includes creating a view if an exception is raised. By the way, even if you do that (once), it would fail the second time (as the view would already exist).

    Anyway: dynamic SQL (EXECUTE IMMEDIATE) can be used to perform DDL from a PL/SQL procedure but - once again - this is most probably wrong.

    Which problem are you trying to solve?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts