How to insert data into the database of the fields that have already been assigned values?

Hi all

I'm sorry for the question, I'm still new to the OPS

Here's the thing.

I have 4 points messageTextInput in my page. each of these 4 field is associated with an attribute of the VO.

3 of these items have their value already defined in the processRequest of the Commander, like this:

       
      OAMessageTextInputBean factureItem = (OAMessageTextInputBean)webBean.findChildRecursive("factureItem");
      factureItem.setValue(pageContext,pnumfacture);

       OAMessageTextInputBean actionItem = (OAMessageTextInputBean)webBean.findChildRecursive("actionItem");
       actionItem.setValue(pageContext,pidaction);
       
      Date sysDate = new Date(); 
       OAMessageDateFieldBean dateSystemItem = (OAMessageDateFieldBean)webBean.findChildRecursive("dateSystemItem"); 
         dateSystemItem.setValue(pageContext,sysDate);       

The user must enter the value of the 4th field.

I used the classic entry code for data as follows:

in the AM, I added,

    public void insertRecord(){
    
    OAViewObject vo = getTraceVO1();
    OADBTransaction trans = getOADBTransaction();
    
        if (!vo.isPreparedForExecution()) 
          { 
                vo.executeQuery(); 
          }
    
    TraceVORowImpl v_row;
    v_row = (TraceVORowImpl)vo.createRow();
    vo.insertRow(v_row);
   v_row.setNewRowState(v_row.STATUS_INITIALIZED);
  }
public void apply()
   {
      getTransaction().commit();
    }

In the processRequest of the Commander, I added:

      if (!pageContext.isFormSubmission())
        {        
         am.invokeMethod("insertRecord",null);       
        } 

in the processFormRequest of the CO, I added:

      if(pageContext.getParameter("submitButtonItem")!=null){
                     
            am.invokeMethod("apply");
      throw new OAException("Trace Created successfuly",OAException.CONFIRMATION);
      }

When I run my page, I get the error message saying that myVO not records, the records were removed or the view instance has been initialized incorrectly.

Can someone please tell me what this means?

Kind regards

Afaf

Afaf,.

Please try to use the code below and see what happens:

Replace the insertRecord in the AM method with this.

Import oracle.jbo.domain.Number;

public void insertRecord(String pnumfacture, String pidaction){ 

  System.out.println("been  in insert method");
  OAViewObject traceVO = getTraceVO1();
  OADBTransaction trans = getOADBTransaction(); 

  /*if (!traceVO.isPreparedForExecution())
  {
  traceVO.executeQuery();
  }
  */
  traceVO.setWhereClause(null);
  traceVO.setWhereClauseParams(null);
  traceVO.setWhereClause("1=2");
  traceVO.executeQuery();

  Number pidAction;
  try{
  pidAction = new Number(pidaction);
  }catch(Exception e) {}

  TraceVORowImpl traceVORow;
  traceVORow = (TraceVORowImpl)traceVO.createRow();
  traceVORow.setIdFacture(pnumfacture);
  traceVORow.setIdAction(pidAction);
  traceVORow.DateSysteme(this.getOADBTransaction().getCurrentDBDate());
  traceVO.insertRow(traceVORow);
  //traceVORow.setNewRowState(traceVORow.STATUS_INITIALIZED); 

  System.out.println("been  in insert method");
} 

Replace the processRequest of the second Commander by this:

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
  System.out.println("first time in processForm of CO2");
  String pnumfacture = null;
  String pidaction = null; 

  super.processRequest(pageContext, webBean); 

  OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); 

  if(pageContext.getParameter("pnumfacture")!=null)
  {
  pnumfacture = pageContext.getParameter("pnumfacture").toString();
  } 

  if(pageContext.getParameter("pidaction")!=null)
  {
  pidaction = pageContext.getParameter("pidaction").toString();
  } 

    System.out.println("been  in processRequest before assign variables of CO2"); 

  System.out.println("pnumfacture :" + pnumfacture);
  System.out.println("pidaction :" + pidaction);

