2 Replies Latest reply: Jul 12, 2011 8:04 PM by 874803 RSS

    How can I run beginddl in PL/SQL Developer

    874803
      Here's my script:

      begin
      execute dbms_wm.beginddl('MyTable');
      ALTER TABLE MyTable ADD NewColumn1 VARCHAR2(200)
      execute dbms_wm.commitddl('MyTable');
      end;

      I got the following error:


      ORA-06550: line 2, column 11:
      PLS-00103: Encountered the symbol "DBMS_WM" when expecting one of the following:

      := . ( @ % ; immediate
      The symbol ":=" was substituted for "DBMS_WM" to continue.
      ORA-06550: line 3, column 3:
      PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:

      ( begin case declare end exception exit for goto if loop mod
      null pragma raise return select update while with
      <an identifier> <a double-quoted delimi


      What should I do then?

      Thanks.
        • 1. Re: How can I run beginddl in PL/SQL Developer
          aschilling
          in PL/SQL scripts you just omit the "execute". and for the SQL you need to put an execute before it.
          so your script would be:
          begin
            dbms_wm.beginddl('MyTable');
            execute immediate 'ALTER TABLE MyTable ADD NewColumn1 VARCHAR2(200)';
            dbms_wm.commitddl('MyTable');
          end;
          apart from that, you should be modifying MyTable_LTS in your DDL session.

          regards,

          Andreas
          • 2. Re: How can I run beginddl in PL/SQL Developer
            874803
            Great thanks, aschilling. That solves my problem.

            Something off-topic but interesting is: i've got a work fellow and today i asked him this question too. He then searched for a min and gave me a link that he thought answers my question. And that's this URL!!! LOL. What a small world! I hadn't changed my Handle so he didn't recognize this is my post.

            This might be an indicator that there're really many ppl using WM.