Tabular form on a view :ORA-01446: cannot select ROWID from, or sample...

Hi,
I have two tables
CUSTOMERS
===========
Name Null Type
======================
CUST_UID NOT NULL NUMBER(4)
CUST_NAME VARCHAR2(50)
ITEM_PRICES
===========
Name Null Type
======================
IP_UID NOT NULL NUMBER(4)
IP_ITEM_DESC VARCHAR2(50
IP_COST_PRICE NUMBER(6,2)
IP_SELL_PRICE NUMBER(6,2)
I have a view IPS_VW which is the cartician product of CUSTOMERS and ITEM_PRICES, and an instead of trigger for UPDATE on this view which either inserts or updates data in the following third table
ITEM_PRICES_SPECIAL
===========
Name Null Type
======================
IPS_UID NOT NULL NUMBER(4)
CUST_UID NUMBER(4)
IP_UID NUMBER(4)
IPS_SELL_PRICE NUMBER(6,2)
The following is my view
SELECT 'A'||ROWNUM AS "IPSVW_UID",
0 AS "IPSVW_IPS_UID",
"CUSTOMERS"."CUST_UID" AS "IPSVW_CUST_UID",
"ITEM_PRICES"."IP_UID" AS "IPSVW_IP_UID",
"ITEM_PRICES"."IP_SELL_PRICE" AS "IPSVW_IPS_SELL_PRICE"
FROM "CUSTOMERS" "CUSTOMERS",
"ITEM_PRICES" "ITEM_PRICES"
WHERE NOT EXISTS
(SELECT 1
FROM "ITEM_PRICES_SPECIAL" "ITEM_PRICES_SPECIAL"
WHERE "ITEM_PRICES_SPECIAL"."IP_UID" ="ITEM_PRICES"."IP_UID"
AND "ITEM_PRICES_SPECIAL"."CUST_UID" ="CUSTOMERS"."CUST_UID"
UNION
SELECT 'B' ||ROWNUM AS "IPSVW_UID",
"ITEM_PRICES_SPECIAL"."IPS_UID" AS "IPSVW_IPS_UID",
"ITEM_PRICES_SPECIAL"."CUST_UID" AS "IPSVW_CUST_UID",
"ITEM_PRICES_SPECIAL"."IP_UID" AS "IPSVW_IP_UID",
"ITEM_PRICES_SPECIAL"."IPS_SELL_PRICE" AS "IPSVW_IPS_SELL_PRICE"
FROM "ITEM_PRICES_SPECIAL" "ITEM_PRICES_SPECIAL";
And this is the instead of trigger
CREATE OR REPLACE TRIGGER "TRG_IPSVW_UPDATE" INSTEAD OF
UPDATE ON IPS_VW REFERENCING NEW AS N FOR EACH ROW
BEGIN
IF :N.IPSVW_IPS_UID = 0 THEN
INSERT INTO ITEM_PRICES_SPECIAL
( CUST_UID, IP_UID,IPS_SELL_PRICE )
VALUES
( :N.IPSVW_CUST_UID,:N.IPSVW_IP_UID, :N.IPSVW_IPS_SELL_PRICE );
ELSE
UPDATE ITEM_PRICES_SPECIAL
SET IPS_SELL_PRICE = :N.IPSVW_IPS_SELL_PRICE
WHERE IPS_UID = :N.IPSVW_IPS_UID;
END IF;
END;
Everything works fine in SQLPLUS, if i update a rate in this view, a record is either inserted or updated in the third table.
But when i try to create a tabular form based on this view, i get the error
ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
Could someone help me please?
Thanks,
Allen

I think The tabular form needs to be able to identify some primary key and using a rownum concatenation cannot provide that.
Cheers
Kofi

Similar Messages

  • ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.

    Dears,
    i have this problem after i create tabular from depend on view
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    this a query that i use
    select
    "INVOICE_DET",
    "INVOICE_DET" INVOICE_DET_DISPLAY,
    "INVOICE_ID",
    "STORAGE_CODE",
    "ITEM_QNTY",
    "ITEM_PRICE",
    "BONS_QNTY",
    "DISC_VALUE",
    "TOT_VAL",
    "LOCATION_CODE",
    "BATCH_DET",
    "ITEM_CODE",
    "ITEM_NAME",
    "UOM_CODE",
    "UOM_NAME",
    "SIZE_CODE",
    "SIZE_NAME",
    "COLOR_CODE",
    "COLOR_NAME",
    "STOREG_BRCHAS_BATCHN",
    "EXPR_DATE",
    "PROD_DATE",
    "ITEM_DET_ID"
    from "#OWNER#"."BRCHAS_INVOICE_DET_VIEW"
    this the view i created
      CREATE OR REPLACE FORCE VIEW "RETAIL"."BRCHAS_INVOICE_DET_VIEW" ("INVOICE_DET", "INVOICE_ID", "STORAGE_CODE", "ITEM_QNTY", "ITEM_PRICE", "BONS_QNTY", "DISC_VALUE", "TOT_VAL", "LOCATION_CODE", "BATCH_DET", "ITEM_CODE", "ITEM_NAME", "UOM_CODE", "UOM_NAME", "SIZE_CODE", "SIZE_NAME", "COLOR_CODE", "COLOR_NAME", "STOREG_BRCHAS_BATCHN", "EXPR_DATE", "PROD_DATE", "ITEM_DET_ID") AS
      SELECT invoice_det, invoice_id, storage_code, item_qnty, item_price,
              bons_qnty, disc_value, tot_val, location_code, batch_det, item_code,
              item_name, uom_code, uom_name, size_code, size_name, color_code,
              color_name, storeg_brchas_batchn, expr_date, prod_date, item_det_id
         FROM (SELECT d.invoice_det, d.invoice_id, d.storage_code, d.item_qnty,
                      d.item_price, d.bons_qnty, d.disc_value, d.tot_val,
                      d.location_code, d.batch_det, i.item_code,
                      get_item_name (i.item_code) item_name, i.uom_code,
                      get_uom_desc (i.uom_code) uom_name, i.size_code,
                      get_size_name (i.size_code) size_name, i.color_code,
                      get_color_name (i.color_code) color_name,
                      dd.storeg_brchas_batchn, b.expr_date, b.prod_date,
                      i.item_det_id
                 FROM brchas_invoice_det d,
                      brchas_batch dd,
                      brchas_batch_det b,
                      item_uom_size_color i
                WHERE dd.storeg_brchas_batchinternn = b.storeg_brchas_batchinternn
                  AND d.batch_det = b.batch_det
                  AND b.item_det_id = i.item_det_id
                  AND d.batch_det IS NOT NULL
               UNION ALL
               SELECT d.invoice_det, d.invoice_id, d.storage_code, d.item_qnty,
                      d.item_price, d.bons_qnty, d.disc_value, d.tot_val,
                      d.location_code, d.batch_det, i.item_code,
                      get_item_name (i.item_code) item_name, i.uom_code,
                      get_uom_desc (i.uom_code) uom_name, i.size_code,
                      get_size_name (i.size_code) size_name, i.color_code,
                      get_color_name (i.color_code) color_name,
                      NULL storeg_brchas_batchn, NULL expr_date, NULL prod_date,
                      i.item_det_id
                 FROM brchas_invoice_det d, item_uom_size_color i
                WHERE d.item_det_id = i.item_det_id
                AND d.batch_det IS NULL) ;
      CREATE OR REPLACE TRIGGER "RETAIL"."BRCHAS_INVOICE_DET_VIEW_TRG"
    INSTEAD OF DELETE OR INSERT OR UPDATE
    ON RETAIL.BRCHAS_INVOICE_DET_VIEW
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    V_PRICE NUMBER;
    V_BONUS_QNTY NUMBER;
    V_DISC_VAL NUMBER;
    BEGIN
      IF INSERTING THEN
          INSERT INTO BRCHAS_INVOICE_DET
          (INVOICE_DET,
          INVOICE_ID ,
          STORAGE_CODE,
          ITEM_QNTY,
          ITEM_PRICE,
          BATCH_DET,
          BONS_QNTY,
          TOT_VAL,
          LOCATION_CODE,
          DISC_VALUE,
          CREATED_USER,
          CREATED_DATE,
          ITEM_DET_ID
          VALUES
          ("BRCHAS_INVOICE_DET_SEQ".nextval,
          :NEW.INVOICE_ID ,
          :NEW.STORAGE_CODE,
          :NEW.ITEM_QNTY,
          :NEW.ITEM_PRICE,
          :NEW.BATCH_DET,
          :NEW.BONS_QNTY,
          (:NEW.ITEM_QNTY * NVL(:NEW.ITEM_PRICE,0)) - NVL(:NEW.DISC_VALUE,0),
          :NEW.LOCATION_CODE,
          :NEW.DISC_VALUE,
          nvl(v('APP_USER'),user),
          sysdate,
          :NEW.ITEM_DET_ID);
      ELSIF UPDATING THEN
            UPDATE BRCHAS_INVOICE_DET
            SET INVOICE_ID    =:NEW.INVOICE_ID,
                STORAGE_CODE  =:NEW.STORAGE_CODE,
                ITEM_QNTY     =:NEW.ITEM_QNTY,
                ITEM_PRICE    = :NEW.ITEM_PRICE,
                BATCH_DET     =:NEW.BATCH_DET,
                BONS_QNTY     = :NEW.BONS_QNTY,
                TOT_VAL       =(:NEW.ITEM_QNTY * NVL(:NEW.ITEM_PRICE,0)) - NVL(:NEW.DISC_VALUE,0),
                LOCATION_CODE =:NEW.LOCATION_CODE,
                DISC_VALUE    = :NEW.DISC_VALUE,
                ITEM_DET_ID =:NEW.ITEM_DET_ID
            WHERE INVOICE_DET =:NEW.INVOICE_DET;
      ELSE
            DELETE FROM BRCHAS_INVOICE_DET
             WHERE INVOICE_DET =:OLD.INVOICE_DET;
      END IF;
       EXCEPTION
         WHEN OTHERS THEN
           -- Consider logging the error and then re-raise
           RAISE;
    END BRCHAS_INVOICE_DET_VIEW_TRG;
    ALTER TRIGGER "RETAIL"."BRCHAS_INVOICE_DET_VIEW_TRG" ENABLE;
    please i need help
    Thanks
    Ahmed

    Hi,
    This might help
    http://www.techonthenet.com/oracle/errors/ora01446.php
    Regards,
    Jari

  • ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP

    In my data model (load from a database) there is this data control and its accessor return.
    When I drag the accessor return inside a jsf page I create a adf read only table (that has about 5000 rows), the I run the page and it works.
    Since I want to display only 20 ( or 50 or 100 is the same) rows for each page I had changed the access mode from the default value "Scrollable" to "Range Paging" and then I ve selected range size 50.
    Now if I run hte jsf page there are no data to display and if I press the small triangles to order the column or insert a word in the filter field I have the message ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP.
    I dont know how to do to solve this problem.
    Stefano

    An other thing.
    I solved this problem, maybe I dont understand the meaning of access mode and range size , since every value I choose of these 2 fields the visualization of the table doesnt change.

  • Ora 01446 cannot select rowid from, or sample....

    Hi All,
    I get this error if I try to test my query. "ora 01446 cannot select ROWID from, or sample, a view with DISTINCT,GROUP BY,etc"..Can anyone tell me what does this error represent and how will i be able to resolve it.
    FYI the jDeveloper version is 11.1.1.4.0

    Hi Timo,
    I faced this error while creating a view object. Yes its working fine in SQL worksheet.
    The query looks as below:
    SELECT DISTINCT Wfcommentsentity.UPDATEDBY,A.UPDATEDBYDISPLAYNAME,Wfcommentsentity.COMMENTDATE,Wfcommentsentity.TASKID,Wfcommentsentity.ROWID FROM WFCOMMENTS Wfcommentsentity,
    (SELECT DISTINCT UPDATEDBYDISPLAYNAME, UPDATEDBY,TASKID FROM WFTASKHISTORY WHERE TASKID = :Task_Id OR TASKGROUPID = :Task_Id)A
    WHERE A.UPDATEDBY = Wfcommentsentity.UPDATEDBY
    AND A.TASKID = Wfcommentsentity.TASKID order by Wfcommentsentity.ROWID

  • V4.0 - Tabular form ORA-01445: cannot select ROWID from, or sample,

    Hi
    I'm creating a tabular form in version 4.0.
    The select is based on three tables all of which have primary keys, and the keys are selected, but every time I run the page I get the following error:-
    failed to parse SQL query:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    The query runs just fine in TOAD
    Any ideas?
    Thanks
    Mike
    select
    PRL.PERF_RATING_LINE_ID,
    PRL.PERF_RATING_LINE_ID PERF_RATING_LINE_ID_DISPLAY,
    PRL.BUSINESS_UNIT,
    PRL.EMPLID,
    ''''||PRL.REVIEW_YEAR REVIEW_YEAR,
    PRL.REVIEW_PERIOD,
    PRL.PERFORMANCE_SCORE,
    PRL.MODERATED_SCORE,
    PRL.HRM,
    PRL.COMMENTS,
    PBR.BU_DESC,
    ''''||PBR.DEPTID DEPTID,
    PBR.DEPT_DESC,
    PBR.EMPLOYEE_NAME,
    PBR.GRADE,
    PRL.SCORE_APPROVED_BY,
    PBR.TEMP_PERM,
    PBR.GENDER,
    PBR.JOB_START_DATE,
    decode(DECODE(SUBSTR(PBR.FLAG,1,5),'Job s',substr(PBR.FLAG,instr(PBR.FLAG,'~',1)+2,3)),
    'HIR','Hired','XFR','Transfer','REH','Rehire')||
    decode(SUBSTR(PBR.FLAG,1,30),'Job starts during period ~ XFR',' - '||substr(PBR.FLAG,instr(PBR.FLAG,'~',1,2)+2)) JOB_START_DETAILS,
    PBR.APPOINTMENT_DATE,
    SUBSTR(PBR.JOB_END_DETAILS,INSTR(PBR.JOB_END_DETAILS,'~',1,2)+2) JOB_END_DATE,
    SUBSTR(PBR.JOB_END_DETAILS,INSTR(PBR.JOB_END_DETAILS,'~',1,1)+2,INSTR(PBR.JOB_END_DETAILS,'~',1,2)-INSTR(PBR.JOB_END_DETAILS,'~',1,1)-2) REASON,
    PBR.JOB_GROUP,
    PBR.JOB_GROUP_DESC,
    PBR.JOBCODE,
    PBR.JOBCODE_DESC JOB_DESC,
    PBR.JOB_FAMILY,
    PBR.JOB_FAMILY_DESC,
    PBR.PBR_ID,
    MD.MGR_DEPT_ID
    from PERFORMANCE_BASE_REFRESH_V PBR,
    PERFORMANCE_RATING_LINE PRL,
    Y00_OPR_MGR_DEPT MD
    WHERE (PRL.BUSINESS_UNIT = PBR.BUSINESS_UNIT
    AND PRL.EMPLID = PBR.EMPLID
    AND PRL.REVIEW_YEAR = PBR.REVIEW_YEAR
    AND PRL.REVIEW_PERIOD = PBR.REVIEW_PERIOD)
    AND MD.OPRID = :APP_USER
    AND INSTR(':'||MD.DEPTS_MANAGED||':',':'||PBR.DEPTID||':') > 0
    AND MD.MGR_DEPT_ID > 0
    AND PBR.ADMIN_CENTRE IN
    (select c.deptid AC
    from [email protected] A,
    [email protected] 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(PBR.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.GRADE = :P2210_GRADE)
    AND (:P2210_PERM_TEMP IS NULL
    OR PBR.TEMP_PERM = :P2210_PERM_TEMP)
    AND SUBSTR(NVL(PBR.JOB_END_DETAILS,'XXX'),1,3) NOT IN ('TER','TOC')
    AND PRL.SCORE_APPROVED_BY IS NULL

    Hi Marc,
    Thanks again for the quick reply and all the support the dev team is providing to us.
    Couple of question finally on this issue:
    - fixing the "copy page"/"copy validation" bug, our workaround - by making a page copy - we've found to use the standard validation on tabular form based on complex views will go away, right?
    - I made a sql trace when running the originally created tabular form page and I found the statement generated by the apex engine which gives the ORA-01446. Just wondering, would it be possible that apex is using the PK defined during the wizard instead of the rowid?
    - If not, would it be a possible enhancement request in the future to let the developer name the ROWID column optionally, and then apex will use that column as rowid instead of the ROWID? This can give flexibility for us as developers, in this case complex views (with instead of triggers) can be standard way supported. What I mean exactly is to create the above view in the testcase as follows (most of these cases there is always a base table in the view, and the rest of the tables are used as lookups, so I can pick up the desired ROWID in the view with an alias):
    CREATE OR REPLACE VIEW  CUSTOMER_ORDERS_V  AS
      SELECT cus.customer_id,
                cus.cust_last_name,
                cust_first_name,
                cus.cust_city,
                COUNT (ord.order_id) order_count,
                CUS.ROWID ROW_ID
           FROM demo_customers cus, demo_orders ord
          WHERE ord.customer_id(+) = cus.customer_id
       GROUP BY cus.customer_id,
                cus.cust_last_name,
                cust_first_name,
                cus.cust_city,
                CUS.ROWID;and then at design time, I could pick up the ROW_ID column as rowid, so all the rest of the functionality could work as working now on simple views and tables.
    What do you think on that?
    best regards,
    Peter

  • " ORA-01445: cannot select ROWID from, or sample, a join view without a key

    GREETINGS !
    CREATED TABULAR FORM WITH QUERY
    WHILE EXECUTE ON SQL COMMANDS ITS EXECUTES AND SHOWS RECORDS, PASTE SAME QUERY ON TABULAR FORM SOURCE . WHEN RUN PAGE IT GIVES ERROR
    " ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table".
    Edited by: Omzz on Oct 3, 2012 10:34 PM

    When setting the tabular form, only use the table that you are trying to update/modify.
    After that is working, modify the SQL source with the other tables.
    By just pasting an SQL query into the region source, it doesnt know what tables you are trying to update
    PS - Please turn off "Caps Lock" :-)

  • ORA-01445: cannot select ROWID from, or sample, a join view without a key-p

    Hi All,
    I am facing issue with one sql query. It is giving me error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    I am not getting any clue to solve this. On internet, i didn't find proper reason for this error and troubleshooting way and solution for this error. Everywhere i saw one sentence, "Key preserved means the row from the base table will appear AT MOST ONCE in the output view on that table" but it didn't solve my problem.
    I have 1099 columns in one select query. so avoiding the actual column list in select clause. Instead I am trying to select ROWIDs from all tables in join. My understanding is ROWID is a unique identifier in table not in database. But though I remove ROWIDs, I get same error. So please don't bother about these ROWIDs.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,DIM_SEC.ROWID AS ABC3
    ,DIM_SEC_ADJ.ROWID AS ABC4
    ,DIS_CAT.ROWID AS ABC5
    ,CTRY.ROWID AS ABC6
    ,BCP.ROWID AS ABC7
    ,STAGE.ROWID AS ABC8
    FROM FACT_POSITION FACT
    LEFT JOIN FACT_POSITION_ADJ FACT_ADJ ON FACT.POSITION_PKID = FACT_ADJ.POSITION_FKID
    LEFT JOIN DIM_SOURCE_SYSTEM SOURCE ON FACT.SOURCE_SYSTEM_FKID = SOURCE.SOURCE_SYSTEM_PKID
    LEFT JOIN DIM_SECURITY DIM_SEC ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC.SECURITY_PKID
    LEFT JOIN DIM_SECURITY_ADJ DIM_SEC_ADJ ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC_ADJ.SECURITY_PKID
    LEFT JOIN DIM_DISCLOSURE_CATEGORY DIS_CAT ON FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    LEFT JOIN COUNTRY_REFERENCE CTRY ON CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    LEFT JOIN BUSINESS_CLOSE_PERIOD BCP
    ON BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_LOCKED='Y' AND BCP.IS_ACTIVE='Y'
    LEFT JOIN GUI_STAGING STAGE ON
    FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5)
    WHERE FACT.POSITION_PKID=64524374;
    While trying to sort this error, I found interesting things that made me more confused.
    if I remove TO_DATE function from select clause, same join query works.
    If I remove any table from join and keep TO_DATE function in select clause, query works.
    That tells, there is no problem in query.
    Then please anyone help me to sort out the error. FYI. I have googled a lot for this error. but didn't get solution/clue. That is why I am posting this problem to forum.
    Thanks in advance. waiting for reply ASAP.
    Pravin Pujari
    [email protected]

    I think i got the solution. The syntax i was using (ANSI syntax) doesn't work in the oracle database version i am using.
    When i updated my query with older oracle syntax, it worked.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,SOURCE.ROWID AS ABC3
    ,DIM_SEC.ROWID AS ABC4
    ,DIM_SEC_ADJ.ROWID AS ABC5
    ,DIS_CAT.ROWID AS ABC6
    ,CTRY.ROWID AS ABC7
    ,BCP.ROWID AS ABC8
    ,STAGE.ROWID AS ABC8
    FROM [email protected] FACT
    ,[email protected] FACT_ADJ
    ,[email protected] SOURCE
    ,[email protected] DIM_SEC
    , [email protected] DIM_SEC_ADJ
    , [email protected] DIS_CAT
    , GUI.COUNTRY_REFERENCE CTRY
    , GUI.BUSINESS_CLOSE_PERIOD BCP
    , GUI.GUI_STAGING STAGE
    WHERE FACT.POSITION_PKID=64517140
    AND FACT_ADJ.POSITION_FKID(+) = FACT.POSITION_PKID
    AND SOURCE.SOURCE_SYSTEM_PKID=FACT.SOURCE_SYSTEM_FKID
    AND DIM_SEC.SECURITY_PKID=FACT.SUBSYS_SECURITY_FKID
    AND DIM_SEC_ADJ.SECURITY_PKID(+)=DIM_SEC.SECURITY_PKID
    AND FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    AND CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    AND BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_ACTIVE='Y'
    AND FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5);

  • Ora-01445 cannot select rowid from or sample a join view ?

    Hi All
    I get this error , while creating VO
    "ora-01445 cannot select rowid from or sample a join view without a key-preserved table"
    I created an EO, my table doesnt have primary key and it EO by deafualt created ROWID as primary key
    When i create VO, using the following query by joining fnd_flex_values , then i see this ORA error
    SELECT xxg2sourceacctneweo.elimination_sob_id, xxg2sourceacctneweo.ROWID
    FROM xxg2_elim_source_accts xxg2sourceacctneweo, fnd_flex_values fvs WHERE fvs.flex_value = xxg2sourceacctneweo.source_acct_value
    but I was able to get the results in TOAD, with out any issue.
    as a part of testing , if i change the query to join to fnd_user , it works fine
    SELECT XXG2SourceAcctNewEO.ELIMINATION_SOB_ID,
    XXG2SourceAcctNewEO.ROWID FROM xxg2_elim_source_accts XXG2SourceAcctNewEO,fnd_user fc where fc.user_id=XXG2SourceAcctNewEO.created_by
    Any suggestions?
    Thanks
    Ravi
    Edited by: rashmrs on Oct 6, 2009 9:47 PM

    Ravi,
    Please mark some attributes as PRimary Key in your VO. Then the system would not automatically generate the ROWID. You can remove this View attribute using the VO wizard.
    Regards
    Sumit

  • ORA-01446: cannot select ROWID from view with DISTINCT, GROUP BY, etc.

    Hi,
    I have created view by joining two tables...And it is like this...
    Create view Test_Data as
    Select t.column1, t.column2, t.rowid from table1 t
    union s.column1,s.column2, s.rowid from table2 s
    with read only...
    Now I executed the following stmt...
    Select * from Test_Data where rowid = objid_ where I am passing the objid_ value...But it gave me the above error...can not I run this select stmt using the rowid ?
    Any input is highly appreciated...
    Thanks And Best Regards,
    /Dinesh...
    Hi All Again,
    I created the view in the following way...Just to check...
    CREATE VIEW my_view AS
    SELECT t.col1 col1,
    t.col2 col2,
    t.rowid objid
    FROM table1 t
    WHERE rownum < 400
    UNION
    SELECT q.col1 col1,
    q.col2 col2,
    q.rowid objid
    FROM table2 q
    WITH read only;
    Then I executed the following stmt...
    Select * from my_view where rowid = objid_
    Then I did not get that Oracle Error ORA-01446, Does anybody have any clue regarding this matter, i.e. how the use of rownum solve this prob...
    Thanks And Best Regards,
    /Dinesh...
    Edited by: user521478 on Aug 9, 2010 4:46 PM

    Check this:
    SQL> create view my_view as select rowid rd from dual;
    View created.
    SQL> select * from my_view;
    RD
    AAAACsAABAAAAGiAAA
    SQL> select * from my_view where rd = 'AAAACsAABAAAAGiAAA';
    RD
    AAAACsAABAAAAGiAAA
    SQL> So your create view statement should be:
    Create view Test_Data as
    Select t.column1, t.column2, t.rowid rd from table1 t
    union s.column1,s.column2, s.rowid from table2 s
    with read onlyThen try:
    Select * from Test_Data where rd = objid;Edited by: AP on Jul 28, 2010 2:19 AM

  • SQL Developer 3.1 EA3:   ORA-01446: cannot select ROWID . . .

    I'm running into a problem in 3.1 EA3 that I did not see in 3.0 (Oracle IDE     3.0.04.34). Both Installations are 64 bit using 64 bit Java under Windows 7 x64 SP1.
    When from either the "Connections" or "Schema" window I open some views and select the "Data" tab I the following messages:
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    ORA-02063: preceding line from HSDEVL
    twice. Other views give:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    ORA-02063: preceding line from HSDEVL
    All views that show the error retrieve the data via a dblink to another oracle instance, although not all views using the dblink show an error.
    Has anyone else seen this change? Is there anything I can do to get it fixed.
    Thanks.
    Tom True
    P

    I'm having the same issue. The issues seems to also exist in the newly release 3.1.
    Yes it seems to be related to the instead of trigger.
    Is this a known bug?
    Here is a testcase to reproduce the issue.
    create table mytab as select * from tab;
    create table myobjects as select * from user_objects;
    create or replace view test_view as
    select myobjects.object_id, mytab.tname, mytab.tabtype from mytab, myobjects where mytab.tname=myobjects.object_name group by myobjects.object_id, mytab.tname, mytab.tabtype;
    create or replace trigger io_test_view_trg
    INSTEAD OF INSERT or UPDATE or DELETE
    ON test_view
    FOR EACH ROW
    begin
    if updating then
    update mytab set tname=:NEW.tname, TABTYPE=:NEW.TABTYPE where tname=:OLD.tname;
    update myobjects set object_name=:NEW.tname where object_name=:OLD.tname;
    end if;
    end;
    show errors
    -- TEST
    select * from test_view;
    update test_view set tname='1TEST_TABLE' where rownum < 2;
    -- Attempting to view TEST_VIEW from SQL Developper fails with
    -- ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    -- CLEANUP
    drop table mytab;
    drop table myobjects;
    drop view test_view;
    ----

  • Error ORA-01446:cannot select ROWID  - Bug?

    Hi
    I am getting an error message in SQL Developer 3.0.04.34
    Error ORA-01446:cannot select ROWID from view with DISTINCT, GROUP BY, etc.
    (you can read the full details at http://www.techonthenet.com/oracle/errors/ora01446.php )
    when I create a view containing "DISTINCT" even though it doesn't have a rowid anywhere in the select.
    Is this a bug? The view seems to function well enough but sql developer itself seems to be struggling a bit.
    I have found accounts of similarish bugs on this site from about 2007 but relating to slightly different sets of circs, but if I am asking an old and obvious question then apologies in advance.
    C

    Hi C,
    Well, the question may be old (see at least: ORA-01446 error in SQL Developer 3EA4 but I doubt it's obvious.
    The simplest cases of create view ... as for the following selects
    select distinct deptno from dept; 
    select deptno, count(*) employees from emp group by deptno;work fine in all the 2.x, 3.x releases in the object viewer data tab. Of course, running a select which includes a rowid on these views from a worksheet will fail as expected.
    In such situations a simple, reproducible test case is always nice but, at a minimum, please provide a listing of the broken code and a description of exactly how/where in SQL Developer the error occurs.
    Regards,
    Gary Graham
    SQL Developer Team

  • Cannot select ROWID from, or sample, a join view without a key-preserve

    I'm getting an error "cannot select ROWID from, or sample, a join view without a key-preserved table" when performing an INSERT. There is no error when performing an UPDATE.
    I created a "Form with Reports" page, where the Reports is based on a view multi table join. The primary key I chose during the form creation process is "From Trigger". The primary key "ACCESS_ID" has been defined in the base table. On the view, I have created an INSTEAD OF TRIGGER, for both Insert and Update. The update seems to work. I am using the automatic row processing for the update and insert.
    Additional information: My insert works standalone i.e. i write
    insert into jxjplntr_access_v (col1, ...)
    values (va1, val2...)
    and it works when i run it on SQL window.
    access_id has a constraint defined as not null and also PK.
    I have an insert "instead of" trigger defined on the jxjplntr_access_v view.
    However, when i "CREATE" a record after filling in the values, I get the above error. BTW, here is the view definition:
    CREATE OR REPLACE VIEW jxjplntr_access_v (
    access_id,
    person_id,
    person_name,
    badge_number,
    ntr_resp_type,
    primary_flag,
    start_date_active,
    end_date_active,
    created_by,
    created_by_uname,
    creation_date,
    last_updated_by,
    last_updated_by_uname,
    last_update_date,
    last_update_login )
    AS
    select
    access_id,
    ja.person_id,
    initcap(p.last_name||', '||p.first_name) person_name,
    p.employee_number badge_number,
    ntr_resp_type,
    primary_flag,
    ja.start_date_active,
    ja.end_date_active,
    ja.created_by,
    f1.user_name created_by_uname,
    ja.creation_date,
    ja.last_updated_by,
    f2.user_name last_updated_by_uname,
    ja.last_update_date,
    ja.last_update_login
    from jplntr.jplntr_access ja
    ,fnd_user f1
    ,fnd_user f2
    ,per_people_x p
    where f1.user_id(+) = ja.created_by
    and f2.user_id(+) = ja.last_updated_by
    and p.person_id(+) = ja.person_id
    Thanks in advance.
    K
    Edited by: kktong on Dec 12, 2011 5:39 PM
    Edited by: kktong on Dec 13, 2011 10:06 AM

    I've just been looking at exactly the same problem. From my initial investigations, this seems to be a bug with Apex and creating a tabular form, as described in this thread here:
    v4.0 - Tabular form ORA-01445: cannot select ROWID from, or sample,
    Very frustrating!
    I hope thats of use to you. If I find out anything else, I'll come back and let you know.
    Simon
    Edited by: Simon Holt on 26-Jul-2012 03:32

  • What causes "ORA-01445: cannot select ROWID from" error

    While executing a SELECT query i got this error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a
    key-preserved table
    Below mentioned is the join condition part of the query. The line which the error has occured is italicized
    from checkout_hdtl ch
    inner join pmt_htl ph on ph.post_ln_a = ch.post_ln_code
    inner join pin_dls pd on pd.post_ln_a = ph.post_ln_code
    inner join carton_dtl cd on cd.carton_nbr = ch.carton_nbr
    and cd.lseq_nbr = pd.lseq_nbr
    inner join invoice_module im on cd.invevt_code = im.inv_code
    inner join item_dock_master del on nm.invent_code = iwm.inv_code
    left outer join inv_curr_comm_code mnb on ium.invent_code = im.inv_code
    and icc.cntry = ph.shipto_cntry
    left outer join vw_ver_master vw on vw.del_rec = ch.del_rec
    left outer join cmd code_entry on code_pi.cntry =
    cd.code_entry where ch.shpmt_nbr = '3'
    What do i do?

    I would rather use Notepad than store my data in SQL server. It just so happens that our product is released for SQL Server as well. Hence i did the testing.
    >Is there a limit to the number of joins that can be performed in Oracle?
    Wrong question as it does not have anything to do with the number of views.. it has everything to do with the ability to correctly identify the unique row. Re-read the error message details posted by Blu - it explains the error.As you can see from my post, i created a table using the(CTAS) SELECT query from the View vw_ver_master's definition. So the view's result set is now stored in a table and now there are only tables involved in these JOINS.
    The query will succeed if i comment out ANY one of these JOINS in this statement. This is so weird.
    I

  • ORA-01445 : cannot select rowid from a join view without a key preserved ta

    Hi,
    I am using Designer6i for generatin forms:
    my blokc is based on a view...
    when executing the module, I have the following error when trying to change a value of an item :
    FRM 40501: unabe to reserve record for update or delete ,
    the display error say :
    ORA-01445 : cannot select rowid from a join view without a key preserved table!!!!!
    Any help please ???

    you either create an INSTEAD OF trigger for that view or use on-lock trigger on that block to edit, e.g., SELECT ...INTO...FROM...WHERE...FOR UPDATE NOWAIT.

  • ORA-01445: cannot select ROWID from a join view without a key-preserved tab

    Hi All,
    I have 2 windows in a form. When i click on a button in first window, then 2nd window will be opened. (Note: both windows are based have master-details relationship with Table1 and Table2 respectively)
    When i enter the information in 2nd window and click the SAVE Button it has to save those values to database. It used to work fine earlier. now, i am getting the following error.
    FRM-40501: ORACLE error: unable to reserve record for update or delete.
    ORA-01445: cannot select ROWID from a join view without a key-preserved table
    Please help me, how can i resolve this error. Also, guide me what is a key-preserved table.
    Thanks in advance,
    Amar

    Firstly: - Please make sure that you have not opened the same record somewhere else in any other form and trying to update from there.
    Secondly: - In your window 1 have you opened the same record which you are querying, editing and saving in window 2 ? If yes then this will givbe you error as you are trying to update a record which is already being updated somewhere else.
    Please mark if it helps

Maybe you are looking for

  • Display Issues in browser

    Hi, Once we add a bullet(s) in Robohelp and publish, we see multiple type of displays in different browsers. Example: IN ROBOHELP: Text1 Text2 IN MOZILA FIREFOX (3.0.9):      Text1      Text2 (Space between bullet and Text is increased) IN IE-7: Text

  • Resource-Exception while mapping

    Hi, I'm getting an error "com.sap.aii.utilxi.misc.api.ResourceException: Connection is invalid" ...   <Trace level="3" type="T">Creating Java mapping com/sap/vv2/xi/mapping/OutboundMapping.</Trace>   <Trace level="1" type="T">Connection is invalid.</

  • Load/download photos and videos from iMessage

    Hi! Is it possible to load/download all sent and received photos and videos from iMessage during the time, from for example one person? Thank you.

  • Exporting keywords with image files

    Using LR1.2 under Windows XP I now do most of my initial processing of scans and digital imports in LR before exporting the selected images for final batch processing and refined tuning in PS CS2. However, having completed copious key wording in LR,

  • Urgent Weblogic startup

    Hi, I deleted startweblogic.cmd in my domain.I want start my domain now. Kindly help me. Regards, J Manivel