/*assign values to the 3 fields*/
      /*
   Date sysDate = new Date();
      OAMessageTextInputBean factureItem = (OAMessageTextInputBean)webBean.findChildRecursive("factureItem");
      factureItem.setValue(pageContext,pnumfacture); 

      System.out.println("been  in processRequest after assign variables of CO2"); 

       OAMessageTextInputBean actionItem = (OAMessageTextInputBean)webBean.findChildRecursive("actionItem");
       actionItem.setValue(pageContext,pidaction); 

       OAMessageDateFieldBean dateSystemItem = (OAMessageDateFieldBean)webBean.findChildRecursive("dateSystemItem");
       if(dateSystemItem != null)
       {
         dateSystemItem.setValue(pageContext,sysDate);
       }
       */
    Serializable parameters[] = {pnumfacture, pidaction};
    Class paramTypes[] = {String.class, String.class};

       am.invokeMethod("insertRecord",parameters, paramTypes);
       System.out.println("been  in processRequest of CO2 after invokeMethod"); 

  }

Let us know what happens.

You can get an error that I have just change this in Textpad and may have syntax errors. If you can't fix those apply here.

See you soon

AJ

Tags: Oracle Applications

Similar Questions

  • How to insert data into the table by using the expression builder in the assign activity

    How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
    Can someone help me please

    Hello

    I don't think that oraext:query-database() can insert data into the table.

    What are your needs?
    Can not you plan to use the DB adapter with the insert operation?

    Kind regards
    Neeraj Sehgal

  • How to insert data into the database using smartview

    Hello
    I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
    My database is empty.

    I opened an ad hoc network, it returns * "#missing" * in all cells
    I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
    It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.

    I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?

    --
    VINET

    You go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to insert data into the BLOB column

    Hi all

    Can someone help me to insert data in the BLOB data type column?

    The structure of the table is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    (
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER (15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER (15),
    DATE OF LAST_UPDATE_DATE,
    LAST_UPDATE_LOGIN NUMBER (15),
    RECORD_STATUS VARCHAR2 (1 BYTE),
    ERROR_MESSAGE VARCHAR2 (4000 BYTE),
    DATA_FILE BLOB
    )

    I want to insert data into the column DATA_FILE. and this insert statement inside a procedure.

    Please help me as soon as possible because it is very urgent for me

    Thank you and best regards,
    Charrier

    Charrier,

    If you form the string yourself, you can use the function utl_raw.cast_to_raw on your channel.

    http://download.Oracle.com/docs/CD/B12037_01/AppDev.101/b10802/u_raw.htm#997086

    sql> create table t(
      2    id number,
      3    l_blob blob
      4  );
    
    sql> insert into t values(1, utl_raw.cast_to_raw('SampleString'));
    
    1 row created.
    
    sql> commit;
    
    Commit complete.
    
  • Where are the images that have already been imported?

    With the help of LR CC, suppose I have import the images in a folder using the copy and that I rename the files as part of the import process. Later I try to import the images in the same folder again, but all the images are dimmed in the dialog box import indicating that they have already been imported into LR.

    (1) how can I find the images in LR? I can't filter on the name of the file as the files have been renamed to import. There must be a way because LR knows that the files have already been imported even if they have been renamed so how do I find in LR?

    (2) how LR knows that the files have already been imported when I try to import the second time? He can't use the name of file to compare the images that are in the catalog with the images that I am trying to import because the files have been renamed when imported originally.

    Thank you.

    My last suggestion re 'Date' should work if you have the original images in the computer.

    I am referring to the "Capture Date" of the images in the metadata, this would remain unchanged even if renamed and copied.

    or looking for good luck (5000 is not much!  )

  • How to insert data into the initialization blocks

    I want to connect the user which connect to the obiee system. in the initialization, user blocks, we can get, but how to insert the date and user in the database is it in any way. Thanks in advance.

    The connection id is stored in the system USER session variable. You can use it to insert into the database in the initialization block.

    INSERT INTO tablename (username, date) values (': USER ', sysdate);

  • How do I batch edit form fields that have already been filled (if possible)?

    I am currently working on an electrical infrastructure project.  I designed roughly 800 diagrams electrical manhole.  One such example is shown below:

    manholeexample.JPG

    In the upper left and lower left corners, I have included the 'name' of this particular look and it's adjacent looks (highlighted with red boxes).  During the presentation of information to the client, they asked that the 'E' in these names is replaced by a "WP" for the rest of their data.  Is there a way to do this without edit individually each form field on these 800 diagrams?  Don't forget, I want to keep the rest of the fields intact, including the number after the 'E '.  I'm not particularly text warned, so if anyone happens to have any suggestions, please guide me through it.  I'll check back often in the hope of a solution.  Thanks in advance for the help!

    Oops, replace 36/72 36 just, but is perhaps too. You are incrementing in points, not inches. I don't think I need a more whisky!

  • How can I stop Windows Vista Search Results including files that have already been deleted?

    I use Windows Vista Home Premium Version 6.0.  When I use the windows search feature (navigate from the 'new' start icon) search results include files that have been deleted.  This is quite annoying because it dilutes the value of the search result.

    Does anyone have a solution to this?  I have seen similar posts but no real solutions... any help would be much appreciated!  THX

    Rebuild the search Index to remove these "deleted": results

    http://www.tech-recipes.com/Rx/2103/vista_rebuilding_the_search_index/

    http://www.howtogeek.com/HOWTO/Windows-Vista/rebuilding-the-search-index-in-Windows-Vista/

    http://www.WikiHow.com/rebuild-Windows-Vista-search-index

    See you soon.

    Mick Murphy - Microsoft partner

  • How to insert data into the table of plain text stored as a CLOB in another table

    Hi people,

    Maybe it's an easy question for someone who is more frequently used files and CLOB.

    I have a table that stores text files in the CLOB column. Files text includes some basic data that I want to load in the other - a text line = a new insert for me. Is there a "trick" how to do it effectively?

    Here is my model:

    Table OS_IMPORT_DOCS, stores the complete files as CLOB
    SQL> desc OS_IMPORT_DOCS
    Name          Type           Nullable Default Comments 
    ------------- -------------- -------- ------- -------- 
    OBJECT_ID     NUMBER                                   
    DATUM_ZMENY   DATE                    sysdate          
    FILE_PATH     VARCHAR2(4000) Y                         
    FILE_NAME     VARCHAR2(4000) Y                         
    FILE_SIZE     NUMBER         Y                         
    LAST_MODIFIED DATE           Y                         
    DOCUMENT      CLOB           Y                         
    STATUS        VARCHAR2(15)   Y        'NEW'  
    Sample data from OS_IMPORT_DOCS
    SQL> select *
      2    from os_import_docs d
      3  order by d.last_modified desc
      4  ;
     
     OBJECT_ID DATUM_ZMENY FILE_PATH                      FILE_NAME       FILE_SIZE  LAST_MODIFIED DOCUMENT    STATUS
    ---------- ----------- ------------------------------ --------------- ---------- ------------- ----------- ---------------
       1815043 13.8.2012 1 d:\data\C120813.DAT            C120813.DAT          16800 13.8.2012 16: <<CLOB>>    NEW
       1815042 13.8.2012 1 d:\data\C120812.DAT            C120812.DAT           3600 12.8.2012 22: <<CLOB>>    NEW
       1815041 13.8.2012 1 d:\data\C120811.DAT            C120811.DAT           1800 11.8.2012 13: <<CLOB>>    NEW
    Example of file CLOB - stored text data (select d.document from os_import_docs d where d.object_id = 1815042 ;)
    061053120820120000AGT000002Osoby                   0000000042301000000017210632
    062322120820120000AGT000002Osoby                   0000000012301000000017197566
    063526120820120001AGT000002Osoby                   0000000012301000000017197566
    064234120820120001AGT000002Osoby                   0000000103301000000162218777
    Above the example text includes "columns" in plain text:
    timestamp - 1-14, SSMIHH24DDMMYYYY position format
    flag - post 15-18
    company code - position 19-27
    etc...

    How can I query data stored within the OS_IMPORT_DOCS. The DOCUMENT column, divide it into columns and insert into another table?
    I have to read this method of 'online' file?


    Thank you very much
    Tomas

    For the first three columns:

    SQL> create type TRecord is object (
      2    ts           timestamp
      3  , flag         varchar2(4)
      4  , company_code varchar2(9)
      5  );
      6  /
    
    Type created
    
    SQL>
    SQL> create type TRecordTable is table of TRecord;
      2  /
    
    Type created
    
    SQL>
    SQL> create or replace function parse_clob (p_doc in clob)
      2  return TRecordTable pipelined
      3  is
      4    lf      number;
      5    eol     varchar2(2) := chr(10);
      6    eollen  number := length(eol);
      7    line    varchar2(32767);
      8    offs    number := 1;
      9  begin
     10    loop
     11      lf := dbms_lob.instr(p_doc, eol, offs);
     12      if lf != 0 then
     13        line := dbms_lob.substr(p_doc, lf - offs + 1 - eollen, offs);
     14        offs := lf + eollen;
     15      else
     16        line := dbms_lob.substr(p_doc, dbms_lob.getlength(p_doc) - offs + 1, offs);
     17      end if;
     18      pipe row (
     19        TRecord(
     20          to_timestamp(substr(line, 1, 14), 'HH24MISSDDMMYYYY')
     21        , substr(line, 15, 4)
     22        , substr(line, 19, 9)
     23        )
     24      );
     25      exit when lf = 0;
     26    end loop;
     27  end;
     28  /
    
    Function created
    
    SQL>
    SQL> select t.*
      2  from os_import_docs d
      3     , table(parse_clob(d.document)) t
      4  where d.object_id = 1815042;
    
    TS                                     FLAG COMPANY_CODE
    -------------------------------------- ---- ------------
    12/08/12 06:10:53,000000               0000 AGT000002
    12/08/12 06:23:22,000000               0000 AGT000002
    12/08/12 06:35:26,000000               0001 AGT000002
    12/08/12 06:42:34,000000               0001 AGT000002
     
    
  • How to insert data into a BLOB column using sql

    Hi all

    How to insert data into the BLOB column directly using sql.
    create  table temp
    (
      a blob,
      b clob);
    
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
                                      *
    ERROR at line 1:
    ORA-01465: invalid hex number
    
    Please help in this.
    Thank you
    Prakash P

    Insert into temporary values (UTL_RAW. CAST_TO_RAW ('32aasdasdsdasdasd4e32'), 'adsfbsdkjf');

  • Cannot insert data into the database

    Hello world

    I stuck with a problem in DB juice. When I try to insert data into the database using DB tool, I get a repeated error message (error 1). Please find the my vifile below and solve say.

    Problem is use Labiew 8.2. So try to answer accordingly

    Try it with a cluster instead of a string or an array.

  • What trigger to use to insert data into the table db forms

    Hello

    My form is current having a block of database with the table reference. When you enter data into the form field and click Save. Automatically record is inserted in the database table.
    I want to do this under manual insert. I changed the block of data to a data non-base. Where should I write the insert statement to insert data into the table.
    Is - shutter release key of the form-level validation?

    Please notify.

    Thank you
    Didi.

    You can guide me how to remove the message FRM-40401 no changes to save and instead, I wanted to put 1 transaction record successful... some like it like that.

    Hi didi.
    And this is my last post I'll sleep. ;)
    Take form level trigger named preform
    and write on it

    :SYSTEM.MESSAGE_LEVEL := 5;
    

    I hope this works...

    Hamid

    Mark correct/good to help others to get the right answers. *

  • Insert data into another database with a script

    Hello.

    What is the best way to insert data into one database with a script

    INSERT INTO BF_PRUEBASMTP.bf_mtp_agr_inscription (ain_agreementid, ain_customerid, ain_paymethodsid, ain_servicemoduleid, referencia)

    SELECT AAG. AAG_AGREEMENTID, ACU. ACU_CUSTOMERID, 2, 2, ins. NUMERO_REFERENCIA

    OF BF_PRUEBASMTP.bf_mtp_agr_biller ABI

    JOIN IN-HOUSE

    BF_PRUEBASMTP. BF_MTP_AGR_AGREEMENT AAG ON ABI. ABI_BILLERID = AAG. AAG_BILLERID

    INNER JOIN 'CLIENTEUNICO. ALMUERZO" ins

    ON THE AAG. AAG_AGREEMENTID = ins. CONVENIOID

    INNER JOIN BF_PRUEBASMTP.bf_mtp_agr_customer ACU

    ON ACU.acu_typedocumentid = ins. TIPO_DOCUMENTO

    AND ACU.acu_numberid = ins. NUMERO_DOCUMENTO;

    CLIENTEUNICO. INSCRIPCIONES = SELECT * DE INSCRIPCIONES - to a DIFFERENT DATABASE


    Thank you very much.

    2931095 wrote:

    If I don't have permissions to create a database link. Is there another way to do this?

    Thank you.

    link to database IS the method by which an Oracle database accesses to a different database.

    If you are the ADMINISTRATOR, you should have permission.

    If you are not the ADMINISTRATOR, you should not have permission and need to talk to the ADMINISTRATOR that is allowed.

  • Insert data into the source of destinator Table

    Hi all

    Need to insert data in sample_table1 table xxc_source_table sample_table2

    create table xxc_source_table (DESCRIPTION varchar2 (10));

    Insert the table xxc_source_table values('A201.) ABC.4084.GR');

    create table sample_table1 (col_1 varchar2 (10), col_2 varchar2 (10), col_3 varchar2 (10), col_4 varchar2 (10));

    create table sample_table2 (col_1 varchar2 (10), col_2 varchar2 (10), col_3 varchar2 (10), col_4 varchar2 (10), moved_flag varchar2 (2));

    col_1 = A201

    col_2 = ABC

    col_3 = 4084

    col_4 = GR

    Note: Insert data into the col_1, the col_3, the col_4 of the xxc_source_table sample_table1

    (2) if the next (form xxc_source_table) data is exist in the sample_table2, and then set the moved_flag as Y in this column

    3) xxc_source_table has 17000 lines

    Thank you.

    Post edited by: Rajesh123 please do not consider cross the line message

    Hi Renon,

    Why you don't want substr and instr? For best performance, you should go with substr and instr instead of regexp_substr. However you asked me to provide the code instead of substr and InStr. Then try the below...

    INSERT ALL

    IN VALUES sample_table1 (col1, col2, col3, col4)

    IN sample_table2 VALUES (col1, col2, col3, col4, 'Y')

    SELECT REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 1) col1,.

    REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 2) col2.

    REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 3) col3.

    REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 4) col4

    OF xxc_source_table;

    Thank you

    Ann

  • The superdrive in my iMac (21.5, late 2009) refuses to mount new audio CD. It is very good with cds that have already been imported into iTunes and Ditto DVD. But the new CD is ejected, which means that I can't add anything to my music library on a cd.

    The superdrive in my iMac (21.5, late 2009, running OSX 10.10.3) refuses to mount new audio CD. He sees the cds, which have already been imported into iTunes (12.3.2.35) and same DVD. But new (IE back to the computer) cds are ejected, which means that I can't add anything to my music library on a cd. Any help would be appreciated!

    First try to reset the SMC & LANDAU 2 - 3 times back to back by LANDAU and Intel iMac SMC resets with all devices disconnected.

    If that does not resolve the problem, go to your local office supply store and get a CD/DVD cleaning kit and use it. If this does not work, then the SuperDrive is end of life and should be replaced. Many users with iMacs older everything just get external DVD readers, if you need to do this, I recommend you contact OWC (www.macsales.com) and they can direct you to one that fits your needs.

Maybe you are looking for

  • Virus infecting e-mail in mac air

    I think that my e-mail address is compromised by a virus. Sometimes it never ends download or send messages. In fact, many times it seems I sent messages, then were never sent. In addition, I have to force out several times. Can someone please advise

  • Color LaserJet CP2025: 2 SIDES PRINT

    When I upgraded my computer (HP Pavilion 500-267C) to 10 Windows, I lost the ability to automatically print on both sides. I looked for an updated driver, but it doesn't seem to be the one who will deal with this issue.

  • Microsoft Tengo an operating system 32-bit cuando lo puedo instalar

    Buenas noches me gustaria saber cuando puedo instalar esta vercion I have an asus team of 32-bit operating system

  • How to configure phones WIP 310 on the UC560?

    I just bought a UC560 for my Office VoIP system. Cisco sales assured me that WIP 310 wireless phones would work with it, but they do not appear in the list of supported phones. How can I get the defined on the system or a SIP softphone also?

  • spacing of the paragraphs is lost in the epub export

    When I export my file InD to an epub, all paragraphs are crushed together, without spaces between.  I tried to add styles to paragraph with 'space before' and 'after' but nothing works.  Adding extra line breaks or returns does not help, either.  The