inserting a new record in the database of a form

Hi friends,

I'm trying to insert a record into the database via a form I created in Oracle 10 g.
Using the default menu (DEFAULT & bar SMARTBAR), I should be able to save the record, shouldn't I?

Is someone can you please help me solve this problem?

Thank you, sheetal :)

Check if your code sequence and make like this code example (focused only on the "BOLD" letters, because I think that your specific sequence will not be in order i.e. ALL), you must make your sequence in order with no cycle.

CREATE the SEQUENCE "YOUR_SEQUENCE_NAME" MINVALUE 1 MAXVALUE 99999 INCREMENT OF 1 START WITH 1 CACHE 20 ORDER NOCYCLE .

Hope this will help.

Abbas

Tags: Oracle Development

Similar Questions

  • Inserting a new record in the database using a form empty ADF

    Hello

    I'm trying to insert a new record into the database using a form.

    I have an Employee table and its corresponding entity object and the view object. The table has an id that is used as the primary key and is filled using a sequence in the comic book.

    Data controls, I dragged and dropped at the sight of the employee as a form of ADF and checked the submit button include. Then I dragged and dropped the validation on submit button operation.

    When I connect to the app and go to the page used to create, I have 2 problems:
    1 - the form is filled with the logged in user info.
    2. If I try to change the news and validation, the user info is changed in the database and no new record is created.

    It makes a little sense to me, but I would like to know if there is a way around it (get an empty form and insert a new record).
    NB: the employee id is not part of the form, I want to be filled using the sequence.

    Kind regards
    MB

    User, please tell us your jdev version!

    To do this, you must create a new record before going to the display of the form page. In a stubborn workflow (btf), you drag the operation createInsert of the VO on the btf and it will generate a link method, add a view to the btf and put a navigation of the binding of the method of the page. Mark the method as 'Activity by default'. Now, ren, you call the workflow, you create a new record that will show your blank form.

    Timo

  • Add a new line in the database programmatically

    I have a requirement where I need to insert a new record into the database (with ADF BC) everything is done at the bean support. How can I achieve this? I use JDev 11.1.1.5. Here what I did, but unfortunately, the record is not kept in the database.

    < code >
    CCPC DCBindingContainer = getDCBindingContainer();
    DCIteratorBinding iter = dcbc.findIteratorBinding("TestRunVO1Iterator");
    RowSetIterator rsi = iter.getRowSetIterator ();
    Line myRow = rsi.createRow ();
    myRow.setAttribute ("Testplanid", "48");
    myRow.setAttribute ("Testroundid", "3");
    myRow.setNewRowState (Row.STATUS_NEW);
    rsi.closeRowSetIterator ();
    < code >

    are commit you your line...

    dcbc.getDataControl () .commitTransaction ();

  • How to create a new record with the old values

    Hi all

    I have the creation with 45 page are there fields
    the user will enter all areas and save, it will call the uneditable mode

    If the change button is clicked it will call for the editable mode

    My requirement is user will not change among these ites (45 items) clcik on save again it will call to view mode

    in this user will change one value among 45 Articles and click on the button Save I need to create more than one record in the database

    If the user will not modify one of the field elements of the 45 I will not create a new record in the database

    How can we achieve this feature


    Concerning
    Anthony

    Hi Mary,

    Please try this method to copy a line in the new line...

    public void copy()
    {
    Pervert SuppliersVOImpl = getSuppliersVO1();
    Rank rank [] = pervo.getFilteredRows ("SelectFlag", "Y");
    for (int i = 0; i)<>
    {
    Rowi rank (SuppliersVORowImpl)= SuppliersVORowImpl;
    OADBTransaction trx (OADBTransaction) = getTransaction ();
    Number b = trx.getSequenceValue ("FWK_TBX_SUPPLIERS_S");
    AttributeList a rowi = (AttributeList);
    R = (SuppliersVORowImpl) pervo.createAndInitRow SuppliersVORowImpl (a);
    Define your unique attribute values here, I'll put here Ref supplier as with each new line, it must be different.
    r.setSupplierId (b);
    pervo.insertRow (r);
    }
    }

    Kind regards
    Out Sharma

  • What is wrong with this sequence, it does not work when, after 3 inserts, I add a new record with the trigger it gives an error.

    Mr President.

    What is wrong with this sequence, it does not work when, after 3 inserts, I add a new record with the trigger it gives an error.

    --SL_CUSTOMERS table data
    
    
    INSERT INTO SL_CUSTOMERS VALUES(1,'Kamrul Hasan',NULL,NULL,'Moghbazar', 'Dhaka','0456789123',NULL,NULL,NULL,'Y',NULL);
    INSERT INTO SL_CUSTOMERS VALUES(2,'Rabiul Alam',NULL,NULL,'Motijheel', 'Dhaka','0567891234',NULL,NULL,NULL,'Y',NULL);
    INSERT INTO SL_CUSTOMERS VALUES(3,'Shahed Hasan',NULL,NULL,'2-G/1,2-2,Mirpur', 'Dhaka','0678912345',NULL,NULL,NULL,'Y',NULL);
    
    
    
    

    CREATE SEQUENCE  "ALIZA"."SL_CUSTOMERS_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER  NOCYCLE ;
    
    
    CREATE OR REPLACE TRIGGER SL_CUSTOMERS_TRG 
    BEFORE INSERT ON "ALIZA"."SL_CUSTOMERS"   
    FOR EACH ROW   
    BEGIN   
    IF :NEW.CUSTOMER_ID IS NULL OR :NEW.CUSTOMER_ID < 0 THEN  
      SELECT SL_CUSTOMERS_SEQ.nextval   
        INTO :NEW.CUSTOMER_ID  
        FROM DUAL;   
      END IF;   
    END;   
    /
    
    
    
    

    When I try to insert several records with the seq.nextval it gives error

    violation of primary key.

    INSERT INTO "ALIZA"."SL_CUSTOMERS" (CUSTOMER_NAME) VALUES ('sdfsd')
    ORA-00001: unique constraint (ALIZA.SL_CUSTOMERS_PK) violated
    ORA-06512: at line 1
    
    
    
    
    One error saving changes to table "ALIZA"."SL_CUSTOMERS":
    Row 4: ORA-00001: unique constraint (ALIZA.SL_CUSTOMERS_PK) violated
    ORA-06512: at line 1
    
    
    
    
    
    
    
    

    Concerning

    Mr President.

    I find the solution by creating a function before the triiger

    as below

    CREATE SEQUENCE  "ALIZA"."SL_CUSTOMERS_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER  NOCYCLE ;
    
    CREATE OR REPLACE FUNCTION get_SL_CUSTOMERS_vId RETURN VARCHAR2 AS
    BEGIN
       RETURN SL_CUSTOMERS_SEQ.NEXTVAL;
    
    END;
    /
    
    CREATE OR REPLACE TRIGGER SL_CUSTOMERS_TRG
    BEFORE INSERT ON "ALIZA"."SL_CUSTOMERS"
    FOR EACH ROW
    DECLARE
    dummy VARCHAR2(200);
    BEGIN
      dummy := get_SL_CUSTOMERS_vId();
      :NEW.CUSTOMER_ID := dummy;
    END;
    /  
    

    It works very well

    Thank you all for the suggestions.

    Concerning

  • Insert the record into the database using hyperlink

    My dev environment is DWCS3/MSAccess/ASP

    I have a pretty simple site where I want to enable connected users to save documents to a Favorites page (the ID of the page they are on). For aesthetic reasons, for the most part, I want to be able to click on a hyperlink for the kickoff of the insert and allows their right to return to the page they were on the behavior of the FORM action.

    Is this possible in ASP Classic? Does anyone have suggestions as to how I can do this?

    Thank you very much.

    Since my main goal was to avoid putting a button on the page, I used the kind of a workaround plan b. I've created a save"link" which leads to a "success" - style page where they then click on a button to continue. I had passed the form hidden as variables to this page then used values built in behavior record insert to write the record in the Database when they click on "continue". Not the thing I wanted to do initially, but it works.

  • Triggers when an arrows of the user down the block to insert a new record

    I'm looking for a trigger that fires when the arrows user beyond the last record in a block to insert a new record. Is there a trigger that fires at this point?

    WHEN CREATE RECORD fires in this situation.
    but it also fires if the block is empty and gets the focus.

  • Find and change a single record in the database

    I create a few forms that access an Access database that will be used to enter data into the database.  I am able to open the database files and scroll through records one at a time and have added features to be able to search and display a single record.  The problem I'm having is when I load a single record and then modify that file, I can't save the changes to the record, in other words, the record is not updated on the database.

    I can add new records and modify records as long as I scroll to them using the. next(),. last(),. first() and. previous() orders; However, when I insert a single record I can't figure out how to save the changes made to that record in the database.

    Here it is:

    xfa.sourceSet.DataConnection.open ();

    xfa.sourceSet.DataConnection.first ();

    var oDataConnList = xfa.sourceSet.DataConnection.nodes

    var oDataConnList.length = nCount;

    for (var i = 0; i)< ncount;="">

    If (CurrentRecord.rawValue! = SearchField.rawValue) {}

    xfa.sourceSet.DataConnection.next ();

    }

    }

    This establishes the data connection, made sure that it starts on the first record, counts the number of files and of volutes each record until he finds the one the user sought!

  • PHP code takes the first record in the database regardless of the selected one

    I struggled for hours with this trying to see why no matter what file is selected, the record displayed is always the first. It must be a stupid mistake on my part, but I can't see it.

    I use DW CC 2015 with WebAssist server for server code additions. I looked at the database itself, and it's OK.

    Test data

    Capture.JPG

    Copy the following code enumerates the various documents in the database. (I removed my HTML that works well for brevity).

    <? php require_once('.. /.. /.. / Connections/Terrier.php');? >

    <? php require_once('.. /.. /.. / webassist/mysqli/rsobj.php');? >

    <? PHP

    $rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

    $rsDocuments-> setQuery ("" SELECT * FROM documents ' ");

    $rsDocuments-> execute();

    ? >

    <! doctype html > < html >

    "' Snip...

    < p align = "left" > < a href = "add_terrier_document.php" > add new record of Documents < /a > < /p >

    < table width = "100%" border = "1" cellspacing = "2" cellpadding = "2" >

    < tbody >

    < b >

    < td width = "26%" align = "left" > < strong title > < / strong > < table >

    < td width = "52%" align = "left" > < strong text > < / strong > < table >

    < td width = "6%" align = "center" > < table >

    < td width = "6%" align = "center" > < table >

    < td width = "6%" align = "center" > < table >

    < /tr >

    <? PHP

    {While (! $rsDocuments-> {atEnd())}

    ? >

    < b >

    < td > <? PHP echo ($rsDocuments-> getColumnVal ("dc_title"));? > < table >

    < td > <? PHP echo ($rsDocuments-> getColumnVal ("dc_text"));? > < table >

    < td width = "6%" align = "center" > < a href = "view_terrier_document.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> view < /a > < table >"

    < td width = "6%" align = "center" > < a href = "edit_terrier_document.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> edit < /a > < table >"

    < td width = "6%" align = "center" > < a href = "confirm_terrier_document_delete.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> delete < /a > < table >"

    < /tr >

    <? PHP

    $rsDocuments-> moveNext();

    }

    $rsDocuments-> moveFirst(); return the RS to the first record

    ? >

    < / tbody >

    < /table >

    < a href = "<?" PHP echo $rsDocuments-> getFirstPageLink();? > "> first < /a > - < a href =" <? PHP echo $rsDocuments-> getNextPageLink();? > "> Next < /a > - < a href =" <? PHP echo $rsDocuments-> getPrevPageLink();? > "> previous < /a > - < a href =" <? PHP echo $rsDocuments-> getLastPageLink();? > "> last < /a >"

    < p >

    .... SNIP

    The table shows the different records in the database. I can go through the files back and forth and pick any one to edit - say one-third.

    The PHP code creates the URL of http:// localhost/priory_database_2/gateway/Terrier/documentation/edit_terrier_document.php?dc_in dex = 3

    However, the record that is displayed is always record 1, regardless of the currently selected folder.

    The edition code (less HTML) is.

    <? php require_once('.. /.. /.. / Connections/Terrier.php');? >

    <? php require_once('.. /.. /.. / webassist/mysqli/rsobj.php');? >

    <? php require_once('.. /.. /.. / webassist/mysqli/queryobj.php');? >

    <? PHP

    $rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

    $rsDocuments-> setQuery ("SELECT * FROM documents ORDER BY dc_index ASC");

    $rsDocuments-> execute();

    ? >

    <? PHP

    If (isset($_POST["submit"]): isset($_POST["submit_x"])) {}

    $UpdateQuery = new WA_MySQLi_Query ($Terrier);

    $UpdateQuery-> action = 'put up-to-date. "

    $UpdateQuery-> table = 'documents '.

    $UpdateQuery-> bindColumn ("dc_index", "s", "".) "((isset($_POST["dc_index"])))? $_POST ["dc_index"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ("dc_title", "s", "".) "((isset($_POST["dc_title"])))? $_POST ["dc_title"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ("dc_text", "s", "".) "((isset($_POST["dc_text"])))? $_POST ["dc_text"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ('date_recorded', "s", "".) "((isset($_POST["date_recorded"])))? $_POST ["date_recorded"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ("date_update", "s", "".) "((isset($_POST["date_update"])))? $_POST ["date_update"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> addFilter ('dc_index', '=', 'i', ' ".) () $_GET ['dc_index']). » ») ;

    $UpdateQuery-> execute();

    $UpdateGoTo = 'index.php ';

    "If (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo? rel2abs ($UpdateGoTo, dirname (__FILE__)):" ";" "

    $UpdateQuery-> redirect ($UpdateGoTo);

    }

    ? >

    ..... Snip


    < /table >

    < h3 align = "center" > change the document details < / h3 >

    < form id = "AddDocumentRecord" name = "AddDocumentRecord" method = "post" >

    < label for = "dc_title" > title

    < name textarea = "dc_title" cols = "150" lines = "3" maxlength = "300" id = "title" > <? PHP echo ($rsDocuments-> getColumnVal ("dc_title"));? > < / textarea >

    < / label >

    < label for = "dc_text" > Description

    < name textarea = "dc_text" cols = "150" lines = "20" maxlength = "60000" id = "text" > <? PHP echo ($rsDocuments-> getColumnVal ("dc_text"));? > < / textarea >

    < label for 'date_recorded' = > registration Date:

    < name textarea = 'date_recorded' cols = "50" rows = "1" maxlength = "20" id = 'date' > <? PHP echo ($rsDocuments-> getColumnVal ("date_recorded"));? > < / textarea >

    < / label >

    < label for = "date_update" > Date of last update:

    < name textarea = "date_update" cols = "50" rows = "1" maxlength = "20" id = "Refresh" > <? PHP echo ($rsDocuments-> getColumnVal ("date_update"));? > < / textarea >

    < / label >

    < input type = "submit" name = "submit" id = "submit" value = "Submit" >

    < input name = "dc_index" type = "hidden" id = "dc_index" value = "<?" PHP echo ((isset($_POST["dc_index"]))? $_POST ["dc_index"] ":" "")? > ">"

    < / make >

    ... Snip

    The query for the edit page should look like

    $rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

    $rsDocuments-> setQuery ("SELECT * FROM documents WHERE dc_index =?");

    $rsDocuments-> bindParam ('i', ' ".) "(isset($_GET['dc_index']))? $_GET ['dc_index']:" ")". "" », «-1 ») ;

    $rsDocuments-> execute();

    What this did that select a recording with a value of dc_index.

  • new incarnation of the database and rc_database

    Hello!

    Have I understood that after the registration of the new incarnation of the database in the recovery catalog
    I see new line in rc_database?

    Thank you and best regards,
    Pavel

    Hello

    After you save your database with the catalog database, you can get the information from the database recorded using the view 'rc_database '.

    To interrogate the details of the incarnation of the newly registered database, you can use the view 'rc_database_incarnation '.

    It could be useful! If you feel that your questions have been answered, then please consider fill your questions by marking them as answered. Please clean the forum!

  • JSF: how to add new record in the datatable in the same page

    JDeveloper: 11.1.2.2.0
    using ADF - I want to create a page that contains a datatable, text entry field and a command button.
    When I press the command button, I want the text in the text input field to insert as a new record in the datatable.
    What is the best practice for whom? How to get the value of the input text field and insert it?
    Thanks in advance :)

    http://jamessmith73.WordPress.com/Oracle-Fusion-Middleware/ADF-CRUD-cascaded-lovs/

  • Failed to load existing records from the database on SD card during initialization of the application

    When the Simulator is launched upward, not able to load existing records from the database in the Inbox, so no records appear in the Inbox even though they exist in the database. It seems to be a problem with the SD card in the Simulator - the file system for the SD card is not correctly initialized when the application starts first to the top. During initialization of the application tries to access the SD card by using the following code.

    Boolean

    sdCardPresent = false;

    Enumeration e = FileSystemRegistry.listRoots ();

    If

    (e! = null) { }

    While (e.hasMoreElements ()) {}

    root = (String) e.nextElement ();

    If

    (root.equalsIgnoreCase("SDCard/")) {

    sdCardPresent =

    true;

    }

    }

    }

    sdCardPresent is always set to false and was not able to access existing records from the database. Once the application is initialized and try to create the database, the database is created successfully on the SD card.  The code is the same as above when creating the database and was able to do sdCardPresent = true.

    Is there anyway to register or add the SD card during initialization of the application or any property as System.setProperty overide the path of the default directory value?

    I use BlackBerry 9550 Simulator. I checked the "file system using PC for files from the SD card" and I use "C:\bb\SDCard" for the file system of thr.

    Also tested on the BlackBerry and found the same thing, if the device is hard reset, then it not reading the SD card as well.

    Mark the thread as solved then.

  • I have to add new contacts in the database. Should what stage of treatment I add?

    I have to add new contacts to the database. Should what stage of treatment I add?

    Hello

    Please use "Save to the Contact Table" stage of treatment.

    Thank you

    edynamic Experts Eloqua

  • We can insert a new line at the end of af: table declaratively?

    Mr President.

    We can insert a new line at the end of af: table declaratively?

    Concerning

    In the t impl class substitution as below, after that, you should be able to insert at the end of the table.

    @Override

    {} public void insertRow (rank)

    Line lastRow = this.last ();

    If (lastRow! = null) {}

    int j = this.getRangeIndexOf (lastRow) + 1;

    this.insertRowAtRangeIndex (j, line);

    this.setCurrentRow (row);

    } else {}

    super.insertRow (row);

    }

    }

  • create new record in the table of the tree

    REFERRED to the ADF Code 83 corner. How-to - create the two-way synchronization between a tree and a form input element

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/83-bidi-synchronization-tree-form-401841.PDF

    Mr.Frank usese (deptId) of allDepartmentsWithEmployeesIterator-> > > iterator

    to insert the new employee in the service selected tree node

    it get the departmentId for the current line of allDepartmentsWithEmployeesIterator

    and set it as the new employee to the new departmentId inserted in the allEmployeesIterator

    This multiy in table tree we have the employees table and departments table

    ------------------------------------

    public String onCreateEmployee() {}
    BindingContainer links = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding ("Create1");
    Object result = operationBinding.execute ();
    If (! operationBinding.getErrors () .isEmpty ()) {}
    TODO add the error handling
    Returns a null value.
    }

    a department Id the value of the tree node's parent
    DCIteratorBinding = departmentIter
    (DCIteratorBinding) bindings.get ("allDepartmentsWithEmployeesIterator");
    Line currentDepartmentRow = departmentIter.getCurrentRow ();
    Object deptId = currentDepartmentRow.getAttribute ("DepartmentId");
    DCIteratorBinding = employeesIter
    (DCIteratorBinding) bindings.get ("allEmployeesIterator");
    Line currentEmployeeRow = employeesIter.getCurrentRow ();
    currentEmployeeRow.setAttribute ("DepartmentId", deptId);

    Returns a null value.
    }

    -----------------------------------

    I'm doing the same functionalty

    in the same tree table

    Insert the child registered under the selected parent node

    but it gives me the ID of the employee of topRank

    in which case we use tree one View object

    as long as same as in ADF code corner article

    032. creating a table tree of a single object View and access selected lines

    We thus obtain the topRanked EmployeeID Steven King is 100

    not the employeeId correct if you select low-tier employee

    ------------------------------

    Create Itried to use with the parameter

    He gave me the same result always it create used under top class used 100 steven King

    not covered by the selected Manager

    -----------------------------------------

    in a few words I'm looking for a way to insert a new line under the selected node

    in the case of the component tree is based on the same view object

    is it an idea or a help on this

    Hello

    in your case, the employee Id is what you need to get the tree component itself. In my article, I rely on the synchronization between two iterators, which in your case is not possible. If access you the component of the tree to get the current selected node. This should be an instance of JUCtrlHierNodeBinding that you can call getRow to obtain the selected user. You can query a second View object to show the employee to edit (the current together by key line). Even when you create a new employee. Access you the second VO iterator used after you call Create to create a new line. On the iterator, you call iterator.setAttribute (attribute_name, value_read_from_parent)

    Frank

Maybe you are looking for