Error with Links if using x3 primary keys

Hi Folks:
Here is the error code I'm receiving:
ORA-01422: exact fetch returns more than requested number of rows
Unable to fetch row.
Background: I am using Application Express 3.2
All of the pages I have created that rely on x2 primary keys (first_name, last_name) work fine.
I have a table that has x3 primary keys: Table is called "time_off_awards". The x3 primary keys are: last_name, first_name, approval_date.
I created a report that works properly and lists the awards for each person (each person can receive more than one award-on different dates).
I also created an edit link that works properly IF *(only if)* each individual has only one award. If the individual has more than one award then I get the error above. When I set up the link I used all three keys. The x3 PK's should uniquely identify each row, but if the same last name/first name appear more than once (that is if the person has more than one award) I get the error. I thought at first maybe it was just not reading the 3rd key/part of the link (approval_date), but it shows properly if you move your cursor over the edit link.
Here is a link to a screen pic of how I have my link set in Apex:
[http://www.wczone.com/link_settings.gif]
Here is a link to a pic of the report with some info:
[http://www.wczone.com/report_link.gif]
If needed, here is my table info:
CREATE TABLE PERSONNEL.TIME_OFF_AWARDS (
LAST_NAME VARCHAR2(40) NOT NULL,
FIRST_NAME VARCHAR2(25) NOT NULL,
APPROVAL_DATE DATE NOT NULL,
HOURS_OFF NUMBER(3),
CITATION VARCHAR2(1500),
/* Keys */
PRIMARY KEY (LAST_NAME, FIRST_NAME, APPROVAL_DATE),
/* Foreign keys */
CONSTRAINT TOA_PERSONNEL
FOREIGN KEY (LAST_NAME, FIRST_NAME)
REFERENCES PERSONNEL.MARC_PERSONNEL(LAST_NAME, FIRST_NAME)
TABLESPACE PERSONNEL;
Thanks for any help, I've tried looking at a couple of Apex books, but they didn't help much.
Matt
Edited by: user10495310 on Mar 4, 2009 8:21 AM

Thank you everyone for the help and information you gave to me.
Your ideas and advice helped me to think through the issues involved.
The way i actually found to work around this issue was a little different.
What I did was the following (which may only be usable with empty tables. If its possible to create a new column with a sequence and trigger on a table that already contains data it should work also):
1. I removed the current PK's that were currently set.
2. I added a single, unique PK (that used a sequence and trigger to automatically increment) to the table as was suggested in this thread and other APEX forum threads.
3. I changed the link on the report so that it used the new PK, and also changed the PK used on the forms (under Processes - both the page rendering and page processing processes).
The Difference:
4. Next I changed the table (not by using APEX, but directly) from using the automatically generated ID as the PK, back to using the compound PK (x3 keys). I then added an constraint to make sure that the automatically generated column was unique. So now I have the compound PK that my supervisor wants us to use, and I'm able to use a unique, automatically generated key for APEX to use.
I found also that if you already have a column that uses a unique/auto-generated key you can still use it with APEX without switching keys around.
1. I added the new column to the sql in the reports source section so that the new column was searched (and then used 'hidden' so it wouldn't be displayed on the report users would see).
2. You can still add the unique key under the processes on the form that is being linked too under the Primary key tabs. If its not a PK it won't show up in the pop up which is to the right of "Item Containing Primary Key Column Value" but it can be entered manually (i.e. p23_AUTO_ID) and it will work fine. You would also need to edit your form so that the auto ID that is being passed from the report is part of the form - but hidden if desired).

Similar Messages

  • Use multiple primary keys to create DB constraint

    Hi,
    Is it possible to have multiple primary keys within one EJB to create a DB including the constraints, if so how? Is there an example of this or any example which uses multiple primary keys to create a DB?
    Thanks,
    Maarten

    "Is it possible to have multiple primary keys within one EJB..."
    If you mean a composite key, yes. Your PrimaryKeyObject would have one attribute for each column that makes up your composite key. If that's not what you meant, please clarify.
    "...to create a DB including the constraints"
    Not sure what you mean here. Constraints are enforced by the DB, and you don't create databases with EntityBeans.

  • Having a problem with creating/using a primary key on a view

    I have a problem with a primary key on a view
    I created the view and primary key as follows:
    CREATE OR REPLACE FORCE VIEW "MDD"."ROCK_LU" ("DESCRIPTION",
         UNIQUE ("DESCRIPTION") RELY DISABLE,
         CONSTRAINT "ROCK_LU_PK" PRIMARY KEY ("DESCRIPTION") RELY DISABLE) AS
    SELECT DESCRIPTION
    FROM MRMC_LU
    WHERE ROCK = 'T';
    The view with the primary key appears to have been created as there were no error messages. (The above was from the sql tab in sql developer.)
    When I try to create the foreign key on my mdd_hr table - I get an error
    /* hr_name - foreign key */
    ALTER TABLE mdd_hr add CONSTRAINT hr_name_fk FOREIGN KEY (hr_name) REFERENCES rock_lu(description);
    Error report:
    SQL Error: ORA-02270: no matching unique or primary key for this column-list.
    When I lookup the index in sql developer, rock_lu_pk is not there.
    All my other foreign keys work - but I don't understand what I am doing wrong with this one. Please help.
    glenn
    Background - as to why I want to use a view as a lookup table.
    The MRMC_LU table that the view is created from is structured like:
    DESCRIPTION - MINERAL - ROCK - MODIFIER - COMMODITY
    ANHYDRITE - T - T - T
    APLITE - T - - T
    GRAPHITE - T - - - T
    GREYWACKE - - T
    DESCRIPTION is a list of all names of minerals, rocks, modifiers and commodities. T is entered in each valid field. Often a description name is used for both a mineral and a rock or a mineral and a commodity or any other combination. Because this database is just starting up, it was more efficient to create one table that could be updated (and thereby automatically update the MINERAL_LU, ROCK_LU, MODIFIER_LY, COMMODITY_LU views) rather than create and maintain four separate but similar tables. A primary key cannot be generated for the MRMC_LU table as there are nulls in each column
    except DESCRIPTION.
    Perhaps there is a smarter way to do this?

    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_85a.htm#2065512
    You can specify constraints on views and object views. You define the constraint at the view level using the out_of_line_constraint clause. You define the constraint as part of column or attribute specification using the inline_constraint clause after the appropriate alias.
    Oracle does not enforce view constraints. However, operations on views are subject to the integrity constraints defined on the underlying base tables. This means that you can enforce constraints on views through constraints on base tables.
    Restrictions on View Constraints
    View constraints are a subset of table constraints and are subject to the following restrictions:
    You can specify only unique, primary key, and foreign key constraints on views. However, you can define the view using the WITH CHECK OPTION clause, which is equivalent to specifying a check constraint for the view.
    Because view constraints are not enforced directly, you cannot specify INITIALLY DEFERRED or DEFERRABLE.
    View constraints are supported only in DISABLE NOVALIDATE mode. You must specify the keywords DISABLE NOVALIDATE when you declare the view constraint, and you cannot specify any other mode.
    You cannot specify the using_index_clause, the exceptions_clause clause, or the ON DELETE clause of the references_clause.
    You cannot define view constraints on attributes of an object column.
    Rgds.

  • Need to create form on a table with report with a table has NO primary key

    Hi, I tried to created some insert/update/delete form+report in an application, it works fine only if the table has primary key. Does anyone know how to create the same functionality with a table with no primary key? I saw an application is built on older version of htmldb that is using tables with no primary keys at all.
    Here are the specific issues that I am facing:
    - I am building some Form on a table with Report, it requires the table with primary key for form to update. Is there a workaround that I can use tables that has no primary keys at all?
    - Say if primary key is necessary in the previous report+form, but the maximum number of columns that I can use to composed a primary is only 2 for that Form-Report, I cannot find anything handling > 2 primary key. Do you know if there are some ways to composite a primary key from many columns together?
    Your help is really appreciated.
    Thanks,
    Angela

    Sorry to ask response so late. I had no time to get back to that issue before.
    Regarding the triggers, I can make it work for the update, but not the insert.
    Here is my trigger:
    create or replace trigger STATUS_T1
    instead of insert on STATUS
    begin
    insert into STATUS ("LABEL", "AREA", "OWNER", "TEST_NAME", "STATUS", "REMARKS", "BUGS", "DEV_MGR", "TEST_BY_DATE")
    values(:new.LABEL, :new.AREA, :new.OWNER, :new.TEST_NAME, :new.STATUS, :new.REMARKS, :new.BUGS, :new.DEV_MGR, :new.TEST_BY_DATE);
    end;
    by any chance, you can notify what is wrong?
    I already skip the ROWID when inserting to the view STATUS, but I cannot figure out what is wrong when inserting a new record to that view.
    It gave me the following errors:
    ORA-06550: line 1, column 38: PL/SQL: ORA-00904: "ID": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
    Error Unable to process row of table STATUS
    Then, I turned to debug mode, I am thinking that maybe because I use a HIDDEN item to hold the value of ROW_ID as I use the rowid (called ID in the view) to retrieve the record as a column link from previous page. What do you think?
    Thanks again,
    Angela

  • Error : Rowkey does not have any primary key attributes

    Hello All,
    I'm developing an ADF application which has a few ADF forms. The forms have VO's and some tables.
    On running, I seem to be getting this error
    <Error> <oracle.adfinternal.view.faces.model.binding.CurrencyRowKeySet> <BEA-000000> <ADFv: Rowkey does not have any primary key attributes. Rowkey: oracle.jbo.Key[], table: oracle.jbo.server.ViewObjectImpl@2ecf4f19.>
    Where does the Rowkey have to be set? Is it in the VO?
    Regards,
    PP

    Make sure that the VO's you use have at least one attribute selected as a key attribute. GO to View Object overview editor and select attributes tab, see whether there is at least one attribute marked as a key. If not select the most appropriate attribute from the list of fields and go to edit attribute dialog, tick the key attribute property.

  • I am trying to create a sequence to be use as primary key in a Oracle table

    Hi guys
    I have the ODI version 10.3.5 and I am trying to create a sequence that populates de row_id for a table. The schema is a database.
    And I want that this item will be the primary key of the table that is loaded at execute the interface however I'm getting issues.
    So please advise me.

    Hi ,
    Can you please provide the following details :
    1. What is the execution area of your sequence ? Is it source or staging or Target.
    2. What IKM you are using ( I hope you are executing sequence in Staging or Target ) ?
    My understanding is when you check Not Null , all your rows are going to Error table. So it is not giving any error.
    When you uncheck the Not Null , it is giving error because Database is not allowing Null values in the Primary Key Column.
    You can do the following to check if your sequence is working properly.
    Try to write a Insert Select query in DB and execute it and see if it is working properly.
    i.e.
    insert into      EMPL     (
         EMPNO,
         ENAME,
         JOB,
         MGR,
         HIREDATE,
         SAL,
         COMM,
         DEPTNO
    select      S_EMPNO.NEXTVAL,
         ENAME,
         JOB,
         MGR,
         HIREDATE,
         SAL,
         COMM,
         DEPTNO
    from     EMP
    or if you can provide your query in this format , it will help in finding the issue quickly.Also provide the KM details.

  • Use of primary key

    hi guru
    without using primary key, is this possible to create table.
    regards
    subhasis.

    hi,
    I will explain with simple example.
    suppose there is table storing passport number and name of employye.
    so the developer created a table with these two fields, and there is no primary key in that.
    so when inserting data, any 1 can insert any data with duplicates value.. just imagina situation where two people has same passport number, due to this bad data base design.
    so the solution is to avoid duplicate entries, for that we haev to cmake passport number as primary key.it will vaoid duplicate entries.
    hipe u undrstud.
    Rgds
    Anversha

  • How to enqueue a table with fileds that are not primary keys

    Hi,
    I am using the FM view_enqueue in order to lock a standard table. Now , the requirement is to restrict the lock based on compnay code.
    Since this is not a primary key in table veiav , I am unable to do this . More over, the development has to be done in a enhancement point.
    Below is the code:
    wa_VIMSELLIST-viewfield = 'NUMMBUKRS'.
    wa_VIMSELLIST-operator = 'EQ'.
    wa_VIMSELLIST-value = dd_bukrs-low.
    wa_VIMSELLIST-ddic = 'B'.
    APPEND wa_VIMSELLIST to lt_VIMSELLIST.
    if sy-tcode = 'VE01'.
    CALL FUNCTION 'VIEW_ENQUEUE'
      EXPORTING
       ACTION                     = P_ACTION
      ENQUEUE_MODE               = 'E'
       view_name                  = P_VIEW_NAME
       ENQUEUE_RANGE              = 'X'
    TABLES
       SELLIST                    = lt_VIMSELLIST
    EXCEPTIONS
       CLIENT_REFERENCE           = 1
       FOREIGN_LOCK               = 2
       INVALID_ACTION             = 3
       INVALID_ENQUEUE_MODE       = 4
       SYSTEM_FAILURE             = 5
       TABLE_NOT_FOUND            = 6
       OTHERS                     = 7

    HI,
    Make use of control-Break events.
    LOOP  ..................
    AT NEW company code.
    call FM ENQUEUEXXXXXXXXXXX
    ENDLOOP

  • How to use 2 primary key in 1 table

    Hi,
    When i creating the table,in this the following are the columns Name,Street,City,Pin in this they give some rules the column Name & City as Primary Key. But when type the query it shows the error table contains one primary key, how i do this? Tell the mistakes

    Hi,
    Welcome to the forum!
    Whenever you have a question, please post your code. Ithelps people understand what the problem is. and allows them to test ideas.
    1000492 wrote:
    Hi,
    When i creating the table,in this the following are the columns Name,Street,City,Pin in this they give some rules the column Name & City as Primary Key. But when type the query What do you mean by "But when type the query"?
    Do you mean "But when I run this query ..."?
    it shows the error table contains one primary key, how i do this? What is the query you're running? What are the results? Did you expect other results? What results did you expect? Why?
    Tell the mistakesThere are not necessarily any mistakes.
    By definition, a table can never have more than 1 primary key. (If needed, a table can have any number of unique keys, that are like primary keys in everything but name.)
    Any key, primary or unique, can be composed of 1, 2, 3 or more columns.

  • Error with Linked Server

    I am trying to configure a linked server to connect from MS Sqlserver2000 to Oracle.
    I am using an Oracle 8i client. Following notes on this website and from microsoft I changed
    my registery enteries as follows:
    OracleOciLib oci.dll
    OracleSqllib orasql8.dll
    OracleXalib oraclient.dll
    My odbc connection works when tested thru Oracle Network administation but when I try to look at any tables of the linked server (using MS Enterprise Manager) I get the following error:
    "Error 7399: OLE DB provider 'OraOleDB.Orcle' reported an error"
    This occurs when I use the oracle odbc
    When I use the microsoft odbc connector I get:
    "Error 7399: OLE DB provider 'ContextProvider.MSDAORA.1' reported an error"
    Any ideas.
    Thanks in advance.
    Patrick

    To view tables on an Oracle linked server in Enterprise manager you need to add a security context to use when there is no SQL Server user
    It's on the bottom of the "security" tab on the server properties page.

  • Compiler Error with simple vi using MatLab script nodes

    While attempting to build a simple vi to test the capabilities of LabView's interface with MatLab, I received a compiler error message that said I should report the problem to National Instruments Tech Support. The error said, "reference to undefined label from: refPC=0x41C." I've attached the vi that created the error. I am using LabView 7.0 on a PC running Windows 98.
    Attachments:
    Compliererror.vi ‏11 KB

    I don't know if this will help your problem, but there is a fix for some problems with LabVIEW 7.0 and Matlab:
    http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument
    Good luck,
    -Jim

  • Error in linking by using arm-linux-g++

    Hi
    I use arm-linux-g++ to link my program, and get the following error message:
    "/usr/local/BerkeleyDB.4.5b/bdb-4.5.so: could not read symbols: ?????"
    The question marks is post by system, I don't know what it is on earth.
    But it was no problem using gcc/g++ to compile and link the program for PC version. I generated the MAKEFILE by qmake.
    And the configuration in it showed below:
    INCPATH = -I/qt/qt-embedded-arm-3.3.6/mkspecs/qws nux-arm-g++ -I. -I. -I../..
    /include -I.moc/release-shared-mt-emb-arm/ -I /usr/local/BerkeleyDB.4.5/include
    LIBS = $(SUBLIBS) -L/qt/qt-embedded-arm-3.3.6 b -lqte-mt -ldl -lpthread -L/usr/local/BerkeleyDB.4.5 b -ldb-4.5 -g
    My arm-linux-gcc/ arm-linux-g++ version is 2.95.3, my system is Red Hat Enterprise 4.2. And I am using C++.
    I think that it should be the problem linking configuration, but I do not know how to make it correct.

    I found the answer!!
    1.Modify the configure file of Berkeley DB
    #tar zxfv db-4.x.tgz
    #cd db-4.x/build_unix
    #vi /dist/configure
    Insert the following lines to configure file
    CC=/opt/host/armv4l/bin/armv4l-unknown-linux-gcc
    AR=/opt/host/armv4l/bin/armv4l-unknown-linux-ar
    RANLIB=/opt/host/armv4l/bin/armv4l-unknown-linux-ranlib
    STRIP=/opt/host/armv4l/bin/armv4l-unknown-linux-strip
    #../dist/configure prefix=/opt/db host=arm41-unknown-linux
    (Then, lib and include directories will be installed into /opt/db)
    OR
    #env CC=/opt/host/armv4l/bin/armv4l-unknown-linux-gcc \
    AR=/opt/host/armv4l/bin/armv4l-unknown-linux-ar \
    RANLIB=/opt/host/armv4l/bin/armv4l-unknown-linux-ranlib \
    STRIP=/opt/host/armv4l/bin/armv4l-unknown-linux-strip \
    ../dist/configure prefix=/opt/db host=arm41-unknown-linux
    2.Install with this configuration
    #make
    #make install
    #vi /etc/ld.so.conf
    3.Append the lib path of BDB into this file, now the path is /opt/db/lib
    #ldconfig
    4.Compile and link my program again, everything is OK!!! :)

  • Error with linking my CC account with Behance

    hello everyone,
    I am totally frustrated and angry that such a simple thing like logging into my Behance account with my CC login doesn`t work! I mean come on, how can it be that it`s so difficult!? I`ve already linked my Adobe account before and it worked, but after I log out I couldn`t log in again with the adobe accout I linked with Behance and everytime I get an error that I use an email which has been already linked...well of course it was...by me!
    how did you do this and how can it be that it is so difficult?
    all the best,
    Michal

    Hi Michael - I just responded to you via private message with the Adobe ID you connected to your account - this is the one you should be logging in with! You're getting that error because of this: https://help.behance.net/entries/34549194-Why-am-I-getting-the-error-Email-is-already-link ed-to-Adobe-ID-

  • Adobe Updates not downloading - available but "try again later" error with link to "serial number not qualifying"

    I just upgraded computers (PC w/Windows 8 64 bit) and I did a fresh install of my copy of Adobe Photoshop CS5 (along with Bridge and Camera Raw).
    The install asked for serial numbers which I provided and the installation was a success - however, I can not view full resolution images, only thumbs
    in Bridge and I can not open RAW files from my Canon 5D Mark III (though, I can my files with the older Canon 7D).  I WAS able to view and work with
    the newer RAW files on the older computer.
    Under "Help", "Updates", it says they are available but after appearing to upload to my computers, I get this:
      Adobe Bridge CS5 4.0.5 Update
    There was an error downloading this update. Please quit and try again later.
      Adobe Extension Manager CS5 5.0 Update
      There was an error downloading this update. Please quit and try again later.
      Photoshop Camera Raw 6.7 Update
      There was an error downloading this update. Please quit and try again later.
    There is then a link to customer service which brings me to this:
    Creative Cloud Help /  
    Error "This serial number is not for a qualifying product" | CS6, CS5.5, CS5
    What gives?  It was a qualifying product a few months back.  Even if Adobe stopped supporting CS5 (???), I should still have access to past updates
    that I had already once received. 
    I tried 3 times in 1 hour - no luck in getting back to a state I was in only yesterday, and months earlier.
    /Mitch

    Apparently, Adobe has very little interest in it's past customers unless they shell out more cash.
    I have never seen such a move as this - to REMOVE support and older update links off the Web in an effort to force an upgrade.
    My tech support stated (after first stating I was simply out of luck) that he was graciously allowed to make an exception and provided me with a link to support that is strangely
    hidden and /or removed from public access.
    Here is that link:
    Adobe Update Support Web Site:   1-28-2015
    https://www.adobe.com/support/downloads/product.jsp?product=39&platform=Windows
    /Mitch

  • Extended Notifications with Links while using Citrix to Access Hosted SAP

    Hello,
    I am working on a system which is hosted remotely where Citrix and Single signon are used to access the SAP instance.  I need to be able to send email to their Outlook server with executable links back to the workitems.  I had planned to use Extended Notifications to get this done.  I am fine with everything except for the Citrix link.  I am not sure whether the link in the email will be able to find its way through Citrix to the SAP instance.  I also need to know the SSO is going to work - it seems at a minimum they would need to sign on to Citrix.  Has anyone out there done this, or at least know whether it would/should/won't work?
    Thanks in advance for any help you can offer,
    Jeff Gray

    As far my knowledge, on Citrix it won't work. As far portal is concerned, it will work.
    Regards, IA

Maybe you are looking for

  • Iphone 5s black screen with Voice Over On

    I turned on Voice Over on my iphone 5s and it started to repeat everything, so I had to punch 2 or 3 times some commands in order to go back and suddenly my screen blacked out. I have tried to restart the iPhone and can see the silver apple, but agai

  • HP P1102w Wireless Printer will not pair with a Motorola SBG6782-AC Wireless Cable Modem Gateway

    I previously had AT&T U-verse Internet using an Arris IPDSL NVG510 Wireless Modem Gateway.  My HP Laptop running Windows 8.1 and the HP LasrJet Pro P1102w Wireless Prnter routinely  & automatically connected to the NVG510 Wireless Network  without an

  • Planning Horizon Business Content

    Hi, Does anyone know if there is a business content for Planning Horizon for Stock - via transaction MD63/61 ?

  • Need Help with the Mesh Tool

    I'm having trouble adding a gradient mesh to this image: http://img237.imageshack.us/my.php?image=picture1xi9.png I would like to make it look a little more 3D or shiny with a white gradient. When I click inside the shape with the mesh tool, it creat

  • Camera rotation limits not right

    I have a camera rotating left/right/up/down, I am trying to limit the rotation to 150 degrees in any direction. I have this code working for the left/right: if gPanLeft then pCamera.rotate(0,1,0) pCamera.transform.rotation.z = max(-150, min(150,pCame