DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: create function based index failes

  1. #1
    Join Date
    Oct 2001
    Location
    Berlin, Germany
    Posts
    97

    create function based index failes

    Hello,

    why does the following statement fail, when I use execute immediate. The statement itself works propperly.

    Code:
    Error starting at line 1 in command:
    DECLARE error Number; BEGIN execute immediate '
      CREATE INDEX CSOSAP.IDX_ESCAL_BEGDAT ON CSOSAP.ESCAL (TO_CHAR(BEGDAT,'YYYYMMDD')) 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS COMPRESS 1 NOLOGGING 
      STORAGE(INITIAL 81920 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE CSOSAPIDX 
      PARALLEL '; END;
    Error report:
    ORA-06550: Zeile 2, Spalte 73:
    PLS-00103: Fand das Symbol "YYYYMMDD" als eines der folgenden erwartet wurde:
    
       * & = - + ; < / > at in is mod remainder not rem return
       returning  <> or != or ~= >= <= <> and or
       like like2 like4 likec between into using || multiset bulk
       member submultiset
    Das Symbol "* wurde vor "YYYYMMDD" eingefügt, um fortzufahren.
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Oracle: 11.2.0.2
    Windows Server 2003 R2

  2. #2
    Join Date
    Oct 2001
    Location
    Berlin, Germany
    Posts
    97
    When I "execute immediate" it is necessary to use a double quoted string for the date

    Code:
    ''YYYYMMDD''

Posting Permissions

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


Click Here to Expand Forum to Full Width