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

Similar Messages

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

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

  • Need to create a new row in table with same data as Primary key, but new PK

    Hello Gurus ,
    I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
    Any ideas of how it can be done without much complication?
    Thanks in advance for your reply.
    Reards,
    Swapneel Kale

    user9970447 wrote:
    Hello Gurus ,
    I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
    Any ideas of how it can be done without much complication?
    Thanks in advance for your reply.
    Reards,
    Swapneel Kalesomething like
    insert into mytable values ('literal for new pk',
                                           select non-pk-1,
                                                    non-pk-2,
                                                    non-pk-n
                                           from mytable
                                           where pk-col = 'literal for existing pk')

  • 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

  • Pasting spreadsheet cells into a new form with the wizard ???

    I must be missing something here. Whenever I try to paste new cells from a spreadsheet into a new form using the new form wizard the 'finish' button doesn't turn active. It's like Livecycle isn't aware that spreadsheet cells have been copied to the clipboard.
    When I try to do it manually and create a new form then copy and paste cells into the form I get a grey image (icon?) that is supposed to repesent something, but I don't know what. It is definitely not spreadsheet cell information.
    Is it because I'm using Office 2000? Has anyone successfully done this?

    I checked in the LC ES help file and it indicates that the spreadsheet option works with 2003 and above. So perhaps it is related to my outdated software.
    Thanks for all your help, internet! :P

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

  • Master-detail with auto-generated primary key(master)

    Hello,
    I have the following master-detail setup:
    Master - block A primary key is: codeA
    Detail - block B
    codeA is genrated only at commit time and is obtained from a sequence.
    User needs to add detail records. This is easy to do since he has to click on the insert icon on the toolbar. At commit time, use commit_form.
    Prob: the requirements as asked by the client is to add a button (which we will label INSERT DETAIL). When the user click on the button, it opens a window where he can enter the detail info then click on save. This should bring him back to the master-detail form and the record in the detail block is inserted.
    What is the problem here ? since the detail block has the foreign key tied to the master primary key, the window-form (with the call_form) that we opened for the detail entry won't be able to save since at this point we still have not assigned a value for the primary key (and hence a value for the foreign key).
    Possible Suggestions:
    -Use a temp database table to hold the detail record from the second form and use it to transfer values to the detail record in the master-detail
    -Use a global record group
    -We can't use parameter list to pass back these values.
    So my question is:
    What would be the most efficient way to have an insert button on the detail block that would allow the user to have a pop up where he can insert his values and then be brought back to the master-detail.
    Thanks.

    Hello again,
    May be I was not clear enough.
    Scenario 1: We use the master-detail form as is with the default oolbar. In this case, the user can insert the detail records one by one without needing the primary-foreign key value since this is handled by default.
    Once we save the form (commit_form), I use the pre-insert trigger to get the master block primary key generated from the sequence and since the detail block key is copied from this value, both are saved correctly and it is the end of the story.
    Scenario 2: As explained in the initial post, the user will populate the detail records one by one by clicking on the -INSERT DETAIL- button and hence has a window where he can insert the detail info and then be brought back to the master-detail form every time he enters a new detail record.
    The problem here is that I can't generate the primary key for the master block since the client has the following requirement:
    The user can always change his mind and not complete, meaning save the form, his process
    As such, the key should be generated in the last step before Commit.

  • Replication and Primary Keys

    I am investigating replication for a client of mine who needs to have two separate sites inserting and editing data into identical schemas, but would like to sync the two databases on a regular (nightly?) basis. I bought an Oracle Replication book, and from it I have figured I need to implement advanced replication...but I have not found the answer to this question:
    How does one handle Primary Keys for new records? The client is currently using sequences on both ends to generate the keys...do I simply set up the sequences so that one site uses 0 to 1 million, and the other site uses 1 million to 2 million, etc?
    Or is there a more 'automatic' way that Oracle can handle replication of primary key columns? Maybe by using compound primary keys (ID column and location column)?
    Thanks in advance,
    Chris DuBuc
    Buke Incorporated

    For two sites, the easiest is probably to have the sequences on one site generate even keys and the sequences on the other site generate odd keys. For more than that, you'll probably want to give each site a different range of values, but that tends to be more painful to deal with than odd/even.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Problem with a primary key when creating a new record in Forms

    My table has a field - MDD_KEY - that is a primary key. It is updated from a sequence with a before-insert database trigger. I know this works properly as the primary key was accurately populated when I inserted 1433 records.
    In Forms 6, I have a form based on that table. I have set the mdd_key as a hidden field because I assume it will be entered by the before-insert trigger. However, when I enter data into the table, and then try to save it, I get a FRM-40202: Field must be entered. - followed by - FRM-40222: Disabled item MDD_KEY failed validation.
    If I set DATA Required to no, when I try to save I get an FRM-40600: Record has already been inserted - but no such record exists in the database. I know this record is unique and does NOT exist because I deliberately made it up.
    In the property palatte, the attributes of the field are:
    DATA Data Type Number
    Required Yes
    DATABASE Database Item Yes
    Primary Key Yes
    Query Only No
    Query Allowed Yes
    Query Length 0
    Insert Allowed Yes
    Update Allowed Yes
    Update Only if Null No
    Lock Record No
    I assume that my problem is that with a new record, the form wants to see the MDD_KEY populated before it saves - but that isn't going to happen until the before insert trigger fires in the database. I assume I have to populate that field within forms, but how do I do that without messing up the database trigger/sequence? I will have to load more data directly into the database - so I need the database trigger in place.
    I have not used primary keys before so I am more than a little bit confused about how and when it should be populated when a new record is created in Forms.
    Any help would be appreciated as I cannot enter new data into my form (works well with existing data).
    Thanks
    Glenn

    hi
    if u have any problem using seq then try that statemetn ur block level in ur form
    PRE-INSERT trigger
    select nvl(max(nvl(srno,0)),0)+1 into :srno from tablename;
    Rizwan

Maybe you are looking for