4 Replies Latest reply: Nov 10, 2010 10:46 PM by 707781 RSS

    sql*plus missing parenthesis

    707781
      hi, experts,

      I use sqlplus to run this command.


      CALL dbms_stats.gather_table_stats(ownname => 'XXXX',tabname => 'XXX_TBL',estimate_percent => dbms_stats.auto_sample_size,cascade => TRUE,degree => dbms_stats.default_degree,method_opt => 'FOR ALL COLUMNS SIZE SKEWONLY')

      the sql*plus version is 9.2.0.1.0
      the database version is 9.2.0.7.0

      is my syntax correct?
      but it returns this error.



      ERROR at line 1:
      ORA-00907: missing right parenthesis


      is the syntax not allowed in sql*plus?
        • 1. Re: sql*plus missing parenthesis
          Frank Kulash
          Hi,

          That works fine for me (in Oracle 10.1.0.2.0, with SQL*Plus 10.1.0.2.0).

          Is the command all on one line? Make sure it is.

          Is the command you posted given at the SQL> prompt, or is it part of some PL/SQL code? (Don't say CALL inside PL/SQL.)

          Can you call the procedure with fewer arguments, say, just the owner and table name? If so, add the other arguments back, on at a time. Which argument causes it to fail?
          • 2. Re: sql*plus missing parenthesis
            707781
            Dear Frank Kulash,

            I run this at the SQL> prompt AND on one line

            do you mean this is not allowed to use call directly in SQL*PLUS?
            thank you very much!
            • 3. Re: sql*plus missing parenthesis
              Frank Kulash
              Hi,
              Forreging wrote:
              Dear Frank Kulash,

              I run this at the SQL> prompt AND on one line

              do you mean this is not allowed to use call directly in SQL*PLUS?
              No, it's fine in SQL*Plus. I was just saying it won't work in PL/SQL.
              Another way to call it from SQL*Plus is to say EXEC instead of CALL:
              SQL> EXEC dbms_stats.gather_table_stats(ownname => 'XXXX',tabname => 'XXX_TBL');
              What happens when you call it with just 2 arguments?
              • 4. Re: sql*plus missing parenthesis
                707781
                Dear Frank Kulash ,

                finally , I know this is due to syntax error
                thank you very much!