ORA-00905 in Create Table

Hello

I create 2 APEX table with foreign key; the first table is OK, but in the second table, I get an error "ora-00905 keyword missing."

This is the statement:

"

-- -----------------------------------------------------

-Table "PATRIMONIO." 'SCHEDA_ANAGRAFICA '.

-- -----------------------------------------------------

CREATE TABLE SCHEDA_ANAGRAFICA (

  ID_SCHEDA VARCHAR (20) NOT NULL ,

  MUNICIPIO VARCHAR (45) NULL ,

  ADDRESS VARCHAR (45) NULL ,

DIP_CONSEGANTARIO VARCHAR()45() NULL

  DETAILS VARCHAR (45) NULL ,

  TIPOLOGIA VARCHAR (45) NULL ,

DESCR_IMMOBILE VARCHAR()90) NULL

  PRIMARY KEY (ID_SCHEDA) );

-- -----------------------------------------------------

-Table "PATRIMONIO." 'SCHEDA_AMMINISTRATIVA '.

-- -----------------------------------------------------

CREATE TABLE SCHEDA_AMMINISTRATIVA (

  ID_SCHEDA VARCHAR (20) NOT NULL ,

DESCR_TRASFERIMENTO VARCHAR()45() NOT NULL

NOTA_TRASCRIZIONE VARCHAR()45() NULL

  ASSEGNAZIONE VARCHAR (45) NULL ,

  VERB_CONSEGNA VARCHAR (45) NULL ,

  CONCESSIONE VARCHAR (45) NULL ,

  NOTE                VARCHAR (45) NULL ,

PRIMARY KEY ( )ID_SCHEDA DESCR_TRASFERIMENTO)

Fk_AMMINISTRATIVA_ANAGRAFICA of the CONSTRAINT

    FOREIGN KEY (ID_SCHEDA)

REFERENCES SCHEDA_ANAGRAFICA ()ID_SCHEDA( )

WE REMOVE ANY ACTION

    ON UPDATE NO ACTION );

"

I don't understand the cause.

Can you help me?

Thank you

5fd006d0-5573-4a0f-821a-63f2bd8083fd wrote:

Please update your forum profile with a real handle instead of '5fd006d0-5573-4a0f-821a-63f2bd8083fd '.

I create 2 APEX table with foreign key; the first table is OK, but in the second table, I get an error "ora-00905 keyword missing."

You create tables in the Oracle RDBMS, not by their SUMMIT. APEX is a development tool, not a database.

This is the statement:

"

-- -----------------------------------------------------

-Table "PATRIMONIO." 'SCHEDA_ANAGRAFICA '.

-- -----------------------------------------------------

CREATE TABLE SCHEDA_ANAGRAFICA)

ID_SCHEDA VARCHAR (20) NOT NULL,

NULL IN MUNICIPIO OF VARCHAR (45).

ADDRESS VARCHAR (45) NULL,

DIP_CONSEGANTARIO VARCHAR (45) NULL,

DETAILS VARCHAR (45) NULL,

TIPOLOGIA VARCHAR (45) NULL,

DESCR_IMMOBILE VARCHAR (90) NULL,

PRIMARY KEY (ID_SCHEDA));

-- -----------------------------------------------------

-Table "PATRIMONIO." 'SCHEDA_AMMINISTRATIVA '.

-- -----------------------------------------------------

CREATE TABLE SCHEDA_AMMINISTRATIVA)

ID_SCHEDA VARCHAR (20) NOT NULL,

DESCR_TRASFERIMENTO VARCHAR (45) NOT NULL,

NOTA_TRASCRIZIONE VARCHAR (45) NULL,

ASSEGNAZIONE VARCHAR (45) NULL,

VERB_CONSEGNA VARCHAR (45) NULL,

CONCESSIONE VARCHAR (45) NULL,

NOTE VARCHAR (45) NULL,

PRIMARY KEY (ID_SCHEDA, DESCR_TRASFERIMENTO).

CONSTRAINT fk_AMMINISTRATIVA_ANAGRAFICA

FOREIGN KEY (ID_SCHEDA)

REFERENCES SCHEDA_ANAGRAFICA (ID_SCHEDA)

ON DELETE NO ACTION

UPDATE NO ACTION);

"

I don't understand the cause.

Ni NO ACTION or ON UPDATE are valid in a REFERENCES clause in Oracle. If you want to default to make referential integrity checks can remove these clauses. The only other options are ON DELETE CASCADE/SET NULL.

Tags: Database

