ORA-01445: cannot select ROWID, or sample, a view of join without key - preserved table form w/report and LOV

I create a page "Form on a Table with Report" (APEX 5). Table I has 3 columns: cat_key, item_value, item_description. The cat_key is a foreign key in a table with columns cat_key, cat_value. I created the report and everything works fine.  The page of the report shows my domain cat_key in number, so I want it instead to display the cat_value. I change the field cat_key to a text based on LOV, select my LOV and now when I view the page of report I get the "'ORA-01445: cannot select ROWID from where sample, a join without key preserved table view ' error." The report uses the ROWID as a link to the edit page field.

If I use the same tables and even shared LOV in a report page interactive, it works fine.

What I am doing wrong?

This is a limitation of the IR Apex will rewrite your query to a query that includes the lookup table and the columns. So now you have actually created a query on an inline view, which causes the error. You can see the query apex created when running in debug mode. APEX will join the table of choice with your primary table. For example from one of my IR:

Select 'ID '...

"MSL". "" HIS_COUNTRIES "=> my primary table

) ) b,

(select rv_meaning d, rv_low_value r

of msl_ref_codes_table

where rv_domain = "JOHN".

) L1 = > query My LOV Lookup

...

So, if possible, base your reports and forms on the real primary key, no rowid.

You can also write the IR query with the search yourself:

Select T1.rowid...

of primary_table T1

look_table L1

...

Tags: Database

