Primary key = rowid???

Hi all,
I created a page from a SQL procedure.
I call my page from another page, I have my data.
Now I want to change the value in a field, but when I click “Save” I have an error.
I open the debug and after the error I find:
0.03803
0.00061
Session State: Save form items and p_arg_values
4
0.03865
0.00032
...Session State: Save "P30_PK_DA_SUIVI_TEMPS" - saving same value: "81"
4
0.03898
0.00091
...Session State: Save "P30_FK_ID_DA" - saving same value: "181"
4
0.03988
0.00034
...Session State: Saved Item "P30_NUM_JJ_ESTIME" New Value="1"
4
0.04021
0.00035
...Session State: Save "P30_NUM_JJ_REEL" - saving same value: "26"
4
0.04057
0.00038
...Session State: Save "P30_NUM_JJ_ANALYSE_ESTIME" - saving same value: "0"
4
0.04094
0.00036
...Session State: Save "P30_NUM_JJ_ANALYSE_REEL" - saving same value: "0"
4
0.04130
0.00034
...Session State: Save "P30_NUM_JJ_DEVELOPPEMENT_ESTIM" - saving same value: "0"
4
0.04164
0.00033
...Session State: Save "P30_NUM_JJ_DEVELOPPEMENT_REEL" - saving same value: "0"
4
0.04196
0.00035
...Session State: Save "P30_NUM_JJ_TEST_ESTIME" - saving same value: "0"
4
0.04232
0.00031
...Session State: Save "P30_NUM_JJ_TEST_REEL" - saving same value: "0"
4
0.04263
0.00027
...Session State: Save "P30_NUM_JJ_DOCUMENTATION_ESTIM" - saving same value: "0"
4
0.04290
0.00015
...Session State: Save "P30_NUM_JJ_DOCUMENTATION_REEL" - saving same value: "0"
4
0.04304
0.00014
Processes - point: ON_SUBMIT_BEFORE_COMPUTATION
4
0.04319
0.00010
Branch point: Before Computation
4
0.04328
0.00005
Process point: AFTER_SUBMIT
4
0.04333
0.00041
Tabs: Perform Branching for Tab Requests
4
0.04375
0.00010
Branch point: Before Validation
4
0.04385
0.01056
Validations:
4
0.05441
0.00882
Perform basic and predefined validations:
4
0.06323
0.00042
Perform custom validations:
4
0.06365
0.00130
...Validation "P30_DAT_CREATION must be timestamp" - Type: ITEM_IS_TIMESTAMP
4
0.06495
0.00029
...Validation "P30_DAT_MODIFICATION must be timestamp" - Type: ITEM_IS_TIMESTAMP
4
0.06524
0.00007
Branch point: Before Processing
4
0.06531
0.00007
Processes - point: AFTER_SUBMIT
4
0.06537
0.00337
...Process "Process Row of TBL_DA_SUIVI_TEMPS" - Type: DML_PROCESS_ROW
4
0.06875
0.00162
...Execute Statement: begin begin select into from "HORSES"."TBL_DA_SUIVI_TEMPS" where "PK_DA_SUIVI_TEMPS" = :p_rowid for update ; end; end;
4
0.07037
0.00024
Add error onto error stack
4
0.07062
0.00010
...Error data:
4
0.07071
0.00007
......message: ORA-06550: Ligne 1, colonne 22 : PL/SQL: ORA-00936: expression absente ORA-06550: Ligne 1, colonne 14 : PL/SQL: SQL Statement ignored
4
0.07077
0.00005
......additional_info: ORA-06550: Ligne 1, colonne 22 : PL/SQL: ORA-00936: expression absente ORA-06550: Ligne 1, colonne 14 : PL/SQL: SQL Statement ignored
4
0.07082
0.00004
......display_location: INLINE_IN_NOTIFICATION
4
0.07088
0.00009
......is_internal_error: false
4
0.07096
0.00008
......ora_sqlcode: -6550
4
0.07103
0.00009
......ora_sqlerrm: ORA-06550: Ligne 1, colonne 22 : PL/SQL: ORA-00936: expression absente ORA-06550: Ligne 1, colonne 14 : PL/SQL: SQL Statement ignored
4
0.07112
0.00007
......error_backtrace: ORA-06512: à "SYS.DBMS_SYS_SQL", ligne 1325 ORA-06512: à "SYS.WWV_DBMS_SQL", ligne 1022 ORA-06512: à "SYS.WWV_DBMS_SQL", ligne 1091 ORA-06512: à "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", ligne 832 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 552 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 725 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 871 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 1701 ORA-06512: à "APEX_040200.WWV_FLOW_PROCESS", ligne 364
4
0.07119
0.00007
......component.type: APEX_APPLICATION_PAGE_PROCESS
4
0.07126
0.00007
......component.id: 36252525824016323948
4
0.07134
0.00053
......component.name: Process Row of TBL_DA_SUIVI_TEMPS
4
0.07187
0.00024
Show current page with inline errors
Why my primary key is = :p_rowid?
...Execute Statement: begin begin select into from "HORSES"."TBL_DA_SUIVI_TEMPS" where "PK_DA_SUIVI_TEMPS" = :p_rowid for update ; end; end;
Where can I change this?
Many thanks.

