Primary Key on Char + Form Report Edit

Hello all,
i'm new here :)
I have a question regarding Apex 3.0
I created a table with a primary key on char(5).
After that I created a form with report.
If i click now on the edit button in the report on a row, I receive this error on edit page:
ORA-01403: no data found
Unable to fetch row.
If the "id" is a int, it works without problems
Could someone help me?
Message was edited by:
schulle

Hi,
When you go to page 3 in edit mode, you give a value to P3_QNR (the PK).
If this value doesnt exist in your table, you'll get the following error : ORA-01403: no data found - Error Unable to fetch row.
From what I understand of your problem, if you change de datatype of your primary key, you can fix/create the same error.
after some testing : I was able to have the same error... and fix it
The problem : if your primary keys starts or end with blank spaces, APEX can't handle it (in the url, APEX don't add %20 to replace the blank spaces)
The fix : make sure your primary keys don't start or end with blank spaces
I hope this help
go see this thread : Re: Bug - primary key with datatype char starting or ending with blank spac
Flex
Homepage : http://www.insum.ca
InSum Solutions' blog : http://insum-apex.blogspot.com

Similar Messages

  • Primary key in new form wizard

    I tried to create a form with report using the New Form Wizards. But it seems always hidden the primary key and if I make changes to the generated form or report, I normally end up with broken pages. I found the forms in the example application are against tables with sequence backed primary key. But all our tables are not use that approach. Does anyone know any work around?
    Another unrelated question about LOV? It seems the wizard require two different column to be used. If I want a list based on one column (like show all the possible value of one column), how can I do that?

    <zq>
    I tried to create a form with report using the New Form Wizards. But it seems always hidden the primary key and if I make changes to the generated form or report, I normally end up with broken pages. I found the forms in the example application are against tables with sequence backed primary key. But all our tables are not use that approach. Does anyone know any work around?
    </zq>
    <raj>
    i just created a "Form with Report" and a "Form on a Table or View" using the wizards on htmldb.oracle.com which i accessed a few different ways, and they seemed to consistently expose the primary key of my table in the form. if you're referring to your primary key column in your report being rendered as an edit icon, you can change that from the report column attributes screen for your primary key column. just use the popup LOV for the "Link Text" field in the "Column Link" region of that screen to select the primary key value from your query rather than the html image tag that's there by default. also, if you'd like to, let us know what tweaks you're making to your generated forms/reports that result in errors. we should be able to help you with those, too.
    i think the last part of your question above asks about using the wizards against tables that don't have sequence-backed primary keys. if so, i just did that on htmldb.oracle.com w/o issues. i might not be understanding your issue correctly, but it seems like you shouldn't have problems doing this. if so, though, please provide much more detail. we did have some issues with this stuff (and with the primary key column not being exposed as you mentioned above) in some earlier versions of html db. is it possible that you're not running of the most current version: 1.4.2.00.21 ?
    </raj>
    <zq>
    Another unrelated question about LOV? It seems the wizard require two different column to be used. If I want a list based on one column (like show all the possible value of one column), how can I do that?
    </zq>
    <raj>
    html db likes you to define your LOV queries using both a value to be displayed and a value to be returned to be submitted. if you'd like these values to be the same, simply select the same value twice from your table (being sure to alias the columns, which is always a good habit). so if you want to show and return all values of ename from emp, you could define your LOV query to be something like...
    select ename my_display_val, ename my_return_val from emp order by 1
    ...and that'd do it.
    </raj>
    hope this helps,
    raj

  • Primary Key in tabular form is not a number

    I created a table called tblRegions.
    The primary key is RegionCode(VarChar2) - example - USA.
    I then tried to create an updateable Tabular Form using tblRegions, but it won't let me choose the primary key as an updateable field.

    O.K.
    1. create a trigger which will populate a real primary key out of a sequence - search internet
    on triggers and sequences in oracle
    2. use this primary key for tabular form processing
    3. if you need a manually entered pseudo (fake) primary key, you can handle this column
    as any other - tabular form will not complain about it
    4. you may create a constraint on your table, which will take care this column is allways
    populated and unique - this is not the nicest way since it involves processing and the errors
    you gat may not look user friendly. However, this is the most secure and easiest way -
    you don't need to write any code on the application side to handle eventual errors.
    Search internet on constraints.
    5. you may decide to create a manual validation process to fetch the eventual errors
    before you commit the changes to the database. This forum is full of the threads on
    the topic "tabular form" and "manual creation of tabular forms". If you are new to apex,
    you should stay away from that for the first (this is only my opinion).
    Denes Kubicek

  • How can I be able to create a primary key in a Form on a Table with Report?

    When I click the "Create" button, a form appears allowing me type in data for those columns. But primary key is not there. I really need to specify my primary key here also. Because the primary key for this table is a Serial Number, not just a sequence number.
    I noticed that when I created this page earlier, the primary key was ruled out by default. I wish there is a way to accomplish this. Thanks!

    Hello,
    >> a pk field is not null implicit …
    I’m not sure I understand your statement. Every item, including the one holds the primary key, is null for a new form. The question is, when you are filling the form, how to populate this field. The APEX wizard assumes this field will be populated by the system, hence it hides it from the user, however it’s a valid situation where the primary field is filled by the user.
    As primary field should not be changed, hence the productive advice by Martin. If the form displays an existing record, the primary field item should be set to Read Only.
    Regards,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • Display the second report as modalform and filter with primary key value of first report when you click on first report column link

    Hi All,
    I have two reports.
    1. order report
    2. order detail report
    when you click on the order report column it display the order detail report as a modal form.
    i was done below steps.
    1. In page header i was written the below code
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
    redmond/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
    <script type="text/javascript">
    $( function() {
    $('#ModalForm1').dialog(
    autoOpen : false ,
    width :470,
    height: 500,
    resize :false,
    function openForm1()
    $('#ModalForm1').dialog('open');
    function closeForm()
    $('#ModalForm1 input[type="text"]').val('');
    $('#ModalForm1').dialog('close');
    </script>
    2. order report.
    3. order detail report
       select * from order_details where order_id = p_order_id;
    region header
    <div id="ModalForm1" title="Ordered Items" style="display:none">
    <p class="msg"></p>
    footer
    </div>
    4. created the hidden item in order detail report.
    5. in order report column attributes i was given link like below.
    javascript:$s('p_order_id','#order_id#');openForm1();
    when i click on the order report column link it passing the row primary key value to hiddent and open the report as modal form. however it is not filter the report with hidden item. it showing the no data found.
    problem is hidden item value is not submitting. once we submit that value it showing the 2nd report with filter data.
    can any help me to achieve above requirement.
    apex: 4.2
    oracle 11g
    Regards,
    Vijay.

    Vijay,
    Issue 1: Your usage of $s() JavaScript API seems to be wrong. For the first parameter, you need to use the name of the hidden page item and not p_order_id.
    javascript:$s('P1_ORDER_ID','#ORDER_ID#');openForm1();
    Issue 2: Seems like you are not setting the hidden page item's value in session state. Assuming your hidden page item is called P1_ORDER_ID, Under "Region Definition" tab of your "Order Detail Report" under "Source" tab, for page items to submit, enter the name of the hidden page item P1_ORDER_ID.
    Thanks!
    JMcG

  • Transporting table entry with primary key 120 char

    Hi all,
    I have 2 separate questions which I feel are closely related.
    In the url:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
    It says:....
    <i>If the key length is greater than 120, there are restrictions when transporting table entries. The key can only be specified up to a maximum of 120 places in a transport. If the key is larger than 120, table entries must be transported generically.</i>
    <b>How do I transport the table entries "generically" for such a table?</b>
    To further illustrate my actual problem:
    My problem in the real world lies with the MIMETYPES table, maintained in trx SMW0.
    I select the mime types row by row and do a <u>Table Entry > Transport Entries,</u> but get an error that says
    <i>"Key entry for table MIMETYPES may only be generic"</i>.
    As a result it fails to attach to my transport.
    (Note: the primary key of MIMETYPES is 128 chars long)
    The Diagnosis long text says "<i>The key is longer than allowed by the Change and Transport System (120 characters</i>)."
    The Procedure says:
    <i>1.  Make sure that you only specify the character fields before the    
        first non-character key field. You must enter the key with a generic
        ending. Enter the generic symbol directly after the specified part 
        of the key.                                                                               
    2.  You must enter the generic symbol at the latest in the 120th       
        character of the key.                                              </i>
    <b>What is this generic symbol that i need to insert at the 120th position??</b>
    Message was edited by:
            Kevin Wong
    Message was edited by:
            Kevin Wong
    Message was edited by:
            Kevin Wong

    Thanks Nick!
    So the mysterious "generic character" is actually the asterisk (*). It works.
    Strange tho as the error long text says to insert the "generic character" at the 120th character position of the key, but I found that altho I can save it, the transport still fails with the same error.
    I tried placing the * right after the key value e.g.
    KEY123*
    and it worked.
    Thanks again!

  • How to change the source type for a primary key on a form?

    Hi,
    At the time of creating a form, I had set the source type for the primary key to an existing sequence.
    Now I want to change the source to a trigger.
    Can anyone suggest how to do it?
    Thanks in advance,
    Annie

    Annie:
    Define the trigger and then delete the page process named 'Get PK'
    Varad

  • How I get the primary key in a interactive report?

    hi,I'm a noob of apex.
    I want to get a Interactive report's primary key or rownum,and I try to use the f01...but it doesn't work.
    how can I do this.
    zl

    Have a look at: Re: To reference Interactive Report filtered rows in PL/SQL

  • Getting the primary key from order form

    Does anyone know how to get the primary key (DocEntry) off of the order form for an existing order?  I don't really want to use the DocNum field since it is not the primary key and theoretically two different orders could have the same DocNum.  Thanks in advance for your help.

    Hi Joe,
    DocEntry and DocNum values are unique, so you cannot have in db 2 orders with the same DocNum. It's possible, that DocEntry and DocNum values can vary.
    If you know the DocNum value (f.e. from Order's Form), you can simple use RecordSet object:
    Dim sQuery as String
    Dim oOrder as SAPbobsCOM.Documents
    Dim oRecordSet As SAPbobsCOM.Recordset
    Set oOrder = oCompany.GetBusinessObject(oOrders)
    Set oRecordSet = oCompany.GetBusinessObject(BoRecordset)
    sQuery = "Select DocEntry From ORDR Where DocNum = '" & DocNumber & "'"
    oRecordSet.doQuery sQuery
    If oRecordSet.RecordCount > 0 Then
      oOrder.GetByKey(oRecordSet.Fields(0).Value)
    End If
    And this should work.
    Regards
    Libor.

  • How to know primary key column name form a table name in sql query

    Suppose I only know the table name. How to get its primary key column name from the table name?
    Thanks

    Views don't have primary keys though their underlying tables might. You'd need to pick apart the view to determine where it's columns are coming from.
    You can select the text of the view in question from user_views.

  • Editing or creating a record for primary Key of a table in FORM

    Hi,
    i have to create a form using 10columns out of a 25column table...
    one of the columns of this 10 is PRIMARY KEY.....
    in the process of creating the form ...it is asking me for a primary key....when i select a column(out of 10) as primary key , i am not getting that primary key in the form.....
    i am a newbie....please send some solutions to add primary key in a form so that it can be inserted or modified....
    Thanks
    raj

    Hi,
    When you create a form, you get a region and several items. If you look at your page definition, you will see these listed - the region will be called whatever name you gave it (eg, "Employee") and the items will be listed as Pnn_EMPNO, Pnn_NAME, Pnn_SALARY and Pnn_DEPT (nn = page number). The Pnn_EMPNO item will be shown as "Hidden and Protected". This means that the field is on the page but the user can not see it nor edit it.
    When you create a new record, this field will be empty. When you edit an existing record, this field will contain the EMPNO value for that record. When you save a new record, this field is given a primary key value based on whatever method you specified when you created the form.
    If you don't see the Pnn_EMPNO item, then the form has not been created correctly. Do you see this item on your page definition?
    Andy

  • Hi  cant see the primary key column in master detail  form

    I have a master detail form .In the first master form i am unable to see the primary key
    Now the form is built completley and i also will like to see the primary key column visible in master report
    If i had set the primary key as rowid then i could have seen the primary key ..
    Now i can see the pencil icon (The eidt row pencil icon) instead of the actual primary key column . .which is a number data..
    I will like that too be visible ..Can any one guide what should i do for this..
    Thanks

    Hi Mat,,
    I am using apex 4.2 db version 11g and in the first master page i had set the value of combo which is primary key column as text
    But still iam not able to see the number ..Note if i recreate the form ..with rowid as primary key i am able to see the column since the pencil icon(edit icon) is on row id..
    Currently All i see is the edit icon ..I need both the edit icon and also the number ..
    Thanks

  • Primary Key Constraints

    Hi All,
    I want to generate a list of tables and their primary key columns.
    The report should look like this:
    table_name (primary_key_cols)
    sample:
    EMP(EMP_NAME,BDAY)
    PRODUCT(PROD_ID,PROD_TYPE)
    Any idea please.
    Thanks a lot.

    Use an aggregation technic depending of your Oracle version.
    That's more a question to be raised in SQL and PL/SQL forum : PL/SQL
    Or even better, search in that forum out there, there's hundreds of example.
    Find out more - How do I convert rows to columns? - : SQL and PL/SQL FAQ
    Nicolas.
    add the 2nd link
    Edited by: N Gasparotto on Nov 24, 2011 12:01 PM

  • Primary Key - Generated by database TRIGGER

    Hi,
    I have a form with a block that is attached to a table. So far, nothing fancy :-)
    The Primary is generated with an ORACLE SEQUENCE. That is done at the TABLE level with a DATABASE trigger.
    So in the form, the primary field is not populated.
    Works fine. But if the user wants to UPDATE the forms content, right after they did an INITIAL commit, THEY CAN'T !!!!!!!!!!!
    How can I code this in the form?
    Is there a way to syncronize (populate) the primary key in the form with it's table content?
    If so, how do I query the table if I don't have the primary key value ?
    Thanks for ANY advise,
    Marc.

    Another solution is to use both a database trigger and a PRE-INSERT trigger in Forms.
    The database trigger should be something like
    CREATE TRIGGER INS_TABLENAME BEFORE INSERT ON TABLENAME
    FOR EACH ROW WHEN (new.ID IS NULL)
    BEGIN
    SELECT TABLENAME_SEQ.nextval INTO :new.ID FROM DUAL;
    END;
    and the PRE-INSERT trigger should be something like:
    SELECT TABLENAME_SEQ.nextval INTO :blockname.ID FROM DUAL;
    This way one solves the problem of DML RETURNING VALUE not working in Forms with Oracle version > 8 (does it work on version 8 as it is said to be? - i have not tested it anyway) and the use of other applications (SQL*Plus, JAVA, etc) without writing any code.

  • More than One Primary Key

    Hi,
    How to create more than one primary key in TT
    CREATE TABLE LOOKUP (KEY NUMBER NOT NULL PRIMARY KEY, VALUE CHAR (64))
    In Oracle we can create Composite Primary key
    CREATE TABLE LOOKUP (KEY NUMBER NOT NULL , VALUE CHAR (64) , CONSTRAINT constraint_name PRIMARY KEY (KEY,VALUE) )
    Thanks!

    Hi 933663,
    What is a problem?
    Command> CREATE TABLE recreation.members
    (membername CHAR(20) NOT NULL,
      club CHAR(15) NOT NULL,
      memberphone SMALLINT,
      PRIMARY KEY (membername, club));
    Command> regards,
    Gennady

Maybe you are looking for

  • How many lines can you have?

    how do get the two family plans or separate individual line?

  • Error while calling web service from Forms 10g

    Hi, I have defined a web service and deployed at OracleAS 10g 10.1.2.0.2. Web services is working fine as per standalone invocation URL and also using a Web Service source in Portal (OmniPortlet). I have created a web service proxy and imported the J

  • Oracle Enterprise Manager 11g Database Control log file location

    Any one knows where the log file is for Oracle Enterprise Manager 11g Database Control. I am trying to set up EUS proxy authentication and running into issues when trying to search proxy user in my DB. The search returns no results and I am not sure

  • Exchange 2013 autodiscover prompt

    Hi, Over the weekend i installed SP1 on our exchange 2013 DAG. Now users are getting an authentication prompt when opening outlook. This didn't happen prior to SP1. When testing email auto configuration in outlook it prompts for auth, typing in my cr

  • OIC migration from 11i to 12i

    Hi, We are migrating OIC from 11i to 12i. Planning to do a table export and table import. Will it work? Any ideas Guyz!!! If anyone can help me with the TRM of OIC, that would be great !! i searched a lot.. did not find one... Got the implementation