Similar Questions

  • v4.0 - in the form of ORA-01445: cannot select ROWID from where sample,.

    Hello
    I have created a form in table form in version 4.0.
    Selection is based on three tables that have primary keys, the keys are selected, and whenever I run the page I get the following error:-
    Failed to parse the SQL query:
    ORA-01445: cannot select ROWID, or sample, join without table views preserved key

    The query runs very well in the TOAD

    Any ideas?

    Thank you

    Mike
    ___________________________________________________________________________________
    Select
    CTR. PERF_RATING_LINE_ID,
    CTR. PERF_RATING_LINE_ID PERF_RATING_LINE_ID_DISPLAY,
    CTR. BUSINESS_UNIT,
    CTR. EMPLID,
    ''''|| CTR. REVIEW_YEAR REVIEW_YEAR,
    CTR. REVIEW_PERIOD,
    CTR. PERFORMANCE_SCORE,
    CTR. MODERATED_SCORE,
    CTR. HUMAN RESOURCES MANAGEMENT,
    PRL.COMMENTS,
    ACB. BU_DESC,
    ''''|| ACB. DEPTID DEPTID,
    ACB. DEPT_DESC,
    ACB. EMPLOYEE_NAME,
    ACB. GRADE,
    CTR. SCORE_APPROVED_BY,
    ACB. TEMP_PERM,
    ACB. GENDER,
    ACB. JOB_START_DATE,
    decode (DECODE (SUBSTR (ACB. FLAG, 1, 5), "S Job", substr (CPR. FLAG, instr (CPR. FLAG,'~ ', 1) + 2, 3));
    "HIR", "Committed", "XFR", "Transfer", "REH", "recall").
    Decode (SUBSTR (ACB. FLAG, 1, 30), "work starts the period ~ XFR ',' - ' | substr (CPR. FLAG, instr (CPR. FLAG,'~ ', 1, 2) + 2)) JOB_START_DETAILS,.
    ACB. APPOINTMENT_DATE,
    SUBSTR (CPR. JOB_END_DETAILS, INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 2) + 2) JOB_END_DATE.
    SUBSTR (CPR. JOB_END_DETAILS, INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 1) + 2, INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 2) - INSTR (CPR. JOB_END_DETAILS,'~ ', 1, 1)-2) REASON,
    ACB. JOB_GROUP,
    ACB. JOB_GROUP_DESC,
    ACB. JOBCODE,
    ACB. JOBCODE_DESC JOB_DESC,
    ACB. JOB_FAMILY,
    ACB. JOB_FAMILY_DESC,
    ACB. PBR_ID,
    MD. MGR_DEPT_ID
    PERFORMANCE_BASE_REFRESH_V ACB,.
    PERFORMANCE_RATING_LINE PRL,
    Y00_OPR_MGR_DEPT MD
    WHERE (PRL. BUSINESS_UNIT = ACB. BUSINESS_UNIT
    AND PRL. EMPLID = ACB. EMPLID
    AND PRL. REVIEW_YEAR = ACB. REVIEW_YEAR
    AND PRL. REVIEW_PERIOD = ACB. REVIEW_PERIOD)
    AND MD. OPRID =: APP_USER
    AND INSTR (': ' |) MD. DEPTS_MANAGED |': ',' :'|| ACB. DEPTID |': ') > 0
    AND MD. MGR_DEPT_ID > 0
    AND CPR. ADMIN_CENTRE IN
    (select c.deptid AC
    of PSHR. PSOPRDEFN@PSHR. CSIR.CO. ZA,.
    PSHR.PS_SCRTY_TBL_DEPT@PSHR. CSIR.CO. ZA C
    where A.ROWSECCLASS = C.ROWSECCLASS
    AND C.DEPTID! = 'ZZZZ '.
    and a.oprid =: APP_USER)
    AND (: P2210_BUSINESS_UNIT IS NULL)
    OR PBR. BUSINESS_UNIT =: P2210_BUSINESS_UNIT)
    AND (: P2210_EMPLOYEE_NAME IS NULL)
    OR INSTR (UPPER (CPR. Employee_name), UPPER (:P2210_EMPLOYEE_NAME)) > 0)
    AND (: P2210_DEPARTMENT IS NULL)
    OR PBR. DEPTID =: P2210_DEPARTMENT)
    AND (: P2210_PERFORMANCE_RATING IS NULL)
    OR PBR. PERFORMANCE_SCORE =: P2210_PERFORMANCE_RATING)
    AND (: P2210_MODERATED_RATING IS NULL)
    OR PBR. MODERATED_SCORE =: P2210_MODERATED_RATING)
    AND (: P2210_GRADE IS NULL)
    OR PBR. CATEGORY =: P2210_GRADE)
    AND (: P2210_PERM_TEMP IS NULL)
    OR PBR. TEMP_PERM =: P2210_PERM_TEMP)
    AND SUBSTR (NVL (ACB. (JOB_END_DETAILS, "XXX"), 1, 3) NOT ("TER", "TOC")
    AND PRL. SCORE_APPROVED_BY IS NULL

    Mike,

    We also changed our Wizard to create only validations for columns that are selected to be updated (in the wizard on the page in a table). And in the case of the application wizard, we examine if the columns have been excluded on the edit page popup page, and they are set to read-only through the default user interface. If you should only get validations for the columns that are modifiable, view-only / save state or hidden. We include only display / save state and hidden, because in both cases, you have actual shape on your page elements, which could easily be manipulated through common web tools.

    Kind regards
    Marc

  • "ORA-01445: cannot select ROWID' v4 tabular.

    Hi guys,.

    We had major problems since the transition from v2 to v4.

    One of the problems I've had is with tabular forms.

    I have a complex page with many regions which has always worked well in version 2. One of these regions is a tabular presentation. When loading the page, I get the:

    "ORA-01445: cannot select ROWID from where sample, a join without key preserved table view ' error."

    The initial request was quite complex, but I've broken down it:

    This query runs and allows me to update the base table (xxmel_apex_eco_alterations)

    Select
    replace. ALTERATION_ID,
    replace. ALTERATION_ID ALTERATION_ID_DISPLAY,
    replace. ECO,
    alt.ORGANIZATION_ID,
    replace. ACD_TYPE,
    replace. INVENTORY_ITEM_ID,
    replace. BEFORE_CHANGE_QTY,
    replace. AFTER_CHANGE_QTY,
    replace. MODIFY_FLAG,
    replace. REVISED_ASSEMBLY_ID,
    replace. BILL_SEQUENCE_ID,
    alt.COMPONENT_SEQUENCE_ID,
    replace. LAST_UPDATE_DATE,
    replace. LAST_UPDATE_BY,
    alt.COMMENTS,
    replace. BOM_IMPLEMENTATION_DATE,
    replace. BOM_CHANGE_NOTICE,
    replace. ASSEMBLY_NAME,
    alt.COMPONENT_NAME,
    replace. SELECTION_CRITERIA,
    replace. ORACLE_CHANGE_NOTICE,
    alt.COMP_CURRENT_COST,
    alt.COMP_NEW_COST,
    alt.COMP_CURRENT_SC,
    alt.COMP_NEW_SC,
    alt.COMP_DESCRIPTION,
    alt.COMP_CURRENT_UOM,
    alt.COMP_NEW_UOM,
    alt.COMP_CURRENT_PUR_STATUS,
    alt.COMP_NEW_PUR_STATUS
    ALT XXMEL_APEX_ECO_ALTERATIONS
    where eco =: P2_ECO


    But as soon as I try to join another table (I do not update, just view as shown below), I get the error.

    Select
    replace. ALTERATION_ID,
    replace. ALTERATION_ID ALTERATION_ID_DISPLAY,
    replace. ECO,
    alt.ORGANIZATION_ID,
    replace. ACD_TYPE,
    replace. INVENTORY_ITEM_ID,
    replace. BEFORE_CHANGE_QTY,
    replace. AFTER_CHANGE_QTY,
    replace. MODIFY_FLAG,
    replace. REVISED_ASSEMBLY_ID,
    replace. BILL_SEQUENCE_ID,
    alt.COMPONENT_SEQUENCE_ID,
    replace. LAST_UPDATE_DATE,
    replace. LAST_UPDATE_BY,
    alt.COMMENTS,
    replace. BOM_IMPLEMENTATION_DATE,
    replace. BOM_CHANGE_NOTICE,
    replace. ASSEMBLY_NAME,
    alt.COMPONENT_NAME,
    replace. SELECTION_CRITERIA,
    replace. ORACLE_CHANGE_NOTICE,
    alt.COMP_CURRENT_COST,
    alt.COMP_NEW_COST,
    alt.COMP_CURRENT_SC,
    alt.COMP_NEW_SC,
    alt.COMP_DESCRIPTION,
    alt.COMP_CURRENT_UOM,
    alt.COMP_NEW_UOM,
    alt.COMP_CURRENT_PUR_STATUS,
    alt.COMP_NEW_PUR_STATUS
    msib.segment1
    ALT XXMEL_APEX_ECO_ALTERATIONS
    mtl_system_items_b msib
    where eco =: P2_ECO
    and msib.organization_id = 26
    and msib.inventory_item_id = ALT INVENTORY_ITEM_ID

    I read Re: v4.0 - in the form of ORA-01445: cannot select ROWID from where sample, where someone had a similar problem for me, but their solution (by copying the script to create a new page) isn't really an option for us the complexity to the page as a whole.

    Is this a bug in 4 APEX?

    Any help would be great,

    Thank you
    Chris

    Hello

    This isn't a bug in the apex, if you want to display a different table column there is a way to create a function to get the value of this table

    to "msib.segment1", you must create a function that accepts that some primary key to and retrieves the value of 'mtl_system_items_b' and can return a value in the field "segment1".

    and you can use your previous query, you can add the name of function as a new field

    for example

    Select
    replace. ALTERATION_ID,
    replace. ALTERATION_ID ALTERATION_ID_DISPLAY,
    replace. ECO,
    alt.ORGANIZATION_ID,
    replace. ACD_TYPE,
    replace. INVENTORY_ITEM_ID,
    replace. BEFORE_CHANGE_QTY,
    replace. AFTER_CHANGE_QTY,
    replace. MODIFY_FLAG,
    replace. REVISED_ASSEMBLY_ID,
    replace. BILL_SEQUENCE_ID,
    alt.COMPONENT_SEQUENCE_ID,
    replace. LAST_UPDATE_DATE,
    replace. LAST_UPDATE_BY,
    alt.COMMENTS,
    replace. BOM_IMPLEMENTATION_DATE,
    replace. BOM_CHANGE_NOTICE,
    replace. ASSEMBLY_NAME,
    alt.COMPONENT_NAME,
    replace. SELECTION_CRITERIA,
    replace. ORACLE_CHANGE_NOTICE,
    alt.COMP_CURRENT_COST,
    alt.COMP_NEW_COST,
    alt.COMP_CURRENT_SC,
    alt.COMP_NEW_SC,
    alt.COMP_DESCRIPTION,
    alt.COMP_CURRENT_UOM,
    alt.COMP_NEW_UOM,
    alt.COMP_CURRENT_PUR_STATUS,
    alt.COMP_NEW_PUR_STATUS,
    newfunction (pkId) as segment1
    ALT XXMEL_APEX_ECO_ALTERATIONS
    where eco =: P2_ECO

    Thank you
    Abdou Bosamiya

  • ORA-01445 error: cannot select ROWID from where sample, a join without a view

    Hi all

    I get an error when I created a VO based EO with standard Table (forced) jtf_notes_vl
    It gives me the error ORA-01445: cannot select ROWID from where sample, a join without key preserved table view

    the Table has the ROW_ID as Primery key


    Thanks in advance

    Hello

    Creation of an EO-based the rowid as primary key is usually the cause of this error as is not recommended to use the rowid as the primary key. Try to use jtf_note_id as the primary key.

    Furthermore, why are you using NAV it is seen for the creation of EO. If I remember correctly, there is a JTF_NOTES_B and JTF_NOTES_TL table that you can use.

    Thank you
    AJ

  • selection of the missing records between 2 duplicity without worrying about tables of records

    Hi all

    I have received_bills and send_bills of 2 tables.

    The SEND_BILLS table is the source table displaying all records in it.

    I need to compare two tables together and insert all the missing elements in received_items including duplicate records.

    There may be duplicate in 2 tables records.

    I wrote a query, but it does not select the duplicate records if it's all the 2 tables. When the same duplicate records are send_bills and received_bill without worrying because send_bills has 4 of them and received_bill 2, it does not select the other 2 duplicate records. And it's just what I need.

    the query is

    SELECT SEND. POINT OF REFERENCE,

    Send. PAYMENT,

    Send. CODE

    OF SEND_BILLS SEND

    WHERE THERE IS NOT (SELECT REC. DATUM, PAYMENT, REC. REC. CODE

    OF RECEIVED_BILLS REC

    WHERE REC. REFERENCE = SEND. SCRATCH CARDS

    AND REC. PAYMENT = SEND. PAYMENT

    AND REC. CODE = SEND. CODE)

    send_bills records

    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1529A3
    OCTOBER 10, 1547A4
    9 OCTOBER 1519A8
    OCTOBER 10, 1520A1
    OCTOBER 10, 1519A1
    OCTOBER 10, 1525A5
    OCTOBER 10, 1525A5

    received_bills records

    OCTOBER 10, 1519A1
    OCTOBER 10, 1529A3
    OCTOBER 10, 1547A4
    OCTOBER 10, 1519A1

    the result of the query is:

    OCTOBER 10, 1525A5
    OCTOBER 10, 1525A5
    OCTOBER 10, 1520A1
    9 OCTOBER 1519A8

    So he selects all the records

    the result should be

    OCTOBER 10, 1525A5
    OCTOBER 10, 1525A5
    OCTOBER 10, 1520A1
    9 OCTOBER 1519A8
    OCTOBER 10, 1519A1
    OCTOBER 10, 1519A1

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

    -The DOF for Table SEND_BILLS

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

    CREATE TABLE SEND_BILLS

    (DATE OF "DATUM",

    NUMBER OF "PAYMENT."

    'CODE' VARCHAR2 (5 BYTE)

    )  ;

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

    -The DOF for Table RECEIVED_BILLS

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

    CREATE TABLE 'RECEIVED_BILLS '.

    (DATE OF "DATUM",

    NUMBER OF "PAYMENT."

    'CODE' VARCHAR2 (5 BYTE)

    )  ;

    -Insert the script for send_bills

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 29, 'A3');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 47, 'A4');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('09-OCT-15','DD-MON-RR'), 19, 'A8');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 20, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5')

    Insert into SEND_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 25, 'A5')

    -Insert invoices received from script

    Insert into RECEIVED_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Insert into RECEIVED_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 29, 'A3');

    Insert into RECEIVED_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 47, 'A4');

    Insert into RECEIVED_BILLS (DATUM, CODE) values (to_date('10-OCT-15','DD-MON-RR'), 19, 'A1');

    Can someone please help me with the query so that I can also select all the missing records, including duplicates.

    Thanks in advance.

    Best regards

    Caroline

    If you should by all means use loop and then (send_bills and received_bills contain the same data as your original post):

    Select the reference, payment, code

    of (with

    Duplicator (Datum, Payment, code, CNT) as

    (select the reference, code, payment, cnt - 1).

    from (select datum, payment, code, count (one) - cnt count (two)

    (select date, payment, code, 1 one, to_number (null) two)

    of send_bills

    Union of all the

    Select datum, payment, code, to_number (null), 2 two

    of received_bills

    )

    Reference group, code

    having count (one)! = count (two)

    )

    Union of all the

    Select the reference code, payment, cnt - 1

    The duplicator

    where cnt > 0

    )

    Select the reference, payment, code

    The duplicator

    )

    DATUM PAYMENT CODE
    10/09/2015 19 A8
    10/10/2015 19 A1
    10/10/2015 25 A5
    10/10/2015 20 A1
    10/10/2015 19 A1
    10/10/2015 25 A5

    Concerning

    Etbin

  • Error ORA-01445 tabular form on a Collection in APEX 5

    When I load a page with a tabular presentation built on a display of a collection to the APEX 5, I'm getting an ORA-01445: cannot select ROWID, or the sample, a view of joining without an error table preserved key.

    I create a view

    CREATE or REPLACE FORCE VIEWS test_coll_vw

    (

    C001,

    C002,

    C003,

    C004,

    seq_id

    )

    AS

    SELECT TO_NUMBER (c001),

    C002,

    TO_NUMBER (c003),

    TO_NUMBER (c004),

    seq_id

    Of apex_collections

    WHERE collection_name = 'TEST '.

    Then create a tabular presentation on the view with the primary key of the source SEQ_ID and primary key of the trigger existing through the wizard.

    Debug information shows the statement which is a failure:

    Select NULL NULL "CHECK$ 01", "SEQ_ID,' NULL 'C001', NULL"C002', 'C003', 'C004', NULL NULL NULL "APEX$ ROWID ' sys.dual union all select ' CHECK$ 01", 'SEQ_ID', 'C001', 'C002', 'C003', "C004", "APEX$ ROWID" in (select NULL "CHECK$ 01", "SEQ_ID", "C001", "C002", "C003", "C004", "ROWID" "APEX$ ROWID" (select).

    "SEQ_ID."

    "C001."

    "C002."

    "C003."

    "C004.

    of 'WPCAMS_APP '. "" TEST_COLL_VW ".

    ) APEX$ RPTSRC

    order of 1, 7

    ).

    These tabular forms worked up to 4.2, but they seem to fail at 5 APEX for upgrade or newly created pages one.  The generated query is identical between versions, but it seems that the underlying apex_collections view has changed between versions and the origin of the problem.

    Does anyone have a solution or workaround?

    Thank you

    Hi Phil,

    APEX 5.0 the definition of the view of apex_collection had to be changed for security reasons. This change introduced a regression with tabular form validations, when the table refers to this view. Tabular form declarative validations require the ROWID in order to restore your changed data after a validation failed, and for this reason, APEX is insert the IDENTIFIER in the query in a table. It is currently not possible when tables refers to the sight of apex_collections. We are looking at a solution to this problem, but for now the only way to get around this is not, in this case, use the declarative validation and use some custom validations or process.

    Kind regards
    Marc

  • ORA-01445 when literals in a view

    OTN dear Forum,

    I am creating this point of view, which generates a list of files with metadata in each line for example. "Description". I want to add a column with the same literal value in each row - 'Photo Unit Legacy Collection', but he doesn't seem to like it. I tested without the code on line 10 and I tested 10 independently in a separate query lines - both work.

    I get the error message "unhandled exception warning,: ORA-01445: cannot select ROWID from where sample, a join without key preserved table view.

    Can anyone help?


    1 Select
    2 csv. "" FILE "as"#FILE. "
    3 csv.security_policies as "#SECURITY POLICIES."
    4 csv.model as "#MODEL."
    5 csv.nhm_field_department as "NHM_FIELD_DEPARTMENT."
    6 photo_lib.jobtitle as "NHM_FIELD_ASSET_DESCRIPTION."
    7 csv.nhm_field_asset_keywords as "NHM_FIELD_ASSET_KEYWORDS."
    8 csv.nhm_field_file_creation_date as "NHM_FIELD_CREATION_DATE."
    9 csv.nhm_field_original_file_path as "NHM_FIELD_ORIGINAL_FILE_PATH."
    10 "Legacy Collection of photo unit" as "NHM_FIELD_GROUP_TITLE."
    11 regexp_substr (csv. ("' NHM_FIELD_ASSET_DESCRIPTION",'[[: digit:]] {4,}') as 'TASK IDENTIFIER.
    12 years of
    13 csv join internal photo_lib
    14 on (photo_lib.fk_jobid = regexp_substr (csv. "" FILE "," [[: digit:]] {4}')) "
    15 where photo_lib.jobtitle is not null
    16 and regexp_like (csv. "" FILE ","[...] *\. ((tif)')

    You get the error create view, or when you try to choose in this one? What version of 4 numbers of Oracle are you running? There is at least a bug reported in MOS (see Doc ID 412362.1 if you have a support contract) for outer joins against versions 10.2.0.1 - 10.2.0.3.

    You can try either simplify the view somewhat, perhaps to ot to rid the superfluous double quotes. Another possibility might be to try to make the regexp in a view online and join with this, something like:

    select csv.file as "#FILE", csv.security_policies as "#SECURITY POLICIES",
           csv.model as "#MODEL", csv.nhm_field_department,
           photo_lib.jobtitle as NHM_FIELD_ASSET_DESCRIPTION,
           csv.nhm_field_asset_keywords, csv.nhm_field_file_creation_date,
           csv.nhm_field_original_file_path,
           'Photo Unit Legacy Collection' as NHM_FIELD_GROUP_TITLE,
           csv.job_identifier
    from (select file, security_policies, model, csv.nhm_field_department,
                 nhm_field_asset_keywords, nhm_field_file_creation_date,
                 nhm_field_original_file_path,
                 regexp_substr(NHM_FIELD_ASSET_DESCRIPTION,'[[:digit:]]{4,}') JOB_IDENTIFIER,
                 regexp_substr(FILE,'[[:digit:]]{4}') jobid
          from csv
          where regexp_like(csv.FILE,'[...]*\.(tif)')) csv
       join photo_lib
          on photo_lib.fk_jobid = csv.jobid
    where photo_lib.jobtitle is not null
    

    John

  • ERROR: ORA-01445

    Hello

    Can you please let me know how to select the ROWID of the table all_ind_expressions? I tried to run the following SQL query on the Oracle version 10.2.0.3 but received the error ORA-01445.


    Select the ROWID in all_ind_expressions
    where index_owner = "DBO."

    Thank you

    Published by: user12088323 on February 24, 2011 18:29

    Published by: user12088323 on February 24, 2011 18:30
    SQL> select text from dba_views where view_name = 'DBA_IND_EXPRESSIONS';
    
    TEXT
    --------------------------------------------------------------------------------
    select io.name, idx.name, bo.name, base.name, c.default$, ic.pos#
    from sys.col$ c, sys.obj$ idx, sys.obj$ base, sys.icol$ ic,
         sys.user$ io, sys.user$ bo, sys.ind$ i
    where bitand(ic.spare1,1) = 1         /* an expression */
      and (bitand(i.property,1024) = 0) /* not bmji */
      and ic.bo# = c.obj#
      and ic.intcol# = c.intcol#
      and ic.bo# = base.obj#
      and io.user# = idx.owner#
      and bo.user# = base.owner#
      and ic.obj# = idx.obj#
    
    TEXT
    --------------------------------------------------------------------------------
      and idx.obj# = i.obj#
      and i.type# in (1, 2, 3, 4, 6, 7, 9)
    

    Who should be returned to ROWID when SELECT view above?

    Published by: sb92075 on February 24, 2011 16:47

  • ORA-01779: cannot modify a column that is mapped to a table not preserved key

    Hello
    I'm doing update join with the type of activity of lag on my 10.2.0.3
    Here's a simple test case:
    create table test1 (id1 number, id2 number, before varchar2(10), after varchar2(10));
    
    alter table test1 add constraint pk1 primary key (id1, id2);
    
    SQL> insert into test1 values(1,1 , 'a','b');
    
    1 row created.
    
    SQL> insert into test1 values(1,2 , 'b','c');
    
    1 row created.
    
    SQL> commit;
    
    
    
    
    select * from test1;
    
      ID1        ID2 BEFORE     AFTER
    ----- ---------- ---------- ----------
        1          1 a          b
        1          2 b          c
    
    
    
    update
     (select src.before src_before, tgt.before tgt_before from test1 src , test1 tgt 
        where 
        src.id1 = tgt.id1 
    and src.id2 = tgt.id2 + 1 )
    set tgt_before  = src_before
    /
    
    set tgt_before  = src_before
        *
    ERROR at line 2:
    ORA-01779: cannot modify a column which maps to a non key-preserved table
    Problem with tgt.id2 + 1, but I need that in my logic, so how do I get around this?
    Concerning
    GregG

    Published by: 3 Sep 2012 GregG 13:23
    removed and src.id2 = 1

    Published by: 3 Sep 2012 GregG 13:31
    Corrected as pointed by Dom

    Have you tried something like this:

    UPDATE test1 a
    SET    a.before = (SELECT b.before
                       FROM   test1 b
                       WHERE  b.id1 = a.id1
                       AND    b.id2 = a.id2 - 1)
    WHERE EXISTS (SELECT 1
                  FROM   test1 c
                  WHERE  c.id1 = a.id1
                  AND    c.id2 = a.id2 - 1)
    
  • Import error: ORA-01400: cannot insert NULL in

    I'm performing a level schema import and I get this error. Half an hour, this error comes without any stop. could you please tell me how to ignore this error when executing import?

    IMP-00019: rejected due to the ORACLE 1400 error line
    IMP-00003: ORACLE error 1400
    ORA-01400: cannot insert NULL into ("LWARE_ADMIN". "" "" SAMPLE_AUDIT_LOG '. "" COUNTER")

    Db version is 10.2.0.4 and platform HP - UX B.11.31 U ia64

    Thank you!

    Hello

    Please read this article

    ORA-1400 when you import the Export Dump written in Mode Direct Path [ID 826746.1]

    Kind regards
    Rakesh jayappa

  • Need a script to select the update the row to another row in the same table

    I have a table with the columns and values
    KeyID       EffectiveDate     InactiveDate
    1              01/01/2013
    1              01/02/2013
    1              01/03/2013
    2              12/31/2012
    2              01/02/2013
    2              01/03/2013
    I need to update the InactiveDate of a line with the EffectiveDate of a line with the EffectiveDate newer than the update line and the even KeyID.
    KeyID       EffectiveDate     InactiveDate
    1              01/01/2013      01/02/2013
    1              01/02/2013      01/03/2013
    1              01/03/2013
    2              12/31/2012      01/02/2013
    2              01/02/2013      01/03/2013
    2              01/03/2013
    I want to have a select script that shows
    KeyID       EffectiveDate        InactiveDate    New_InactiveDate
    1              01/01/2013                              01/02/2013
    1              01/02/2013                              01/03/2013
    1              01/03/2013
    2              12/31/2012                              01/02/2013
    2              01/02/2013                              01/03/2013
    2              01/03/2013
    Thanks for any help.

    Published by: 881656 on January 3, 2013 17:57

    Published by: 881656 on January 3, 2013 18:15

    Published by: 881656 on January 3, 2013 18:20

    Hello

    881656 wrote:
    I have a table with the columns and values

    KeyID       EffectiveDate     InactiveDate
    1              01/01/2013
    1              01/02/2013
    1              01/03/2013
    2              12/31/2012
    2              01/02/2013
    2              01/03/2013
    
    I need to update the InactiveDate of a row with the EffectiveDate of a row with the newer EffectiveDate than the row to be updated and with the same KeyID.
    
    KeyID       EffectiveDate     InactiveDate
    1              01/01/2013      01/02/2013
    1              01/02/2013      01/03/2013
    1              01/03/2013
    2              12/31/2012      01/02/2013
    2              01/02/2013      01/03/2013
    2              01/03/2013
    

    This sounds like a job for the analytical function of LEAD:

    MERGE INTO table_x     dst
    USING (
         SELECT  keyid
         ,     effectivedate
         ,     LEAD (effectivedate) OVER ( PARTITION BY  keyid
                                           ORDER BY         activedate
                                         )            AS inactivedate
          )               src
    WHEN MATCHED THEN UPDATE
    ON    (    src.id          = dst.id
          AND  src.effectivedate     = dst.effectivedate
          )
    SET     dst.inactivedate     = src.inactivedate
    ;
    
    I want to have a select script which shows
    
    KeyID       EffectiveDate        InactiveDate    New_InactiveDate
    1              01/01/2013                              01/02/2013
    1              01/02/2013                              01/03/2013
    1              01/03/2013
    2              12/31/2012                              01/02/2013
    2              01/02/2013                              01/03/2013
    2              01/03/2013
    

    Once that you have done the above MERGER, it is simply:

    SELECT    *
    FROM      table_x
    ORDER BY  keyid
    ,         effectivedate
    ;
    

    If you do not have sthe FUSION, then see the query in the USING clause of the MERGER.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
    In the case of a DML (UPDATE), for example, the sample data should show what looks like the tables before the DML, and the results will be the content of the table changed after the DML.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • ORA-12032: cannot use column rowid

    Hello
    8.1.7 I have the following error:
    ORA-12032: cannot use the rowid column of materialized view log on 'chain '. "' string '.
    The solution is:
    Action: A full refresh is necessary before the next quick update. Add columns ROWID in the materialized view log, if necessary.


    How can I do a complete refresh before the next fast refresh or ROWID columns add? How do I know whether the ROWID columns add?
    Thank you.

    PS:
    my script is:
    ................
    ..............
    START WITH TO_DATE (July 6, 2010 17:57:48 "," dd-mon-yyyy hh24:mi:ss')
    NEXT SYSDATE + 1/24

    user522961 wrote:
    Hello
    8.1.7 I have the following error:
    ORA-12032: cannot use the rowid column of materialized view log on 'chain '. "' string '.
    The solution is:
    Action: A full refresh is necessary before the next quick update. Add columns ROWID in the materialized view log, if necessary.

    How can I do a complete refresh before the next fast refresh or ROWID columns add? How do I know whether the ROWID columns add?
    Thank you.

    run up

    EXECUTE DBMS_MVIEW.REFRESH('MV_NAME','C');
    
  • ORA-22992: cannot use LOB Locators selected from the remote tables...

    Oracle 10.2.1.0.4
    Solaris 10

    We try to access a table in another database via a db_link.

    The table we are trying to access has a LOB.

    We get the following error: ora-22992: cannot use LOB Locators selected from the remote tables.

    Is there a way to get around this? We need the data in the BLOB field.

    Thank you.

    See on metalink:

    ORA-22992 has a workaround solution in 10 gr 2
    DOC - ID: 436707.1

    Werner

  • SQL error: ORA-01779: cannot modify a column that matches a key examine

    Hi all

    The requirement is that I have two tables s_party_d and S_CONTACT_d. the need to update the column name with FST_NAME | ',' | Last_name when column rowid in both tables are equal. I used the query previously below: -.

    Update
    (select
    E1. Name,
    e.FST_NAME,
    Select
    Of
    s_party_d e1,
    E S_CONTACT_d
    where
    E1. Game of ROW_ID = e.ROW_ID)
    name = FST_NAME | ',' | LAST_NAME;

    But I get the error message when executing the query

    Error in the command line: 31 column: 3
    Error report:
    SQL error: ORA-01779: cannot modify a column that is mapped to a table not preserved key
    01779 00000 - 'impossible to change a column that is mapped to a non-preserved table at key'
    * Cause: An attempt was made to insert or update columns in a join finds out who
    map to a table not kept the key.
    * Action: Change the directly underlying base tables.

    Can U please tell me why this error and how to solve?

    Thank you
    Mathon

    Mathon wrote:

    So, I have to look into some other method... I can't achieve this using a single update statement...

    Well, no matter what you do you need to decide what FST_NAME | ',' | Name to use. As I already pointed out for each line of the line of the s_party_d table there are several rows in table S_CONTACT_d. Again, you must yo decide what S_CONTACT_d table row you want to use. For example:

    update s_party_d e1
       set e1.name = (
                      select  max(e.FST_NAME) ||', '|| max(e.LAST_NAME)
                        from  S_CONTACT_d e
                        where e1.ROW_ID=e.ROW_ID
                     )
     where e1.ROW_ID in (
                         select  e.ROW_ID
                           from  S_CONTACT_d e
                        )
    /
    

    SY.

  • ORA-12054: cannot set the ON COMMIT...

    Hello
    can someone please tell me what am I missing here?
    I can't create a materialized view, but I can't understand why is this?
    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    PL/SQL Release 9.2.0.7.0 - Production
    CORE    9.2.0.7.0       Production
    TNS for HPUX: Version 9.2.0.7.0 - Production
    NLSRTL Version 9.2.0.7.0 - Production
    
    
    SQL> r
      1* select master,primary_key from user_mview_logs where MASTER='CIS_CASE' or master='CCR_ACTION_DEF'
    
    MASTER                         PRI
    ------------------------------ ---
    CCR_ACTION_DEF                 NO
    CIS_CASE                       NO
    
    
    
    SQL> r
      1  SELECT a.table_name, a.constraint_name, a.constraint_type, b.column_name
      2    FROM user_constraints a, user_cons_columns b
      3   WHERE a.constraint_name = b.constraint_name
      4*    AND a.table_name IN ('CIS_CASE', 'CCR_ACTION_CASES')
    
    TABLE_NAME                     CONSTRAINT_NAME                C COLUMN_NAME
    ------------------------------ ------------------------------ - ----------------
    CCR_ACTION_CASES               ID_PK                          P ID
    CIS_CASE                       PK_CIS_CASE                    P ID
    CIS_CASE                       SYS_C008496                    C ID
    
    
    
    SQL> CREATE MATERIALIZED VIEW mv
      2    REFRESH FAST ON COMMIT
      3  AS
      4  SELECT c.ID,
      5         CASE
      6            WHEN (c.script_id IS NULL OR c.queue_id IS NULL)
      7               THEN 1
      8            WHEN c.script_id IS NOT NULL AND c.queue_id IS NOT NULL
      9               THEN 2
     10         END TYPE,
     11         c.datum + a.due_time / 24 - a.alarm_due_time_1 / 24 alarm1,
     12         c.datum + a.due_time / 24 - a.alarm_due_time_2 / 24 alarm2,
     13         c.datum + a.due_time / 24 due_date
     14    FROM ccr_action_def a, cis_case c                                  --users u
     15   WHERE NVL (a.queue_id, NVL (c.queue_id, 0)) = NVL (c.queue_id, 0)
     16     AND NVL (a.type_id, NVL (c.case_code_type_id, 0)) =
     17                                                    NVL (c.case_code_type_id, 0)
     18     AND NVL (a.code_id,
     19              NVL (NVL (NVL (c.code_id_4, code_id_3), code_id_2), code_id_1)
     20             ) = NVL (NVL (NVL (c.code_id_4, code_id_3), code_id_2), code_id_1)
     21     AND (c.datum + a.due_time / 24 < SYSDATE)
     22     AND state IN (1, 2)
     23  UNION
     24  SELECT c.ID, 3 TYPE, a.due_date - a.alarm_due_time_1 / 24 alarm1,
     25         a.due_date - a.alarm_due_time_2 / 24 alarm2, a.due_date
     26    FROM ccr_action_cases a, cis_case c
     27   WHERE c.ID = a.cis_case_id
     28     AND (a.due_date < SYSDATE)
     29     AND state IN (1, 2);
      FROM ccr_action_cases a, cis_case c
           *
    ERROR at line 26:
    ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view

    Vili Dialis wrote:
    Rob, if you have any comments on my last query operation, I would be greatfull.

    Vili,

    You must start with a join view which does not contain any aggregate. Just a join of the ccr_action_def and cis_case. And don't forget to include the two table rowid to make quickly updatable. Then create a full blown newspaper on top of the join mv materialized view and create mv aggregation, selecting in the mv to join.

    Kind regards
    Rob.

    Published by: Rob van Wijk on 14-dec-2009 12:09

    And two boards that are not linked mv:

    (1) as has said, use a.id and c.id in a group by clause for the query itself work
    (2) do not use the string ' 14.12.09", use a date but you compare it with a date. So use: date "2009-12-14'

Maybe you are looking for