The error it occurring here:
0.06537
0.00337
...Process "Process Row of TBL_DA_SUIVI_TEMPS" - Type: DML_PROCESS_ROW
4
This is an "Automatic DML Process" (which is related to the "Automatic Row Fetch")
The format of the SQL that is throwing the error seems to indicate that none of the OPs Items have "Source Type" defined as "Database Column".
I've only seen that information automatically defined when I use "Form on Table".  OP used "Form on SQL" or "Form on Procedure";  I doubt either one will automagically set "Source Type" to "Database Column".
As far as "Primary Key" is concern, same thing as what Amanda said. (just a different Process).
MK

Similar Messages

  • USE ROWID AS PRIMARY KEY OF ENTITY ON EJB3

    When we launch the Create Entities from Tables wizard, and create JPA (Java Persistence API) entities from existing database tables, if the table has no primary key and unique key field, you will get a warning. When you run, you will get the following information:
    Caused by: Exception [TOPLINK-7161] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: Entity class [class model.Test] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass.
    Actually, every row of oracle table has a ROWID field , I think it is a good “primary key field”. Add it into Entity Java bean file as following:
    @Id
    private ROWID rowid;
    And generate accessors, ok, run……
    GOOD, No problem.
    But when you insert a new row, got an exception:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00928: missing SELECT keyword
    Error Code: 928
    Call:INSERT INTO TEST (ROWID, B, A) VALUES (?, ?, ?)
         bind => [null, 555, 555]
    Query:InsertObjectQuery(model.Test@40979b)
    555~~~, what happened?! Somebody builds a wrong SQL …
    Don’t worry! I know (…) where is the “bug”.
    Find out the class
    oracle.toplink.essentials.internal.expressions. SQLInsertStatement
    which is included in the toplink-essentials.jar,
    decompile… , fix…, compile, and jar it back.
    Fix
    if(field.getTable().equals(getTable()) || !field.hasTableName())
    to
    if((field.getTable().equals(getTable()) || !field.hasTableName()) && !field.getName().equalsIgnoreCase("ROWID"))
    OK, it is running well.
    I suggest ORACLE fix it into his next version. Do you think it is a good idea?

    Do you think it is a good idea? Not really, but that's just my two cents.

  • How do I use Primary Key and RowID in Materialized View Logs and MVs

    How do I use Primary Key and RowID in Materialized View Logs and Materialized Views????
    I don’t understand in the Materalized View Logs the diference between Primary Key and RowID. Besides, I could choose both Primary Key and RowID.
    When I have to use RowID?? Why?? And Primary Key??? And both, Primary Key and RowID????
    Thank you very much!

    Yes, I have already read it...
    But for example I don’t Understand:
    This is the example 8-1
    CREATE MATERIALIZED VIEW LOG ON products
    WITH SEQUENCE, ROWID
    (prod_id, prod_name, prod_desc, prod_subcategory, prod_subcat_desc, prod_
    category, prod_cat_desc, prod_weight_class, prod_unit_of_measure, prod_pack_
    size, supplier_id, prod_status, prod_list_price, prod_min_price)
    INCLUDING NEW VALUES;
    But if I create a Materialized View with TOAD if I choose a KEY field I receive the error:
    ORA-12026: invalid filter column detected
    Then I have to take out the Key (in the above example prod_id)
    And then the script is
    CREATE MATERIALIZED VIEW LOG ON products
    WITH ROWID, SEQUENCE, PRIMARY KEY!!!!!!!!!!!!!!!!!!!!
    (prod_id, prod_name, prod_desc, prod_subcategory, prod_subcat_desc, prod_
    category, prod_cat_desc, prod_weight_class, prod_unit_of_measure, prod_pack_
    size, supplier_id, prod_status, prod_list_price, prod_min_price)
    INCLUDING NEW VALUES;
    I have PRIMARY KEY in the definition (I don’t choose it) and I don’t have the prod_id field
    Why is it????
    Note: If I execute the script to create the MV Log manually the PRIMARY KEY option NO IS in the script and the prod_id field either is in the script.
    And on the other hand,
    What is this:
    CREATE MATERIALIZED VIEW LOG ON sales
    WITH ROWID;
    CREATE MATERIALIZED VIEW LOG ON times
    WITH ROWID;
    CREATE MATERIALIZED VIEW LOG ON customers
    WITH ROWID;
    These MATERIALIZED VIEW LOG contain any fields????
    Or it contain the primary key fields of this tables (sales, times and customers)??? Then, Why is it ROWID instead of PRIMARY KEY????
    Thanks!

  • No primary key attribute and does not support rowId -- URGENT : ADF Swing

    Hi , i have created a view and while create Entity Object through Business Components wizard for that view i am getting following error.
    ENTITY CREATION FAILED FOR THE FOLLOWING DATABASE OBJECT
    NO PRIMARY KEY ATTRIBUTES AND DOES NOT SUPPORT ROWID . USE ENTITY WIZARD TO CREATE THE ENTITY OBJECT.
    very urgent.
    Jdeveloper version :: 10.1.3.1.0
    oracle version :: 10g
    view script is :
    SELECT
    oh.order_number||'- ('||ol.line_number||'-'||ol.shipment_number||')' so_line,
    oh.cust_po_number customer_po,
    ol.flow_status_code status,
    ol.shipping_method_code carrier,
    ol.ordered_item item_no,
    nvl(xxapplication_express_pkg.getcustomerpart(ol.inventory_item_id, hca.cust_account_id), ' ') customer_item_number,
    nvl(mtl.description , 'na') description,
    nvl(org.organization_name , 'oak park') ship_from,
    hcsu.location||' ('||hl.city||' '||hl.state||' '||hl.postal_code||')' ship_to,
    nvl(ol.promise_date, sysdate) promised_date,
    nvl(ol.ordered_quantity, 0) order_quality ,
    xxapps.xx_eg_calculated_onhand(ol.line_id) available_qty,
    nvl(ol.shipped_quantity, 0) shipped_quality ,
    ol.order_quantity_uom uom,
    hp.party_name customer_name,
    jrs.name sales_person_name,
    0 refer
    FROM
    oe_order_headers_all oh,
    oe_order_lines_all ol,
    hz_cust_accounts hca,
    hz_parties hp ,
    hz_cust_site_uses_all hcsu,
    hz_cust_acct_sites_all hcas,
    hz_party_sites hps,
    hz_locations hl,
    org_organization_definitions org ,
    mtl_system_items_b mtl ,
    jtf_rs_salesreps jrs
    WHERE
    oh.header_id = ol.header_id and
    oh.org_id = ol.org_id and
    oh.sold_to_org_id = hca.cust_account_id and
    hca.party_id = hp.party_id and
    hcas.cust_account_id = hca.cust_account_id and
    hcsu.cust_acct_site_id = hcas.cust_acct_site_id and
    hcas.party_site_id = hps.party_site_id and
    hps.location_id = hl.location_id and
    hcsu.site_use_id = oh.ship_to_org_id and
    hcsu.site_use_code = 'SHIP_TO' and
    org.organization_id = ol.ship_from_org_id and
    org.organization_id = mtl.organization_id and
    ol.inventory_item_id = mtl.inventory_item_id and
    ol.ship_from_org_id = mtl.organization_id and
    ol.salesrep_id = jrs.salesrep_id and
    ol.org_id = jrs.org_id
    can i know will it check for any constraints while correlation multiple table or whether this type of exception can be sorted out .
    need help looking forward to reply...
    Regards
    bhanu prakash
    Message was edited by:
    user579125
    Message was edited by:
    user579125

    User,
    I assume that this is for read-only activity. If so, don't create an EO from the database view; create a read-only view object instead. The only reason you'd want to use an Entity Object is if you were going to insert/update through the EO; unless you have an instead-of trigger, this database view is non-insertable/non-updatable.
    Short answer: I think what you want to do is a read-only View Object (not EO) - put "select x, y, z (your columns) from view_name" as the SQL.
    John

  • View object SponsorVwView does not include a primary key attribute RowId

    Hi,
    I have an Entity Object and a View Object which do not have a primary key. So I use a ROWID to act as one. The only thing is that sometimes I get this error which causes the application to fail on the server:
    JBO-30003: The application pool (gov.fda.cber.pts.model.services.CberPtsServiceLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.PersistenceException, msg=JBO-26028: View object SponsorVwView does not include a primary key attribute RowId of entity base SponsorVw.
    Does anyone have any any ideas on this?
    Thank you in advance

    Hi...
    I believe you'll need a PK so Oracle will know how to update the MV. Is there any particular reason for you not having a PK in FAFG_ASSETS table? As an alternative, you may want to create a new column in this table and having a table trigger/sequence populating this column.
    But It looks like you are using EBS, so, I don't know if you can add new columns to tables.
    See if this thread can help you:
    Re: ORA-12014: table 'XXX' does not contain a primary key constraint
    Regards,
    Marcos

  • What is the diffrence between Row id and primary key ?

    dear all
    my question is about creating materialized views parameters (With Rowid and
    With Primary kry)
    my master table contains a primary key
    and i created my materialized view as follow:
    CREATE MATERIALIZED VIEW LV_BULLETIN_MV
    TABLESPACE USERS
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    AS
    SELECT
    BCODE ID, BTYPE BTYPE_ID,
    BDATE THE_DATE,SYMBOL_CODE STOCK_CODE,
    BHEAD DESC_E, BHEADARB DESC_A,
    BMSG TEXT_E, BMSGARB TEXT_A,
    BURL URL, BTIME THE_TIME
    FROM BULLETIN@egid_sefit;
    I need to know is there a diffrence between using (with row id) and (with primary key) on the performance of the query?

    Hi again,
    fast refreshing complex views based on rowids, according to the previous subject.
    (You're example shows that) are not possible.
    Complex remote (replication) snapshots cannot be based on Rowid too.
    for 10.1
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_6002.htm#sthref5054
    for 10.2
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#sthref6873
    So I guess (didn't check it) that this applies ONLY to replication snapshots.
    This is not documented clearly though (documentation bug ?!)
    Documentation states that the following is generally not possible with Rowid MVIEWS:
    Distinct or aggregate functions
    GROUP BY or CONNECT BY clauses
    Subqueries
    Joins
    Set operations
    Rowid materialized views are not eligible for fast refresh after a master table reorganization until a complete refresh has been performed.
    The main purpose of my statements was to try to give a few tips how to avoid common problems with this complex subject, like for example: being able to CREATE an MVIEW with fast refresh clause does not really guarantee that it will refresh fast in the long run (reorganisation, partition changes) if ROWID based, further the rowid mviews have limitations according to the documentation (no group by, no connect by, link see above) plus fast refresh means only to use filter columnns of the mview logs, plus for aggregates you need additional count (*) pseudo columns.
    kind regards
    Karsten

  • How to speed up fast refresh of materialized view without primary key

    Thought I'd share this info, as I couldn't find anything on here to help me diagnose the issue:
    I had a materialized view that was taking longer to perform a fast refresh than it took to perform a complete refresh. My mview had no primary key, as the base table had no primary key.
    I created a trace file for the session and saw references to a column M_ROW$$ in my mview. Nowhere in the data dictionary could I find a reference to the m_row$$ column in my mview, but apparently it exists and is created automatically. After creating the index below, the fast refresh took 6 minutes to add 500k rows to the materialized view. (versus 4+ hours without the index) When I looked in the trace file, I noticed that for each row in the mview log, it first tries to update the mview with an UPDATE statement, then it performs an insert of the new data. Seems like it should be able to determine whether to perform an update or insert based on the DMLTYPE$$ column of the mview log. What was killing my performance was the UPDATE phase. Since I had no primary key on the mview, and no index on the m_row$$ column, the UPDATE phase was performing a full table scan of my mview for every row in the mview log. I was expecting it to be smart enough to only perform inserts, as the only transactions against the base table were inserts.
    In summary: If you have a materialized view without a primary key, create an index on the m_row$$ column of the mview, even though no such column displays in the data dictionary.
    ex:
    CREATE MATERIALIZED VIEW mv_minidrr ...
    CREATE INDEX pk_mv_minidrr ON mv_minidrr(m_row$$) ...

    Well, there indeed is a column called M_ROW$$
    Your MLOG$_EMP is nothing but the materialized view log on the base table.
    SQL> create  materialized view log on emp with rowid ;
    Materialized view log created.
    SQL> create materialized view emp_mview refresh fast on demand with rowid as select * from emp ;
    Materialized view created.
    SQL> desc mlog$_emp
    Name                                                  Null?    Type
    M_ROW$$                                                        VARCHAR2(255)
    SNAPTIME$$                                                     DATE
    DMLTYPE$$                                                      VARCHAR2(1)
    OLD_NEW$$                                                      VARCHAR2(1)
    CHANGE_VECTOR$$                                                RAW(255)
    SQL> select table_name, column_name from user_tab_columns where column_name = 'M_ROW$$' ;
    TABLE_NAME                     COLUMN_NAME
    MLOG$_EMP                      M_ROW$$
    1 row selected.
    SQL>

  • Create a materized view without primary key constraint on the base table?

    Hi
    I tried to create a materized view but I got this error:
    SQL> CREATE MATERIALIZED VIEW TABLE1_MV REFRESH FAST
    START WITH
    to_date('04-25-2009 03:00:13','MM-dd-yyyy hh24:mi:ss')
    NEXT
    sysdate + 1
    AS
    select * from TABLE1@remote_db
    SQL> /
    CREATE MATERIALIZED VIEW TABLE1_MV REFRESH FAST
    ERROR at line 1:
    ORA-12014: table 'TABLE1' does not contain a primary key constraint.
    TABLE1 in remote_db doesn't have a primary key constraint. Is there anyway that I can create a materized view on a base table which doesn't have a primary key constraint?
    Thanks
    Liz

    Hi,
    Thanks for your helpful info. I created a materialized view in the source db with rowid:
    SQL> CREATE MATERIALIZED VIEW log on TABLE1 with rowid;
    Materialized view log created.
    Then I created a MV on the target DB:
    CREATE MATERIALIZED VIEW my_schema.TABLE1_MV
    REFRESH FAST
    with rowid
    START WITH
    to_date('04-25-2009 03:00:13','MM-dd-yyyy hh24:mi:ss')
    NEXT
    sysdate + 1
    AS
    select * from TABLE1@remote_db
    SQL> /
    CREATE MATERIALIZED VIEW my_schema.TABLE1_MV
    ERROR at line 1:
    ORA-12018: following error encountered during code generation for
    "my_schema"."TABLE1_MV"
    ORA-00942: table or view does not exist
    TABLE1 exists in remote_db:
    SQL> select count(*) from TABLE1@remote_db;
    COUNT(*)
    9034459
    Any clue what is wrong?
    Thanks
    Liz

  • APEX and Primary Keys

    Hello:
    I ran into a situation where we have a table with no primary key set. When I tried to create a form, APEX told me that a primary key must be set in order to run reports. This makes complete sense. No issue here. For some of our tables, we can set the primary key.
    The issue we have is that some of our tables are using "natural primary keys". We have tables where more than one column is designated as a primary key. For example, if I have a table with patient_id, organization_id, insurance_id, and expiration date. In order for a record to be unique in this table both the organization_id and insurance_id are set as primary keys.
    If I attempt to create a form in APEX using these tables which have more than one primary key, how will APEX know that there are more than one primary key?
    Thanks for the input.

    In that case you could also use rowid and instead of views. I have an example showing how
    this can be done:
    http://apex.oracle.com/pls/otn/f?p=31517:157
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Determining the row id or primary key columns and values genericaly

    Hi There
    Does anyone perhaps know how to determine the rowid of the
    currently selected row in a form, or alternatively the primary
    key values/columns?
    Regards
    Herman

    Hi Tranen,
    you can view the constraints and respective columns by setting the
    Table Shape Properties in the Property Inspector.
    Select (all) the tables on the Diagram you want
    In the Property Inspector,under Constraints -Set the 'Show Constraint Columns' to 'True',
    Set 'Show Constraints' to 'True' .
    Constraints (PK,UK,FK,Check)
    Also Set the 'Show Columns' option to 'False' .This will be under display options in the Property inspector.
    This should modify the Table shape in the diagram as follows:
    <Table name>
    <PK> PKName:Column1,Column2
    <UK>UKName:Column3
    <FK>FKname:Column1
    are you looking for the same?
    Thanks.

  • Partitioning an Existing Table using DBMS_REDEFINITION with no primary key?

    HI,
    Is it possible to partiiton a table with dbms_redefination if the table contains no primary key?
    DB version 10.2
    Thank you All..

    Yes, of course, but you'll have to use rowID with "CONS_USE_ROWID" : http://68.142.116.68/docs/cd/B19306_01/appdev.102/b14258/d_redefi.htm#CBBFDJBC
    This will be longer but it is possible.

  • Using table with no primary key

    I habe some older table that use unique indexes (instead of primary keys). Some of these are comprised of 3 or 4 columns (see below). When I try to create an HTML DB tabular form or report is it asking for primary key. How do I get around this?
    CREATE UNIQUE INDEX COURSES ON COURSE(START_YY,SCHOOL,CLASS_CD)
    TABLESPACE starindx
    STORAGE (INITIAL 61440
    NEXT 61440
    PCTINCREASE 0);

    You will have to code your own inserts, updates, and deletes along with optimist row locking, which is painful.
    To use HTML DB's built-in/default inserts, deletes, updates, and optimistic row locking, add a number column to your table. Make that new column be the primary key on the table. In the HTML PAGE populate it from a number generator. The primary key column will in essence function like a rowid for the row. The only thing you will want to do is code a validation to check for a unique combination of START_YY,SCHOOL, and CLASS_CD in the table so the page can present a more pleasing 'duplicate key on index' message in the event that the user has matched an already existing tuple.

  • Form Validation on Complex Primary Key

    I have a that inserts/updates a table with a 2 coulmn primary key (ticket_num, ticket_seq). Is there anyway to create a page validation item that will keep users from violating the pk constraint and getting the ugly ORA-00001 error.
    I think I just don't understand the syntax of the "SQL Expression" validation.
    I would like to just find if the key already exists, but the following does not seem to catch it. I have put the following in validation expression 1.
    (select count(*)
    from system_issue_timings
    where ticket_num = :P3_TICKET_NUM
    and ticket_seq = :P3_TICKET_SEQ) > 0

    The pl/sql with count(*) above will not work as select count(*) into... will never raise no_data_found, it will result in zero in v_test.
    The other thing to watch out for on this type of validation (whether implemented as sql not exists or as a pl/sql returning boolean or pl/sql returning error) is that if you are doing updates on this page then you need to either :
    1. not fire the validation when updating (assuming you cannot modify the primary key columns on the page), or
    2. specifically exclude the row being updated from the validation lookup (using rowid for example) as otherwise it will satisfy the condition and fail the validation.
    You want to probably use 'sql NOTexists' validation as it "Passes if the query return no rows." :
    select 1
    from system_issue_timings
    where ticket_num = :P3_TICKET_NUM
    and ticket_seq = :P3_TICKET_SEQ
    Glen
    Edited by: gjmorris on Sep 24, 2008 1:02 PM - added actual solution.

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

  • Too many objects match the primary key oracle.jbo.Key[2]. Error

    Hi
    I have to display a Read Only table and an Editable Form below it so that the user can select a row in the table and that row should be populated in the form below.
    The user should be able to update the row and save in the below form.
    Then the table above also should be refreshed with the updated values.
    For this I have created a VO based on EO.
    Using the same data control I have created a UI Readonly table and an Editable form in the same JSF page.
    When I run the page, the first row is populated in both the table and form.
    When I select the second row in the table, I am getting the following error in the Editable Form
    Error: Too many objects match the primary key oracle.jbo.Key[2 ].
    My EO has only one Primary key and I have not included the ROWID column in EO or VO.
    How can we fix this issue ?
    However, if I move the editable form to another page, It is working fine.
    But we need to have both the table and editable form in the same page for usability purposes.
    Thanks for any help.
    Sameer

    you can try refreshing your VO in various ways:
    1. try setting partialTrigger on table pointing to your commandbutton .. also make sure partialSubmit on your commandButton is set to true.
    2. Do bindings on the page def for Execute action of your read-only VO. Call this method from actions of your commandButton.
    If they dont work then you can try creating a method in your AMImpl which does calls vo.executeQuery and expose this to pageDef.. and call if from the actions of your button .. but this may not be best way
    Amit

Maybe you are looking for

  • Create External document (URL) in SAP Personas

    Hi Smart People! To save some steps and incorporate a scanner I am working on creating buttons to "Attach Documents" in different areas such as MM03, FB03, and a few others where we have to keep a scanned in document attached to certain other Materia

  • Creating the Windows Service for the Database Instance

    Hello, I am using the PeopleTools 8.52 Installation for Oracle documentation and was in Task 6A-2: Creating the Windows Service for the Database Instance. After I type in oradim -new -sid ORCL -intpwd manager -startmode auto -pfile C:\Oracle\database

  • Ipod 3rd generation podcast sequence

    I have an ipod 3rd generation. I have no problem at downloading and installing podcasts onto my ipod. What I do have a problem with is being able to get them to play in order. For instance I have a number of talks which are part 1, part 2, part 3, et

  • 11g xml error when adding or editing column

    I'm getting this error when attempting to add a column (named Division) to any Analysis. If I modify some other column and change its formula to reference the Division column, I get a similar error, but I can click ignore and the system works properl

  • Hey i lost my macbook how to report stolen?

    any help would help