Similar Questions

  • ORA-01031 error creating table

    I use DB 11g on Wn 2008 Server 64 bit. I run the following creation script:

    CREATE THE TABLE SUPPCHAIN. COUNTRIES (COUNTRY_ID, REGION_ID NUMBER NOT NULL, C
    COUNTRY VARCHAR2 (32) NOT NULL, CODE CHAR (2) NOT NULL, NUMBER OF THE POPULATION, THE AREA N
    UMBER, FXCODE CHAR (3), VARCHAR2 (32) OF CURRENCY, RATES FLOAT (126), PRIMARY KEY (COUN
    TRY_ID) VALIDATE, VALIDATE UNIQUE (COUNTRY), INVALID (CODE) UNIQUE, FOREIGN
    KEY (REGION_ID) REFERS TO SUPERAD. REGION (REGION_ID) VALIDATE)

    Get the following error

    ERROR on line 1:
    ORA-01031: insufficient privileges

    I know it has to do with foreign key references, but I do not know what privileges to set to allow the above run correctly.

    I put CREATE TABLE privileges for user SUPPCHAIN. User SUPERAD also has these privileges and the SYSDBA. So what other privileges should I create?


    Thanks, J

    Jay wrote:
    I use DB 11g on Wn 2008 Server 64 bit. I run the following creation script:

    CREATE THE TABLE SUPPCHAIN. COUNTRIES (COUNTRY_ID, REGION_ID NUMBER NOT NULL, C
    COUNTRY VARCHAR2 (32) NOT NULL, CODE CHAR (2) NOT NULL, NUMBER OF THE POPULATION, THE AREA N
    UMBER, FXCODE CHAR (3), VARCHAR2 (32) OF CURRENCY, RATES FLOAT (126), PRIMARY KEY (COUN
    TRY_ID) VALIDATE, VALIDATE UNIQUE (COUNTRY), INVALID (CODE) UNIQUE, FOREIGN
    KEY (REGION_ID) REFERS TO SUPERAD. REGION (REGION_ID) VALIDATE)

    Get the following error

    ERROR on line 1:
    ORA-01031: insufficient privileges

    I know it has to do with foreign key references, but I do not know what privileges to set to allow the above run correctly.

    I put CREATE TABLE privileges for user SUPPCHAIN. User SUPERAD also has these privileges and the SYSDBA. So what other privileges should I create?

    Thanks, J

    GRANT REFERENCES ON SUPERAD. SUPPCHAIN REGION;

  • ORA-00904 on CREATE TABLE with a virtual column based on the XMLTYPE content

    Hello

    This is another one for the gurus of the syntax...

    Try the following, fails with ORA-00904: "MESSAGE". "' GETROOTELEMENT": invalid identifier
    CREATE TABLE XML_TEST_VIRT
      (
       MSG_TYPE         GENERATED ALWAYS AS (MESSAGE.GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
      )
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /
    While it succeeds
    CREATE TABLE XML_TEST_VIRT
      (
       MSG_TYPE         GENERATED ALWAYS AS (EXTRACT(MESSAGE, '/*').GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
      )
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /
    The GETROOTELEMENT from SYS member function. XMLTYPE is stated as "PARALLEL_ENABLE DETERMINISTIC" the method called is not the problem, as evidenced by the 2nd case.
    Using the MESSAGE column that is of type XMLTYPE directly seems to be the problem. But the question is "why." The result of the EXTRACT function is of type XMLTYPE and call his works of members, the column is also of type XMLTYPE still call its members fails...

    Thanks in advance for any ideas on that.

    Best regards
    Philippe

    Going on the means to go far, far back.

    2003 re: function getRootElement ORA-00904

  • Create table ORA-01031: insufficient privileges

    SQL > indicate user USER is 'TEST_RPT.

    SQL > CREATE TABLE mytest (id NUMBER); - it does not work

    CREATE TABLE mytest (id NUMBER)

    * ERROR at line 1: ORA-01031: insufficient privileges

    SQL > CREATE TABLE TEST_RPT.mytest (id NUMBER).

    Table created. SQL >


    SQL > select * from session_privs;

    PRIVILEGE

    ----------------------------------------

    ANY PROCEDURE DEBUG

    DEBUGGING SESSION CONNECT

    CREATE INDEXTYPE

    OPERATOR TO CREATE

    CREATE THE TYPE

    CREATE THE TRIGGER

    CREATE PROCEDURE

    CREATE SEQUENCES

    CREATE VIEW

    CREATE SYNONYM

    CREATE THE CLUSTER

    CREATE TABLE

    UNLIMITED TABLESPACE

    ALTER SESSION STATEMENT

    CREATE SESSION

    Try this:

    SELECT USER, SYS_CONTEXT('USERENV','CURRENT_SCHEMA') FROM DUAL;

    The two identical values? CURRENT_SCHEMA is what will determine the owner of the table you create, if you do not specify an owner.

    This can be changed by

    ALTER SESSION SET CURRENT_SCHEMA = whatever_you_want_it_to_be;

  • Create table based on the timestamp prtition generate ORA-14752

    Hello

    I have following question - why create table 1 generate ORA-14752 script? Script 2 works without any problem. Feel it is on interval - day/month. How to create the script table 1?

    Database:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    1.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTOYMINTERVAL (1, 'DAY'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

    2.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTOYMINTERVAL (1, 'MONTH'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

    YM in NUMTOYMINTERVAL stands for the year and the month. With NUMTODSINTERVAL it should work.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTODSINTERVAL (1, 'DAY'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

  • ORA-14030: partitioning column does not exist in the CREATE TABLE statement

    Hi all

    We are trying to create a partition materialized view and get an error below.
    ORA-14030: partitioning column does not exist in the CREATE TABLE statement
    Our GL_BALANCES21 and GL_CODE_COMBINATIONS21 base tables is already divided by interval of the range on Code_combination_id.
    In the same way that we try to partition the view materialized
    We get the error.
    ORA-14030: partitioning column does not exist in the CREATE TABLE statement
    Where the clause there are 4 tables gl_balances21, gl_code_combinations21, gl_periods and gl_set_of_books.


    CREATE MATERIALIZED VIEW apps. BAL_PART
    PARTITION BY RANGE ("CODE_COMBINATION_ID")
    (SCORE LOWER (80000) VALUES,
    PARTITION OF LOWER VALUES (160000),
    PARTITION OF LOWER VALUES (240000),
    PARTITION OF LOWER VALUES (320000),
    PARTITION OF LOWER VALUES (400000),
    PARTITION OF LOWER VALUES (480000),
    PARTITION OF LOWER VALUES (560000),
    PARTITION OF LOWER VALUES (640000),
    PARTITION OF LOWER VALUES (720000),
    PARTITION OF VALUES LESS THAN (800000),
    PARTITION OF LOWER VALUES (880000),
    PARTITION OF LOWER VALUES (960000),
    PARTITION OF VALUES LESS THAN (10400000),
    PARTITION OF LOWER VALUES (11200000),
    PARTITION OF LOWER VALUES (12000000),
    PARTITION OF LOWER VALUES (12800000),
    PARTITION OF VALUES LESS THAN (13600000),
    PARTITION OF LOWER VALUES (14400000),
    PARTITION OF VALUES LESS THAN (15200000),
    PARTITION OF LOWER VALUES (16000000),
    PARTITION OF VALUES LESS THAN (16800000),
    PARTITION OF VALUES LESS THAN (17600000),
    PARTITION OF VALUES LESS THAN (18400000),
    PARTITION OF VALUES LESS THAN (19200000),
    PARTITION OF LOWER VALUES (20000000),
    PARTITION OF VALUES LESS THAN (20800000),
    PARTITION OF VALUES LESS THAN (21600000),
    PARTITION OF VALUES LESS THAN (22400000),
    PARTITION OF VALUES LESS THAN (23200000),
    PARTITION OF LOWER VALUES (24000000),
    PARTITION OF VALUES LESS THAN (24800000),
    PARTITION OF VALUES LESS THAN (25600000),
    PARTITION OF VALUES LESS THAN (26400000),
    PARTITION OF LOWER VALUES (27200000),
    PARTITION OF LOWER VALUES (28000000),
    PARTITION OF VALUES LESS THAN (28800000),
    PARTITION OF VALUES LESS THAN (29600000),
    PARTITION OF VALUES LESS THAN (30400000),
    PARTITION VALUES LESS THAN (MAXVALUE))
    QUICKLY REFRESH ON DEMAND
    SELECT the QUERY REWRITE as
    SELECT GL.GL_CODE_COMBINATIONS21. ROWID C1,
    GL.GL_BALANCES21. ROWID C2,
    "GL". "" GL_BALANCES21 ". "" ACTUAL_FLAG, "
    "GL". "" GL_BALANCES21 ". "" CURRENCY_CODE "
    "GL". "" GL_BALANCES21 ". "" PERIOD_NUM, "
    "GL". "" GL_BALANCES21 ". "" PERIOD_YEAR ".
    "GL". "" GL_BALANCES21 ". "" SET_OF_BOOKS_ID ""SOB_ID"
    "GL". "" GL_CODE_COMBINATIONS21 ". "" CODE_COMBINATION_ID ""CCID.
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT1 ",.
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT10, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" DIRECTION11, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT12, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT13, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT14, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT2 ",.
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT3. "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT4, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT5, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT6, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT7. "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT8, "
    "GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT9, "
    "GL". "" "" GL_PERIODS '. "" PERIOD_NAME,"
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) Open_Bal_Cr,
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) +.
    NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_CR', 0) Close_Bal_Cr,
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0) Open_Bal_Dr,
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0) +.
    NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_DR', 0) Close_Bal_Dr,
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0).
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) Open_Bal,
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0).
    NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) +.
    NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_DR', 0).
    NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_CR', 0) Close_Bal,
    NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_CR', 0) Period_Cr,
    NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_DR', 0) Period_Dr
    OF GL.GL_CODE_COMBINATIONS21.
    GL.GL_BALANCES21,
    GL.GL_SETS_OF_BOOKS,
    GL.GL_PERIODS
    WHERE GL.GL_BALANCES21. CODE_COMBINATION_ID = GL.GL_CODE_COMBINATIONS21. CODE_COMBINATION_ID
    AND GL.GL_SETS_OF_BOOKS. SET_OF_BOOKS_ID = GL.GL_BALANCES21. SET_OF_BOOKS_ID
    AND GL.GL_PERIODS. PERIOD_NUM = GL.GL_BALANCES21. PERIOD_NUM
    AND GL.GL_PERIODS. PERIOD_YEAR = GL.GL_BALANCES21. PERIOD_YEAR
    AND GL.GL_PERIODS. PERIOD_TYPE = GL.GL_BALANCES21. PERIOD_TYPE
    AND GL.GL_PERIODS. PERIOD_NAME = GL.GL_BALANCES21. PERIOD_NAME
    AND GL.GL_PERIODS. PERIOD_SET_NAME = GL.GL_SETS_OF_BOOKS. PERIOD_SET_NAME
    and gl.GL_CODE_COMBINATIONS21.summary_flag! = « Y »

    ERROR on line 54:
    ORA-01013: user has requested the cancellation of the current operation

    I checked the metalink note saying that ensure that all columns in a partitioning column list are columns of
    the table being created.

    Partition is already there, on the column of code_combination_id of gl_balances21 and gl_code_combinations21.

    Please suggest.

    Thank you

    It's your mistake:

    PARTITION BY RANGE ("CODE_COMBINATION_ID") 
    

    but in your projection of column list, you have an alias he:

    "GL"."GL_CODE_COMBINATIONS21"."CODE_COMBINATION_ID" "CCID",
    

    You must use the alias as a partition key, not the name fom the secondary table column.
    --
    John Watson
    Oracle Certified Master s/n
    http://skillbuilders.com

  • ORA-00604 with ORA-20010: the user is not authorized to CREATE Table

    Hello

    I use 11.1.0.7 database

    I'm only running this SQL logged on as a schema PLAN. PLAN scheme a DBA privilege but I receive error message-
    create table SALARY.test (ID NUMBER);
    create table SALARY.test (ID NUMBER)
    *
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20010: PLAN is not allowed to CREATE this -
    SALARY.TEST
    ORA-06512: at line 15
    What can be the problem here?

    Thank you!

    user608897 wrote:

    I know that we cannot use in a DDL trigger, but how can this be a DDL trigger.

    As sybrand hinted it often allows to read a manual.

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/srvrside.htm#CNCPT118

    >
    Overview of triggers

    A database trigger is a stored program unit compiled, written in PL/SQL or Java, that Oracle Database ("fire") automatically calls whenever one of the following occurs:

    1. DML instructions on a particular table or view, issued by a user
    The DML statements modify data in the schema objects. For example, inserting and removing lines are DML operations.

    * 2. DDL statements issued by a particular user or any user *.
    DDL statements define schema objects. For example, create a table and add a column are DDL operations.

    3. database events
    User login or closing of session, errors and database startup or a stop are events that can call triggers.
    >

    A DDL trigger is one that runs when the DDL is made as in 2 above.

    When you create the table, you run DDL, someone wrote a trigger that runs when you try to create the table, and in this trigger, they raise a user-defined exception ORA-20010: the user is not authorized to CREATE Table to tell you that you are not authorized to create the table.

  • ORA-00600 while creating the queue table

    Hello
    I'm getting
    ERROR on line 1:
    ORA-00600: internal error code, arguments: [kcbz_check_objd_typ], [0], [0,]
    [1], [], [], [], []
    ORA-06512: at "SYS." DBMS_AQADM_SYS', line 2830
    ORA-06512: at "SYS." DBMS_AQADM', line 58
    ORA-06512: at line 2
    When creating table queue.
    The problem seems to be the name of the created object. Here's the script:

    CREATE OR REPLACE TYPE BNA_CHG_EVENT AS OBJECT
    (
    NUMBER (2),
    INTEGER ID
    );
    /

    (it works fine)

    BEGIN
    SYS. DBMS_AQADM. CREATE_QUEUE_TABLE
    (
    QUEUE_TABLE = > 'BNA_CHG_EVENT_QT '.
    , QUEUE_PAYLOAD_TYPE = > 'BNA_CHG_EVENT '.
    "Compatible = > ' 10.0.0 '.
    , SORT_LIST = > 'ENQ_TIME, PRIORITY '.
    , MULTIPLE_CONSUMERS = > TRUE
    , MESSAGE_GROUPING = 0 >
    , SECURE = > FALSE
    );
    End;
    /

    (it crashes with ora-600).
    When I change the name of BNA_CHG_EVENT_QT to the BNA_CHG_EVENT_OT object is created without errors.
    Database is Oracle Database 10 g Enterprise Edition Release 10.2.0.4.0.

    Any suggestions on the cause of the error?
    Thanks in advance

    ARO
    Kuba Gasiorowski

    ERROR on line 1:
    ORA-00600: internal error code, arguments: [kcbz_check_objd_typ], [0], [0,]
    [1], [], [], [], []
    ORA-06512: at "SYS." DBMS_AQADM_SYS', line 2830
    ORA-06512: at "SYS." DBMS_AQADM', line 58
    ORA-06512: at line 2

    Check on the support of Oracle
    If you have upgraded DB to 10g, check 8247215 Bug

    Workaround
    A temporary workaround is to set dbblock_check_objtyp = false

  • DBMS_ADVANCED_REQRITE get ORA-00905: lack of keyword

    What I'm doing wrong here?
    17:17:29 NJ3417@pubd1> create table test_a (col_a varchar2(20));
    
    Table created.
    
    Elapsed: 00:00:00.04
    17:17:55 NJ3417@pubd1> insert into test_a values('Red');
    
    1 row created.
    
    Elapsed: 00:00:00.02
    17:18:09 NJ3417@pubd1> create table test_b (col_b varchar2(20));
    
    Table created.
    
    Elapsed: 00:00:00.02
    17:18:32 NJ3417@pubd1> insert into test_b values('Blue');
    
    1 row created.
    
    Elapsed: 00:00:00.03
    17:18:55 NJ3417@pubd1> commit;
    
    Commit complete.
    
    17:34:56 NJ3417@pubd1> begin
    17:34:56   2    sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
    17:34:56   3           name => 'Mikes SQL override',
    17:34:56   4           source_stmt => 'SELECT col_a FROM test_a',
    17:34:56   5           destination_stmt => 'SELECT col_b FROM test_b',
    17:34:56   6           validate => FALSE);
    17:34:56   7  end;
    17:34:56   8  /
    begin
    *
    ERROR at line 1:
    ORA-00905: missing keyword
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
    ORA-06512: at line 2
    
    17:54:18 NJ3417@pubd1> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    5 rows selected.
    Thank you
    Mike

    mtefft wrote:
    What I'm doing wrong here?

    I don't have your exact version but I think that you can't have any string as the name of the rewrite rule. Refer to the documentation
    Here's the working example:

    SQL> select * from v$version ;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> create table test_a (col_a varchar2(20));
    
    Table created.
    
    SQL> insert into test_a values('Red');
    
    1 row created.
    
    SQL> create table test_b (col_b varchar2(20));
    
    Table created.
    
    SQL> insert into test_b values('Blue');
    
    1 row created.
    
    SQL> commit ;
    
    Commit complete.
    
    SQL> select col_a from test_a ;
    
    COL_A
    --------------------
    Red
    
    SQL> select col_b from test_b ;
    
    COL_B
    --------------------
    Blue
    
    begin
      sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
           name => 'Mikes SQL override',
           source_stmt => 'SELECT col_a FROM test_a',
           destination_stmt => 'SELECT col_b FROM test_b',
           validate => FALSE);
    end;
      8  /
    begin
    *
    ERROR at line 1:
    ORA-00905: missing keyword
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
    ORA-06512: at line 2
    
    begin
      sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
           name => 'myrule',
           source_stmt => 'SELECT col_a FROM test_a',
           destination_stmt => 'SELECT col_b FROM test_b',
           validate => FALSE);
    end;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL> show parameter rewrite
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    query_rewrite_enabled                string      TRUE
    query_rewrite_integrity              string      enforced
    SQL> alter session set query_rewrite_integrity=trusted ;
    
    Session altered.
    
    SQL> show parameter rewrite
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    query_rewrite_enabled                string      TRUE
    query_rewrite_integrity              string      TRUSTED
    
    SQL> select col_a from test_a ;
    
    COL_A
    --------------------
    Blue
    
  • Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00905: lack of keyword

    Hi all

    I have create report sql in version 4.2, and now we have apex version 5.0 upgrade.

    I encountered error when I change the State of sql

    The error massage:

    Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00905: lack of keyword

    My SQL

    SELECT VW.*

    , CASE WHEN (VW.file_code is null

    OR VW.cancel_flg = 'Y'

    OR (TOUR_DEP_DATE + GET_FILE_LOCKING_DAYS (VW. (SBU_CODE) < = trunc (sysdate))

    ) THEN

    ' < font color = "Red" > < b > other < /b > < / police > '

    ON THE OTHER

    "< a href =" f? p = & APP_ID.:51: & SESSION. : O PR: & DEBUG. : 51:P51_FILE_CODE, P51_COSTING_CODE, P51_TOUR_REG_NO, P51_VERSION_NO, P51_REQUEST, P51_AGENT_NAME, P51_ADULTS, P51_CHILDS, P51_MKT_CODE, P51_QUOT_CURR:'

    || FILE_CODE | «, » || COSTING_CODE | «, » || TOUR_REG_NO | «, » || VERSION_NO | «, » ||' OPR' | «, » || AGENT_CODE | «, » || VW. FROM_PAX | «, » || 0||','|| VW.mkt_code | ',' | VW. QUOT_CURR |': ' > < font color = blue > < b > other < /b > < / police > '. "

    END as "other Actions".

    , CASE WHEN ((VW.file_code is not null AND TOUR_DEP_DATE + GET_FILE_LOCKING_DAYS (VW. (SBU_CODE) < = TRUNC (SYSDATE))

    OR cancel_flg = 'Y '.

    OR (VW. REF_COSTING_CODE = VW. ADDL_FIELD2 AND VW. ADDL_FIELD1 LIKE '% COPIED FROM % OF APPROVAL'

    AND BOOKING_NAME LIKE "%-Backup")

    ) THEN

    ' < font color = "Red" > < b > edit < /b > < / police > '

    ON THE OTHER

    "< a href =" f? p = & APP_ID.:149: & SESSION. : & DEBUG. : 149:P149_COSTING_CODE:'

    || COSTING_CODE |': ' > < font color = blue > < b > edit < /b > < / police > '. "

    END AS 'Edit '.

    , CASE WHEN (Nvl (cancel_flg, 'n') = 'Y')

    )

    THEN

    ' < font color = "Red" > < b > add < /b > < / police > '

    ON THE OTHER

    "< a href =" f? p = & APP_ID.:33: & SESSION. : & DEBUG. : 33:P33_COSTING_CODE, P33_FILE_CODE, P33_MKT_CODE, P33_QUOT_CURR, P33_NO_OF_ADULT, P33_NO_OF_CHILD:'

    || COSTING_CODE | «, » || file_code | «, » || VW.mkt_code | ',' | VW. QUOT_CURR | «, » || VW. FROM_PAX | «, » || 0 | ': "> < font color = blue > < b > add < /b > < / police > '

    END as 'Services '.

    OF TOUR_MAS_VW VW

    How to solve it.

    Thank you

    Dear friends

    Thanks for your helping hands.

    I found the solution for this. We can solve this problem by using these solutions

    • A region of HTML:

      click me
      
    • Using PL/SQL:
      htf.anchor('f?p=100:5:'||V('APP_SESSION'),'click me');
      
    • Using a SQL query: SELECT htf.anchor('f?p=100:5:'||:APP_SESSION,'clickme') FROM DUAL;

    We can write the query in the form

    SELECT ' f? p = 100: 1 :'|| : APP_SESSION |': ' | : APP_UNIQUE_PAGE_ID |

    ': P1_EMPNO :'|| employe_id,

    first name,

    job_id

    Employees

    Thank you & best regards

    CORINE

  • ORA-29913 for external table on Windows 7

    Hello

    Please help with the following problem.

    I installed Oracle 11 g on Windows 7 Pro workstation and have created an external table.

    I'm getting an ORA-29913 when I select.

    What I did is given below.

    create the directory imp_files as 'C:\app\user\admin\orcl\dpdump\'-'C:\orcl_work '.
    ;

    drop table people
    ;
    create table people)
    first name varchar2 (250).
    VARCHAR2 (250) last_name,.
    hire_date date,
    number of salary
    )
    (external) Organization
    type oracle_loader
    the default directory data_pump_dir
    (settings) access
    records delimited by newline
    BadFile data_pump_dir: 'pers1%a_%p.bad' /*'pers.bad'*/
    data_pump_dir log file: "pers1%a_%p.log" /*'pers.log'*/
    fields termintated by ' |'
    missing field values are null
    (first_name, last_name, hire_date 'dd.mm.yyyy' format mask, salary)
    )
    location ("pers_table1.txt")
    )
    reject limit unlimited
    ;

    Hello

    you completed wrongly spelt...

    Try to fix that and try again.

    See you soon,.

    rich

  • Need help - multilevel nested table - create table problem

    Hello

    My version of oracle db: 11g

    I just created a table that contains a nested multi-level table.

    Here is the code:

    create or replace type sdef_t_nt_empNames21 is table of the varchar2 (50);

    create or replace type sdef_ot_SCmarks21 as an object (number of physics, chemistry number, number of Biology);

    create or replace type sdef_t_nt_SCmarks21 is table of the sdef_ot_SCmarks21;

    create or replace type sdef_ot_allsubmarks21 as an object (eid, eng, math, sc sdef_t_nt_SCmarks21 number number);

    create or replace type sdef_t_nt_dep_m_info21 is table of the sdef_ot_allsubmarks21;

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    store table nested like NT_c_sdef_t_nt_dep_m_info21; c_sdef_t_nt_dep_m_info21  <-I know that the problem is here.

    TRACE OF THE ERROR:

    Error at startup on line: 13 in the command.

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    Nested table c_sdef_t_nt_dep_m_info21 (sdef_t_nt_SCmarks21) store as NT_c_sdef_t_nt_dep_m_info21

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    PS: I'm just solve a problem given to me by some1, is not a practical implementation, I'm just trying to get through

    I'm sure that some1 could help me with this, I have searched a lot of this problem but could not find my answer, please help me.

    Concerning

    Rahul

    SQL > create table (nt_dep21)
    Did number 2,
    3 dname varchar2 (50).
    4 c_sdef_t_nt_empNames21 sdef_t_nt_empNames21,
    c_sdef_t_nt_dep_m_info21 5 sdef_t_nt_dep_m_info21
    6                       )
    store c_sdef_t_nt_empNames21 7 nested as NT_c_sdef_t_nt_empNames21 table
    store c_sdef_t_nt_dep_m_info21 8 table nested as NT_c_sdef_t_nt_dep_m_info21)
    9 table nested as NT_sc sc store
    10                                                                               )
    11.

    Table created.

    SQL >

    SY.

  • How to get data in the procedure after CREATE TABLE table1 AS SELECT * from table2

    Hello

    can any body tell me how to get the data in the new table created in the procedure. because it gives following error.

    • Error (47,21): PL/SQL: ORA-00942: table or view does not exist

    tableName: = "BCKUP_" | TO_CHAR (sysdate, 'ddmmrrrr');

    tableDDL: = 'CREATE TABLE' | tableName. "AS SELECT * FROM Table1 where to_char(MSG_IN_TIME,''dd-mon-rrrr'') < sysdate - ' | daysNumber;

    EXECUTE IMMEDIATE backUpDDL;

    COMMIT;

    DELETE FROM Table1;

    How to select the data in the newly created table. as...

    Select * from ". tableName;

    Do not choose anything to get the number...

    Just after backupDDL EXECUTE IMMEDIATE, simply refers to SQL % ROWCOUNT - who will be the number of lines.

    Oh and DDL engages automatically, your commitment is redundant.

  • ORA-01747: invalid user.table.column... on the REPLACEMENT notice

    Oracle 11g Release 2

    I run an UPDATE statement. In the 'set' I am trying to update a column by using a subquery on the right side. REPLACE the statement Gets the error ORA-01747: specification of invalid column, table.column, or user.table.column.

    create table tab1
    ( file_id   number  ,
      record_id number  ,
      part_type_id number ,
      part_number  number ,
      positon_id   number ,
      notes        varchar2(255) ,
      mapped       varchar2(1) default 'N'
    )
    /
    insert into tab1 values(1,1,123,777,1,'NEW|A/C COMPRESSOR KIT','N') ;
    insert into tab1 values(1,2,123,777,2,'REMAN|A/C LINE','N') ;
    insert into tab1 values(1,3,123,777,2,'TEST NOTE','N') ;
    commit;
    select * from tab1;
    /*
      FILE_ID  RECORD_ID PART_TYPE_ID PART_NUMBER POSITON_ID NOTES                     MAPPED
    --------- ---------- ------------ ----------- ---------- ------------------------- ------
            1          1          123         777          1 NEW|A/C COMPRESSOR KIT         N
            1          2          123         777          2 REMAN|A/C LINE                 N
            1          3          123         777          1 TEST NOTE                      N
    */
    
    
    DECLARE
       v_note2 varchar2(255) := 'NEW' ;
    BEGIN
    UPDATE tab1 t 
             SET 
              , t.notes =  (select REPLACE(t.notes,v_note2,null) 
                            from dual )
          WHERE t.file_id = 1         -- value comes from another source
          AND   t.part_type_id = 123  -- value comes from another source
          AND   t.part_number = 777   -- value comes from another source
          AND   t.position_id = 1  ;  -- value comes from another source
    END ;
    /
    
    ERROR at line 3:
    ORA-01747: invalid user.table.column, table.column, or column specification
    

    Here's what the end result should be:

      FILE_ID  RECORD_ID PART_TYPE_ID PART_NUMBER POSITON_ID NOTES                     MAPPED
    --------- ---------- ------------ ----------- ---------- ------------------------- ------
            1          1          123         777          1 |A/C COMPRESSOR KIT            N
            1          2          123         777          2 REMAN|A/C LINE                 N
            1          3          123         777          1 TEST NOTE                      N
    

    Hello

    orclrunner wrote:

    Oracle 11g Release 2

    I run an UPDATE statement. In the 'set' I am trying to update a column by using a subquery on the right side. REPLACE the statement Gets the error ORA-01747: specification of invalid column, table.column, or user.table.column.

    1. create table tab1
    2. (file_id number,
    3. number of record_id,
    4. number of part_type_id
    5. number of PART_NUMBER,
    6. number of positon_id
    7. Notes VARCHAR2 (255),
    8. mapped by default varchar2 (1) ' don't
    9. )
    10. /
    11. insert into tab1 values (1,1,123,777,1,'NEW |) Kit COMPRESSOR / it, ' don't);
    12. insert into tab1 values (1,2,123,777,2,'REMAN |) A/C LINE ',' don't);
    13. insert into tab1 values (1,3,123,777,2, 'NOTE of TEST', ' don't);
    14. commit;
    15. Select * from tab1;
    16. /*
    17. FILE_ID RECORD_ID PART_TYPE_ID PART_NUMBER POSITON_ID MAPPED NOTES
    18. --------- ---------- ------------ ----------- ---------- ------------------------- ------
    19. 1 1 123 777 1 NEW | A/C COMPRESSOR KIT N
    20. 1 2 123 777 2 REMAN | A/C LINE N
    21. 1 3 123 777 1 TEST NOTES N
    22. */
    23. DECLARE
    24. VARCHAR2 (255) v_note2: = "NEW";
    25. BEGIN
    26. Tab1 t UPDATE
    27. SET
    28. t.notes = (select REPLACE(t.notes,v_note2,null)
    29. the double)
    30. WHERE t.file_id = 1 - value comes from another source
    31. AND t.part_type_id = 123 - value comes from another source
    32. AND t.part_number = 777 - value comes from another source
    33. AND t.position_id = 1;  -value comes from another source
    34. END;
    35. /
    36. ERROR at line 3:
    37. ORA-01747: invalid column, table.column, or user.table.column specification

    Here's what the end result should be:

    1. FILE_ID RECORD_ID PART_TYPE_ID PART_NUMBER POSITON_ID MAPPED NOTES
    2. --------- ---------- ------------ ----------- ---------- ------------------------- ------
    3. 1          1          123         777          1 | A/C COMPRESSOR KIT N
    4. 1 2 123 777 2 REMAN | A/C LINE N
    5. 1 3 123 777 1 TEST NOTES N

    The comma after SET is a syntax error.

    Why you use double?  Why not just

    UPDATE tab1

    SET of notes = REPLACE (notes, v_note2)

    WHERE file_id = 1

    ...

    ?

  • Create table for users

    Hi all

    11.2.0.3.10

    AIX6

    I created a user SCOTT in our database.

    I have grant connect, resource to scott; because it is easier to do it this way.

    DBA, I wish that I'm the only one to create all the tables of scott, and he cannot create for himself.

    What is the effective way to do this? Is this order enough? > REVOKE CREATE a TABLE FROM SCOTT;

    Thank you

    MK

    RP gave you the right answer if you want to restrict users to create table, do not give them privilege resource.  See this demo:

    Connected to:

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > create user test identified by the test.

    Created by the user.

    SQL > grant connect to test;

    Grant succeeded.

    SQL > connect test/test;

    Connected.

    SQL > create table tab1 (a number);

    create table tab1 (a number)

    *

    ERROR on line 1:

    ORA-01031: insufficient privileges

    SQL > connect sys/pw as sysdba

    Connected.

    SQL > grant create table to test;

    Grant succeeded.

    SQL > connect test/test;

    Connected.

    SQL > create table tab1 (a number);

    Table created.

    SQL > connect sys/pw as sysdba

    Connected.

    SQL > revoke create table test;

    Revoke succeeded.

    SQL > connect test/test;

    Connected.

    SQL > create table tab2 (a number);

    create the table tab2 (a number)

    *

    ERROR on line 1:

    ORA-01031: insufficient privileges

    SQL >

    Concerning

    Girish Sharma

Maybe you are looking for

  • I can force a link to open it in a non-active tab, rather than on this tab?

    For example, if you click on a link and select the "open in a new tab" option, the new tab opens, but is not active. If you click on a normal link that would open up in a new tab, Firefox go to this tab and makes it "active".

  • How can I stop Firefox remembering logins?

    When I connect to a website, Firefox is remembering names. I changed all the settings I know, but it continues to insist on "suggesting" to login names. How can I disable this function?

  • Satellite Pro L300D do not automatically extended

    Hello I've notified two days ago, when I closed the screen down, he started to hibernate automatically, the system is left on. I was always close computer displayed on the screen and it has always started to hibernate automatically. However, now I ha

  • Qosmio G10 - pregnant sound of quality

    Hi guys, anyone of you have qosmio g10 owners experience quite ordinary sound of your speakers (harman/kardon), especially when you turn up the volume? Music CDs, mp3s, or even movies, speakers do not seem to manage fine bass at all? I called toshiba

  • Install the hardware support for LabVIEW

    When updating to LabVIEW 2013, I asks me to install the appropriate device drivers, but I don't know where to find them.