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

Similar Messages

  • Tabular form does not update

    I don't have a problem, but I would like to offer a solution to people who might make the same mistake as I did:
    When you build a tabular form on a table and the submit button does not seem to work, check whether your table has a primary key.
    I created a table, triggers and all the other constraints and for some reason the (tabular) form I created did not update the table, even though I had told it that the primary key was the ID in the table and it was filled by a trigger (which was true).
    I tried creating a different form on a different table and then I noticed that the primary key was filled in for me this time, and that this hadn't been the case in the first form. I added the primary key to the table and voila, problem solved.
    Is this intended behavior ? I wonder why the user is allowed to specify the primary key when the wizard does not find it, because this does not seem to have any effect. So why not try to find the primary key and warn the user when it is not present?
    Just my 2 cents....

    Sloger,
    if this is your tabular form
    SELECT apex_item.checkbox (30,
    ...and this is your update statement
    FOR i IN 1..APEX_APPLICATION.G_f*30*.COUNT
    ...Then you will only ever update records that have been checked. Unchecked checkboxes are not passed back in the global array. You need to have a hidden column with the ID's for the record and loop through that when you are updating/inserting. That is why the built in tabular form has a MRU and a MRD. the MRU loops through the hidden ID column. The MRD loops through the checkbox.
    Thanks,
    Tyson Jouglet

  • 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.

  • 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

  • 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.

  • Tabular Form Validation not working in tabular form APEX 4.0

    Hi,
    I am using APEX 4.0. I have a tabular form with Tabular form validation done with it.
    Item not null is the validation.. so if I dont type any value in the any of the fields in the tabular form and press the Submit button, the first time error is shown... but when I click the Submit button again, with still the empty rows the page is submitted.
    How to resolve this issue?
    Edited by: Suzi on Oct 5, 2010 11:13 AM

    Look at this thread - Re: Validations of tabular forms in 4.0

  • Insert in Tabular form does not work after the upgrade to APEX 4.0

    Hi all,
    Thx in advance for looking into the issue.
    We are running into following issue when we upgraded APEX 3.2 to APEX 4.02
    1) The Tabular form insert does not work.
    2) We are fatching the value of the Global variable APEX_APPLICATION.g_XXXX in a procedure and we get null for this value after submit for new row to be inserted.
    The tabular form was working fine in APEX 3.2.
    The Update and Delete works just fine.
    Any help in this regard is highly appreciated.
    Thx and regards,
    Mahesh

    Here is my workaround to get the ADDROW/SUBMIT working again if you have a legacy Tabular Form:
    1     PAGE ATTRIBUTES               
              JAVASCRIPT          
              FUNCTION AND GLOBAL VARIABLE DECLARATION          
                   var htmldb_delete_message='"DELETE_CONFIRM_MSG"';     
    2     DELETE BUTTON               
              ACTION WHEN BUTTON CLICKED          
              URL Target          change to
                   javascript:apex.confirm(htmldb_delete_message,'MULTI_ROW_DELETE');     
    3     ADDROW BUTTON               
              ACTION WHEN BUTTON CLICKED          
              Action           
                   redirect to URL     
              URL Target          
                   javascript:addRow();     
    4     PROCESS               
              APPLYMRU (activitated by button ADDROW)          
              CONDITION          
                   never or delete     
    5     PROCESS               
              ADDROWS          
              CONDITION          
                   never or delete     
    6     CHANGE PAGE TEMPLATE to e.g. THEME 13 One Level Tabs.               
    7     IF YOU WANT ADD FUNCTIONALITY TO GOTO BOTTOM OF PAGE AFTER ADDROW               
         1. In the page footer put <a name="bottom_of_page"></a>                
         2. Amend the action when the "ADD" button is clicked to scroll down to the new region by doing the following:               
         - edit "ADD" button               
         - Go to "Action when button Clicked" section               
         - Amend "URL Target" from               
         javascript:addRow();                
         to               
         javascript:addRow();window.location='#bottom_of_page' ;               
    regards
    PaulP

  • 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

  • Setting primary key field value in jdoPrestore() not flushed to database ?BUG?

    Hello,
    When I set value of primary key field of a new instance in jdoPrestore() new
    value does not get flushed to database - old (default) value get stored
    instead. All other fields assigned in jdoPrestore() get successfully
    flushed except primary key one.
    Alex

    Abe,
    You fixed only part of the problem. Right now if I assign value to a PK
    field in jdoPreStore() it does get flushed but there is another issue - all
    other instances which referenced the one I assigned PK to will not get this
    PK value. Example A references B, in B.jdoPreStore() I generate id for B -
    b.id = 100. When A gets flushed it would not get 100 in its b_id field.
    Specs says:
    This method is called ***before the values are stored from the instance to
    the StateManager***.
    Data store fields that might have been affected by modified non-persistent
    fields should
    be updated in this method. This method is modified by the enhancer so that
    changes to
    persistent fields will be reflected in the data store.
    The context in which this call is made allows access to the
    PersistenceManager and
    other persistent JDO instances.
    I read it as callbacks should be invoked on ALL instances before they get
    stored to StateManager. Does Kodo invoke callbacks for all istances first
    and then store them to instance manager? Based on the problem I am having it
    does not look like it
    Alex
    "Abe White" <[email protected]> wrote in message
    news:[email protected]..
    I just confirmed this as a bug and fixed it. We should be able to post
    the new jars for you soon. Hang in there.

  • Setting default value to columns on tabular form is not working.

    Hi,
    I created a tabular form and i want to set some default values to columns based on the values in page items.
    so i set the page item to column value in tabular form attributes by selecting the Default type as PLSQL Expression & Function DEFAULT value &P24_ISSUE_ID. it worked fine but
    in the similar way i tried for the another column by selecting the default type as pl/sql expression & function and default value &P24_CASE_NAME.
    but it throwing an error for this like failed to parse SQL query:    ORA-00904: "C254DB": invalid identifier
    i don't understand where i gone wrong even i checked for the data types of the columns, everything is fine.
    so please help me out of this problem.

    Tulasi 1243 wrote:
    for the first column
    i selected
    DEFAULT TYPE as PL/SQL Expression & FUNCTION
    Default as *&P24_ISSUE_ID.* This is a number data type column
    2nd column
    Default Type as PL/SQL Expression & Function
    Default as *&P24_CASE_NAME.* This is Varchar2 data type column.The appropriate options for a default value from a page item are Item (application or page item name) for Default Type and the item name ( P24_ISSUE_ID, P24_CASE_NAME etc) for Default.
    *&P24_ISSUE_ID.* is not a "PL/SQL Expression or Function".
    but it throwing an error for this like failed to parse SQL query: ORA-00904: "C254DB": invalid identifierWhat you are doing results in the APEX engine substituting the P24_CASE_NAME value "C254DB" into the default value and then trying to evaluate this string as a piece of PL/SQL. Outside of a block in which it is defined as a variable, constant or function "C254DB" is not a valid PL/SQL expression.

  • Sorting on date (date_popup2) in manual tabular form does not work

    Hi All,
    I created a manual tabular form (based on a collection) with 1 date_popup2 field in it. This field is defined in the query as follows:
    ,      apex_item.date_popup2( p_idx                   => 18
                                , p_value                 => c004
                                , p_date_format           => 'dd-mm-yyyy'
                                , p_item_id               => 'f18_' || lpad (rownum, 4, '0')
                                , p_item_label            => 'Start date'
                                ) as tf_br_start_date
    In the report attributes I marked this column to be sortable.
    However, in the page the sorting is not working. It looks like it's always sorted in the order  of the seq_id.
    Can anyone tell me how to solve this?
    Regards,
    René

    I'd call it a bug/missing feature.
    It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
    I'd file this with Oracle Support and see what they say.
    Include a link to this thread and your workspace login information.
    I got something to work by: (probably not what you want.)
    using the C004 column directly. (I just added it to the SQL code)
    setting the column's attribute "Display As" to "Date Picker"
    setting the column's attribute "Number /Date Format" to DD-MM-YYYY
    I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
    MK

  • Manual Tabular Form - Items not rendered

    Hi,
    i'm trying to build a manual tabular form:
    I added a blnak page with a Report Region using a SQL Query in a Classic Report:
    select      apex_item.text(1,"EMPNO") as "EMPNO",
    apex_item.text(2,"ENAME") as "ENAME",
    apex_item.text(3,"JOB") as "JOB",
    apex_item.text(4,"MGR") as "MGR",
    apex_item.text(5,"HIREDATE") as "HIREDATE"
    from      "EMP" "EMP"The items are not rendered in the report, but the HTML Text is displayed instead.
    See http://tinypic.com/r/2e6bqdu/5
    I played around with "Display As" in the Column Attributes - no luck.
    I used this links as reference:
    http://apex.oracle.com/pls/otn/f?p=31517:170:2228543603318893:::::
    http://www.oracle.com/technetwork/developer-tools/apex/tabular-form-090805.html (To build a tabular form manually:)
    http://apexjscss.blogspot.com/2010/05/manual-tabular-form.html
    Am i missing something ?
    APEX 4.1 on 11gr2
    regards,
    gw

    The "Display As" for each column should be "Standard Report Column".
    Seems the default "Display as" for standard reports has changed:
    I created your standard report in a 3.2 environment and the report defaulted the "Display As" for each column to "Standard Report Column".
    I created your standard report in my own 4.0 environment and in the hosted apex.oracle.com environment and the report defaulted the "Display As" for each column to "Display as Text (escape special characters, does not save state)"

  • 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

  • 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.

  • Updating a table through a manually created tabular form does not work.

    Hi Friends,
    I don't know why the "On submit - After computations and validations" process does not update the referenced table. May I miss something. Here is my source :
    select
    apex_item.hidden(1,eqp_id) id,
    apex_item.hidden(2,tcs_tcs_id) tcs,
    apex_item.text(3,eqp_equip_name,50) name,
    apex_item.text(4,eqp_equip_ident,50) ident,
    apex_item.text(5,eqp_equip_type,15) type
    from equip_physical
    where tcs_tcs_id = :P1_TCS_ID
    and here is the process source
    FORALL i IN 1..apex_application.g_f01.count
    UPDATE equip_physical
    SET eqp_equip_name=apex_application.g_f03(i),
    eqp_equip_ident=apex_application.g_f04(i),
    eqp_equip_type=apex_application.g_f05(i)
    WHERE eqp_id=apex_application.g_f01(i);
    No error message is displayed and my success message associated to the process is displayed. But the modified text field value is erased and the database table is not updated.

    I'd call it a bug/missing feature.
    It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
    I'd file this with Oracle Support and see what they say.
    Include a link to this thread and your workspace login information.
    I got something to work by: (probably not what you want.)
    using the C004 column directly. (I just added it to the SQL code)
    setting the column's attribute "Display As" to "Date Picker"
    setting the column's attribute "Number /Date Format" to DD-MM-YYYY
    I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
    MK

Maybe you are looking for

  • A Few Anomalies

    After waiting a long time I was finally able to upgrade my iMac and install Aperture. For the most part I am pleased with A3 except for getting used to certain anomalies and instability issues encountered in this early version. I have used iPhoto for

  • Voice memos deleted after restore

    Recently I restored my IPhone from iCloud and all my Voice Memos are Greyed after iCloud Restore everything is restored except my voice memos, I can see the list but cant play them and I do not have itunes backup. Its really disappointing. What can I

  • ITunes 10.5 for windows 7 64-bit installed OK but all files now SILENT. Sound works OK on Windows Media Player.

    Installed iTunes 10.5, looks fine but All files now silent. Sound works OK in other programs.

  • Delete invoice for Service PO's where SES is not created - MR8M gives error

    Members, I have a strange situation at my client. They have created a service PO with S-based IV checked on the Invoice tab of PO. There is no Goods Receipt checked in the Delivey tab of the PO. They did not create any Service Entry Sheet (SES) for t

  • Seeburger Message Tracking

    Hi, Can anyone please tell us how to use seeburger message tracking. I understand that there are 3 steps to be done. 1.  Mapping in IR should have a UDF which referrers to the standard Seeburger function jar files. 2.  Module configuration in the cha