Insert-Update on same page

A user filters a specific record based upon the record's name
and modification level and all the info based upon this filter is
then displayed on an edit page. The user can then change any field
except for the record name. Any changes are saved as an update to
the selected record. However, if the user changes the mod level, an
insert statement must be initiated and the changes must be saved as
a new record, not an update to the current record, therfore leaving
the filtered record as is. Any ideas on how to get this
accomplished would be greatly appreciated!!!

On your form, include a hidden field that has the original
mod level. On your processing page, compare the old with the new
and code accordingly.

Similar Messages

  • 8.0.2 Insert and Update on same page?

    With 8.0.2 is it possible to have an update and insert on the
    same page?

    On Fri, 19 Jan 2007 08:34:35 -0600, Lee
    <[email protected]>
    wrote:
    >Did you have to tweak the code to get them to work
    together (changing
    >function names) or did they work automatically?
    >
    >Perhaps it's just what I am trying to do with the page. I
    have two forms
    >and depending on which they need, either the update is
    used or the
    >insert is used.
    >
    >Does this still sound like it should work?
    Reply in the App Dev forum.
    Steve
    steve at flyingtigerwebdesign dot com

  • Insert and email same page

    Hi yea,
    I want a user to be able to submit a form and have that
    content inserted
    into a db at the same time, how do I know which will fire
    first.
    regards
    kenny

    never mind I figured it, the insert will go first then I wil
    have the thank
    you page sed the email onload.
    regards
    kenny
    "twocans" <[email protected]> wrote in message
    news:eing8l$5n4$[email protected]..
    > Hi yea,
    > I want a user to be able to submit a form and have that
    content inserted
    > into a db at the same time, how do I know which will
    fire first.
    >
    > regards
    >
    > kenny
    >
    >
    >
    >

  • Insert / update in same table

    SQL> select * from test;
    TT NAME
    1 hi
    1 re
    1 go
    2 rw
    2 gh
    2 lk
    6 rows selected.
    This is just a dummy table,but I would like to know how can I update the values of TT=2 to make it identical with the values of TT=1
    The table should look like
    SQL> select * from test;
    TT NAME
    1 hi
    1 re
    1 go
    2 hi
    2 re
    2 go
    In reality the records go into lacs

    One way:
    (untested)
    Delete from Test where TT=2;
    Insert into test t1
    select 2, t2.name from test t2 where tt=1;Added where clause, just in case if there are more values for TT.
    Message was edited by:
    Sven W.

  • SQL SERVER BULK FETCH AND INSERT/UPDATE?

    Hi All,
           I am currently working with C and SQL Server 2012. My requirement is to Bulk fetch the records and Insert/Update the same in the other table with some  business logic?
           How do i do this?
           Thanks in Advance.
    Regards
    Yogesh.B

    > is there a possibility that I can do a bulk fetch and place it in an array, even inside a stored procedure ?
    You can use Temporary tables or Table variables and have them indexes as well
    >After I have processed my records, tell me a way that I will NOT go, RECORD by RECORD basis, even inside a stored procedure ?
    As i said earlier, you can perform UPDATE these temporary tables or table variables and finally INSERT/ UPDATE your base table
    >Arrays are used just to minimize the traffic between the server and the program area. They are used for efficient processing.
    In your case you will first have to populate the array (Using some of your queries from the server) which means you will first load the arrary, do some updates, and then send them back to server therefore
    network engagement
    So I just gave you some thoughts I feel could be useful for your implementation, like we say, there are many ways so pick the one that works good for you in the long run with good scalability
    Good Luck! Please Mark This As Answer if it solved your issue. Please Vote This As Helpful if it helps to solve your issue

  • Same page for insert/update

    Hi there,
    Do someone knows about JSF patterns for using the same page/form for inserting and updating the same entities information ?
    2 use cases:
    1 --> the user browses a list of objects (DataTable), let's say Employees, clicks on one line and gets redirected to the employee details page so he can update the information;
    2 --> the user wants to create a new employee and goes to the same page which is empty.
    The way I am actually doing it: I have an employeeForm page and an EmployeeForm managed bean (session scope) which contains an instance of Employee. This Employee is initialized when an empty form is needed or sent by DataTable controller when employee details' are requested.
    This is not really nice to my point of view since the EmployeeForm controller has to re-initialize it's Employee instance after each usage.
    Does someone has a link or can provide a comment for a "best practise" on that topic?
    Thanks in advance,
    Fabrice.

    I think you should consider using the request scope of the employee bean, when navigating from dataTable to employeeForm overwrite the bean with the value from datatable
    otherwise the bean is created on every request.

  • Creation of new button on same page after insert command

    Hello All,
    I have an application running on apex.oracle.com where my workspace name is shruti_work,username is [email protected] and password is buwigi. The application name inside this is "app2"
    I am trying to achieve one functionality there but unable to get it so felt like seeking an help from experts here. I have two forms there one page1 form which is simplly made on an html region with go button which is navigating the page 1 items value to page 2 but simply passing their address witout updting the database table.
    In Page 2 i created page on a table or view, which made some extra buttons which i dont want like applychanges ,delete button, cancel button. I created a create button even which is updating my database with insert sql command. What i am seeing is after my create button is pressed i got navigated to same page 2 which i want to but the applychange button, cancel and delete button got appeared. I dont get the idea why it is so. i have checked the buttons even i didnt found anything there.
    All i want is when i press create button in page 2, my database get update and at the same page (2) a new button get appears which i have to use for other things. Approaching to this solution i created a button with giving databse action update and condition to this button "value of item in expression 1 is not null" and in expression 1 i passed p2_id...... but my new button is not getting created.
    Any help on this?

    Hi Jeff,
    I dont want applychanges button and delete button in my page 2. But when i created form on a table or view this but got created and i cannot delete it even. When i am navigating my page from page 1 to page 2 and filling the fields in page 2 and clicking create button, at that time i want after updating my table and running my plsql process which i have created which you can see in page processing, my button at same page get generate which i will use to navigate to other form. This button which i want to generate after clicking my create button will be meaningful only if my record get inserted in table. so that is why i want it at that time.
    I dont want any report so i am not creating form on a table or view

  • Multiple (updatable) details in the same page.

    Hello,
    I tried to put two updatable details in the same page and got the error
    "Updatable SQL Query already exists on page 11. You can only add one updatable SQL query per page. Select a different page"
    So having more than one updatable detail is not allowed in apex ?
    I have a master table with three details. Should I create one page for each one of them ?
    Thanks in advance
    Bye
    Nicola

    What you want to use are called collections. Here is a simple collection example:
    The process goes in 4 steps: gather the data, display the data, update based on user input, then write the changes. Each step requires it's own piece of code, but you can extend this out as far as you want. I have a complex form that has no less than a master table and 4 children I write to based on user input, so this can get as complex as you need. Let me know if anything doesn't make sense.
    First, create the basic dataset you are going to work with. This usually includes existing data + empty rows for input. Create a Procedure that fires BEFORE HEADER or AFTER HEADER but definitely BEFORE the first region.
    DECLARE
      v_id     NUMBER;
      var1     NUMBER;
      var2     NUMBER;
      var3     VARCHAR2(10);
      var4     VARCHAR2(8);
      cursor c_prepop is
      select KEY, col1, col2, col3, to_char(col4,'MMDDYYYY')
        from table1
        where ...;
      i         NUMBER;
      cntr      NUMBER := 5;  --sets the number of blank rows
    BEGIN
      OPEN c_prepop;
        LOOP
          FETCH c_prepop into v_id, var1, var2, var3, var4;
          EXIT WHEN c_prepop%NOTFOUND;
            APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => v_id,  --Primary Key
            p_c002 => var1, --Number placeholder
            p_c003 => var2, --Number placeholder
            p_c004 => var3, --text placeholder
            p_c005 => var4 --Date placeholder
        END LOOP;
      CLOSE c_prepop;
      for i in 1..cntr loop
        APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => 0, --designates this as a new record
            p_c002 => 0, --Number placeholder
            p_c003 => 0, --Number placeholder
            p_c004 => NULL, --text placeholder
            p_c005 => to_char(SYSDATE,'MMDDYYYY') --Date placeholder
      end loop;
    END;Now I have a collection populated with rows I can use. In this example I have 2 NUMBERS, a TEXT value, and a DATE value stored as text. Collections can't store DATE datatypes, so you have to cast it to text and play with it that way. The reason is because the user is going to see and manipulate text - not a DATE datatype. If you are using this as part of a master/detail form, make sure that your SQL to grab the detail is limited to just the related data.
    Now build the form/report region so your users can see/manipulate the data. Here is a sample query:
    SELECT rownum, apex_item.hidden(1, c001),  --Key ID
         apex_item.text(2, c002, 8, 8) VALUE1,
         apex_item.text(3, c003, 3, 3) VALUE2,
         apex_item.text(4, c004, 8, 8) VALUE3,
         apex_item.date_popup(5, null,c005,'MMDDYYYY',10,10) MY_DATE
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'This will be a report just like an SQL report - you're just pulling the data from the collection. You can still apply the nice formatting, naming, sorting, etc. of a standard report. In the report the user will have 3 "text" values and one Date with Date Picker. You can change the format, just make sure to change it in all four procedures.
    What is critical to note here are the numbers that come right before the column names. These numbers become identifiers in the array used to capture the data. What APEX does is creates an array of up to 50 items it designates as F01-F50. The F is static, but the number following it corresponds to the number in your report declaration above, ie, F01 will contain the primary key value, F02 will contain the first numeric value, etc. While not strictly necessary, it is good practice to assign these values so you don't have to guess.
    One more note: I try to align the c00x values from the columns in the collection with the F0X values in the array to keep myself straight, but they are separate values that do NOT have to match. If you have an application you think might get expanded on, you can leave gaps wherever you want. Keep in mind, however, that you only have 50 array columns to use for data input. That's the limit of the F0X array even though a collection may have up to 1000 values.
    Now you need a way to capture user input. I like to create this as a BEFORE COMPUTATIONS/VALIDATIONS procedure that way the user can see what they changed (even if it is wrong). Use the Validations to catch mistakes.
    declare
      j pls_integer := 0;
    begin
    for j1 in (
      select seq_id from apex_collections
      where collection_name = 'MY_COLLECTION'
      order by seq_id) loop
      j := j+1;
      --VAL1 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>2,p_attr_value=>wwv_flow.g_f02(j));
      --VAL2 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>3,p_attr_value=>wwv_flow.g_f03(j));
      --VAL3 (text)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>4,p_attr_value=>wwv_flow.g_f04(j));
      --VAL4 (Date)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f05(j));
    end loop;
    end;Clear as mud? Walk through it slowly. The syntax tells APEX which Collection (p_collection_name), then which row (p_seq), then which column/attribute (p_attr_number) to update with which value (wwv_flow.g_f0X(j)). The attribute number is the column number from the collection without the "c" in front (ie c004 in the collection = attribute 4).
    The last one is your procedure to write the changes to the Database. This one should be a procedure that fires AFTER COMPUTATIONS AND VALIDATIONS. It uses that hidden KEY value to determine whether the row exists and needs to be updated, or new and needs to be inserted.
    declare
    begin
      --Get records from Collection
      for y in (select TO_NUMBER(c001) x_key, TO_NUMBER(c002) x_1,
                 TO_NUMBER(c003) x_2,
                 c004 x_3,
                 TO_DATE(c005,'MMDDYYYY') x_dt
               FROM APEX_COLLECTIONS
               WHERE COLLECTION_NAME = 'MY_COLLECTION') loop
        if y.x_key = 0 then  --New record
            insert into MY_TABLE (KEY_ID, COL1,
                COL2, COL3, COL4, COL5)
              values (SEQ_MY_TABLE.nextval, y.x_1,
                  y.x_2, y.x_3, y.x_4, y.x_dt);
        elsif y.x_key > 0 then  --Existing record
            update MY_TABLE set COL1=y.x_1, COL2=y.x_2,
                 COL3=y.x_3, COL4=y.x_4, COL5=y.x_dt
             where KEY_ID = y.x_key;
        else
          --THROW ERROR CONDITION
        end if;
      end loop;
    end;Now I usually include something to distinguish the empty new rows from the full new rows, but for simplicity I'm not including it here.
    Anyway, this works very well and allows me complete control over what I display on the screen and where all the data goes. I suggest using the APEX forms where you can, but for complex situations, this works nicely. Let me know if you need further clarifications.

  • New Update (2014.1) - How to have multiple compositions on same page?

    With the latest update, it seems as though Edge now always assumes that the composition has an element ID of "Stage". Previously, I was able to have multiple compositions on the same HTML page by simply altering the default id of "Stage" for each composition to something unique. Any workarounds for having multiple compositions on the same page utilizing the 2014.1 update?

    You can use the following approach
    Dropbox - Multiple.zip
    <!DOCTYPE html>
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
      <title>Untitled</title>
    <!--Adobe Edge Runtime-->
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <script type="text/javascript" charset="utf-8" src="edge_includes/edge.5.0.0.min.js"></script>
        <style>
           .edgeLoad-EDGE-77458053 { visibility:hidden; }
            .edgeLoad-EDGE-77430105 { visibility:hidden; }
        </style>
    <script>
       AdobeEdge.loadComposition('2', 'EDGE-77458053', {
        scaleToFit: "none",
        centerStage: "none",
        minW: "0",
        maxW: "undefined",
        width: "550px",
        height: "400px"
    }, {dom: [ ]}, {dom: [ ]});
    AdobeEdge.loadComposition('1', 'EDGE-77430105', {
        scaleToFit: "none",
        centerStage: "none",
        minW: "0",
        maxW: "undefined",
        width: "550px",
        height: "400px"
    }, {dom: [ ]}, {dom: [ ]});
    </script>
    <!--Adobe Edge Runtime End-->
    </head>
    <body style="margin:0;padding:0;">
      <div id="Stage1" class="EDGE-77458053">
      </div>
        <div id="Stage2" class="EDGE-77430105">
        </div>
    </body>
    </html>
    -Siva

  • My firefox wont load any page. Says it cant find the server of any of them. I can view the same pages in safari. I just updated to 3.6.7 and now having this problem. What is happening?

    My firefox wont load any page. Says it cant find the server of any of them. I can view the same pages in safari. I just updated to 3.6.7 and now having this problem. What is happening?
    == This happened ==
    Every time Firefox opened
    == Today ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16

    Read this somewhere else: Can't find it again so can't reference - apols.
    fixed by entering
    about:config into the nav bar
    toggle dom.storage.enabled to 'true'
    worked for me - but don't know what it does or why :)

  • New details on same page won't insert

    Hi,
    I am not able to get a master-detail-on-same-page to work properly.
    It is created with a wizard.
    After adding the first row and entering data, the row is lost when clicking Apply Changes of the master.
    The row is not inserted in the database.
    When I first add a second row without entering data, the first row is inserted when clicking Apply Changes of the master.
    Also when adding the second row, an extra Apply Changes button appears for the details.
    I am using theme '14. Modern' in APEX 3.0.1 on 10g XE.
    Any help will be welcome,
    Martijn

    Hi again,
    The same problem can be seen when following the Advanced Tutorial topic 'How to Create a Master Detail PDF Report'.
    After following the instructions you get a report with master detail form.
    When all detail rows are deleted, the Apply Changes button of the details table disappears.
    You now can add a fill in a new row. However the Apply Changes button won't save your new detail row. Though adding a next row without entering data will save the first row, and the Apply Changes button reappears.
    So, after all the job is done. However it is not the way of working we will instruct end users.
    Is their a way to get the Apply Changes reappear just after adding the first row?
    Thanks in advance,
    Martijn

  • How to insert into 2 tables from the same page (with one button  link)

    Hi,
    I have the following 2 tables....
    Employees
    emp_id number not null
    name varchar2(30) not null
    email varchar2(50)
    hire_date date
    dept_id number
    PK = emp_id
    FK = dept_id
    Notes
    note_id number not null
    added_on date not null
    added_by varchar2(30) not null
    note varchar2(4000)
    emp_id number not null
    PK = note_id
    FK = emp_id
    I want to do an insert into both tables via the application and also via the same page (with one button link). I have made a form to add an employee with an add button - adding an employee is no problem.
    Now, on the same page, I have added a html text area in another region, where the user can write a note. But how do I get the note to insert into the Notes table when the user clicks the add button?
    In other words, when the user clicks 'add', the employee information should be inserted into the Employees table and the note should be inserted into the Notes table.
    How do I go about doing this?
    Thanks.

    Hi,
    These are my After Submit Processes...
    After Submit
    30     Process Row of NOTES     Automatic Row Processing (DML)     Unconditional
    30     Process Row of EMPLOYEES     Automatic Row Processing (DML)     Unconditional
    40     reset page     Clear Cache for all Items on Pages (PageID,PageID,PageID)     Unconditional
    40     reset page     Clear Cache for all Items on Pages (PageID,PageID,PageID)     Unconditional
    40     reset page     Clear Cache for all Items on Pages (PageID,PageID,PageID)     Unconditional
    40     reset page     Clear Cache for all Items on Pages (PageID,PageID,PageID)     Unconditional
    50     Insert into Tables     PL/SQL anonymous block     Conditional
    My pl/sql code is the same as posted earlier.
    Upon inserting data into the forms and clicking the add button, I get this error...
    ORA-06550: line 1, column 102: PL/SQL: ORA-00904: "NOTES": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
         Error      Unable to process row of table EMPLOYEES.
    Is there something wrong with the pl/sql code or is it something else?

  • Insert then update on same row in bean Transaction leads to deadlock

    <b>Setup Details</b>
    Hibernate version: 3.1.2
    EJB version: 2.0
    Name and version of the database : MS SQL Server 2000
    Datasource implmentation class being used : com.sap.nwmss.jdbcx.sqlserver.SQLServerDataSource
    We are using SAP NetWeaver Application Server 6.0 and Hibernate 3.1.2 in our application. We have StalessSessionBeans which use Hibernate to interact with the database. We are running into a situation where the application goes into a hang state when the following flow is bein executed:
    //transaction attribute = "Required"
    beanMethod() {
    myObj = new MyObj();
    myObj.setSomeValue();
    session = SessionFactory.openSession();
    //id is auto generated by database
    id = session.insert(myObj);
    //retrieve the recently inserted obj
    myUpdatedObj = session.load(id);
    //modify the myUpdatedObj
    myUpdatedObj.modifySomeValue();
    //update using hibernate session
    session.update(myUpdatedObj);
    //return from method 
    Here's the flow:
    1) In a CMT stateless session bean, there's a method which has transaction atrribute as "Required"
    2) This method creates a new object and inserts it
    3) Then loads this saved object and modifies some values in it
    4) Then invokes the update method on the session to update this modified object in the database.
    Note: We have enabled auto flush on transaction in the hibernate configuration file.
    And here's what we are observing:
    - The insert obtains a lock on the row as part of the transaction
    - When the update is called on the same row as part of the auto flush, the update never completes. The update statement is unable to obtain a lock on the same row.
    Here is some additional info:
    - We have set :
    session.connection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    hibernate.cfg.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
                "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
       <session-factory>
          <property name="hibernate.jndi.class">
             com.sap.engine.services.jndi.InitialContextFactoryImpl
          </property>
          <property name="hibernate.session_factory_name">
             HibernateSessionFactory
          </property>
          <property name="hibernate.transaction.factory_class">
             org.hibernate.transaction.JTATransactionFactory
          </property>
          <property name="hibernate.connection.datasource">jdbc/SQLPool1</property>
          <property name="hibernate.connection.pool_size">25</property>
          <property name="show_sql">true</property>
          <property name="hibernate.connection.isolation">1</property>
          <property name="hibernate.prepare_sql">true</property>
          <property name="hibernate.statement_cache.size">10000</property>
          <!--property name="hibernate.jdbc.use_scrollable_resultset">true</property-->
          <property name="transaction.manager_lookup_class">
             com.tdemand.server.util.hibernate.SAPWebASTransactionManagerLookup
          </property>
          <property name="hibernate.jdbc.use_get_generated_keys">
                   false
          </property>
          <property name="hibernate.transaction.flush_before_completion">true</property>
          <property name="hibernate.jdbc.batch_size">1000</property>
          <property name="hibernate.cache.use_second_level_cache">false</property>
       </session-factory>
    </hibernate-configuration>
    Any clue why the update query is having problem in completing, even though update and insert are being called from the same bean method as part of a transaction?
    Here's the log:
    2006-11-01 22:10:00,310 INFO [com.tdemand.server.planning.ejbs.ForecastPlanningSessionBean] - Starting save
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - saving transient instance
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - saving transient instance
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - executing insertions
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - executing insertions
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Inserting entity: com.tdemand.generated.pojo.TdForecastPlan (native id)
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Inserting entity: com.tdemand.generated.pojo.TdForecastPlan (native id)
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2006-11-01 22:10:00,310 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.SQL] - insert into trd0nedbo.TD_FORECAST_PLAN (ORGANIZATION_TBL_ID, USER_TBL_ID, PLAN_NAME, IS_ACTIVE, PLAN_TYPE, TIMECREATED, TIMEUPDATED, START_TIME, END_TIME, HORIZON, HORIZON_UOM, REVIEW_FREQ, ACCU_THRESHOLD, REVIEW_FREQ_UOM, FORECAST_METRIC, BASE_FORECAST, PRECISION_FORECAST, ADJUSTED_FORECAST, ORG_ID, CRON_TRIG_NAME) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.SQL] - insert into trd0nedbo.TD_FORECAST_PLAN (ORGANIZATION_TBL_ID, USER_TBL_ID, PLAN_NAME, IS_ACTIVE, PLAN_TYPE, TIMECREATED, TIMEUPDATED, START_TIME, END_TIME, HORIZON, HORIZON_UOM, REVIEW_FREQ, ACCU_THRESHOLD, REVIEW_FREQ_UOM, FORECAST_METRIC, BASE_FORECAST, PRECISION_FORECAST, ADJUSTED_FORECAST, ORG_ID, CRON_TRIG_NAME) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Dehydrating entity: [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,325 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] - Dehydrating entity: [com.tdemand.generated.pojo.TdForecastPlan#<null>]
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '6' to parameter: 1
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '6' to parameter: 1
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '1' to parameter: 2
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.LongType] - binding '1' to parameter: 2
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'jaikiranpai' to parameter: 3
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'jaikiranpai' to parameter: 3
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'Y' to parameter: 4
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'Y' to parameter: 4
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'RetailDCOrderForecast' to parameter: 5
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'RetailDCOrderForecast' to parameter: 5
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 6
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 6
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 7
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 7
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 8
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding '2006-11-01 22:10:00' to parameter: 8
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 9
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 9
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '14' to parameter: 10
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '14' to parameter: 10
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 11
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 11
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '7' to parameter: 12
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '7' to parameter: 12
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '0' to parameter: 13
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding '0' to parameter: 13
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 14
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'DAY' to parameter: 14
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'MAPE' to parameter: 15
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding 'MAPE' to parameter: 15
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 16
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 16
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 17
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 17
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 18
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 18
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding null to parameter: 19
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.BigDecimalType] - binding null to parameter: 19
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 20
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 20
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] - Natively generated identity: 103
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] - Natively generated identity: 103
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
    2006-11-01 22:10:00,341 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement

    "insert into aa values ('1', '2', '3','4','5',6,7);
    if sql%rowcount <> 1 then
    RAISE_APPLICATION_ERROR(-20999, 'insert aa err');
    END IF;
    /* skip some code
    update aa set dept_code = '3' where fee_month = '1';
    if sql%rowcount <> 1 then"
    Is Dept_Code the 2nd Column in the table aa. If so then
    why update the table ?
    Why not Insert Into aa Values ('1', '3', '3' ......);
    Have a look at the sample script which is doing Insert followed by updating the same table using the ROWID.
    Test Db>desc temp;
    Name Null? Type
    COL1 VARCHAR2(10)
    COL2 VARCHAR2(10)
    COL3 VARCHAR2(10)
    COL4 VARCHAR2(10)
    ID NUMBER
    Test Db>select * from temp;
    no rows selected
    Test Db>get t1
    1 Set ServerOutput On Size 999999;
    2 Declare
    3 lRow Varchar2(50);
    4 Begin
    5 Insert Into Temp (Col1, Col2, Col3, Col4, Id)
    6 Values ('A', 'B', 'C', 'D', 100)
    7 RETURNING RowId Into lRow;
    8 Dbms_Output.Put_Line ('RowId = ' || lRow);
    9 Update Temp Set col2 = 'B1'
    10 Where RowId = lRow;
    11 Dbms_Output.Put_Line ('Row Updated');
    12* End;
    13 /
    Test Db>@t1
    RowId = AAAKsqAAJAAAEbsAAG
    Row Updated
    PL/SQL procedure successfully completed.
    Test Db>select * from temp;
    COL1 COL2 COL3 COL4 ID
    A B1 C D 100
    -- Shailender Mehta --

  • Selecting from one table and Update another in the same Page

    Could someone help me with this HTMLDB task. In my page design, I am selecting data from two tables (masters: DEPT, EMP) which I want to display on the left column of the page and at the same time a user would be able to update another table (ATTENDANCE:with many children) which would have a radiogroup on the right side for each value of the master such as employee name. The placement of data has to appear in corresponding rows on the page. For instance, employee names of the master table must appear on the same row with its corresponding child value. The page would be grouped by DEPT_NO. The user would click on the department name, a new page with the employee name would apprar. From that page, the user would then update attendance column for each employee in that department. In this operation, it is only the ATTENDANCE table that is being updated. I can send out more information about the structure of the tables if you need more information. I tried many HTMLDB options, forms, reports, etc. I have not been able to get quite right. Your help will be appreciated.

    Raju,
    Thanks for responding to my problem. I have actually tried using the example on how-to you sent me a link to but it did not help as I expected. You see, the page would be updated every meeting date for each employee. I can send you more information about the table structure if you like. However, let me see if this will help you a bit.
    Tables are: 1) Dept [dept_no (pk),dept_name] 2) EMP [emp_no (pk),emp_name, dept_no(fk)] 3) Meetings [meet_key(pk),attended, meeting_date, emp_no(fk)]
    What I want to do is create two pages, one would list the departments, when a user selects a department, the user would be linked to a meeting attandance page. The meeting attendance page would list department name once, Meeting date once, and then list employees in that department. At the right column of every employee would be a checkbox for meeting.attended for update. The meeting_date would be pre-populated so that what the user would do is just check Yes/NO. The second page is the one I'm having the most problem with.
    If I can do a fetch from dept, emp, and meetings and then do an update on the Meetings table on the same page, I think that might solve the problem. That was how I solved it in MS Access three years ago.
    Here is email address in case you want to contact me directly. [email protected]
    Thanks again for your help.

  • MRU and manual updatable report on same page

    ok. I understand that we can't have more than one MRU process on a page. Actually it seems 2 regions using the same MRU seems to work fine, but I had a problem adding a 3rd region with a new MRU. So I resorted to putting in my own updatable report. The code works well if I use an independent page but does not do anything as soon as I add it to the page with the MRU process.
    The base query is like:
    select '***' as select_plate,
    htmldb_item.hidden(31,p.plate_id) plate_id,
    p.plate_ID "Plate Id",
    htmldb_item.text(37, PLATE_BARCODE, 30) plate_barcode,
    PLATE_TYPE ,
    htmldb_item.checkbox(23, p.plate_id) sel,
    htmldb_item.checkbox(8, p.plate_id) child,
    htmldb_item.select_list_from_query(33, modified_by, 'select first_name || '' '' || last_name uname, upper(username) username from eims_user') modified_by,
    MODIFIED_ON ,
    STATUS,
    UPLOADED_ON,
    decode(p.FILENAME, null, 'N', 'Y') loaded,
    pr.run_id assay_run
    from plate p, plate_run pr
    where p.plate_type = 'zzz'
    and p.plate_id = pr.plate_id (+)
    the update process looks like
    begin
    :p2_message := 'ok0';
    for i in 1..htmldb_application.g_f31.count
    loop
    :p2_message := 'ok1';
    :p2_message := :p2_message || htmldb_application.g_f31(i);
    --if htmldb_application.g_f31(i) is not null then
    update plate set plate_barcode = htmldb_application.g_f37(i),
    modified_by = htmldb_application.g_f33(i)
    where plate_id = htmldb_application.g_f31(i);
    --end if;
    end loop;
    I added the p2_message to kind of trace what is happening. ok0 gets outputed in the multi-region page and nothing happen for the aupdate; while on the test page with this report as the only regio, I get the expected behavior and the update goes in correctly!
    Is it correct to assume that the g_fxx arrays global to a page? I used g_f3x just to make sure there is no conflict with the ones generated with the MRU process.
    Any help/hint is appreciated
    --Nabil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Alex,
    You can use more than one region in the same page or even you can create multiple report in the same page. But remember you can not create as many region as you want, ofcourse there is limitation. Same theory applies to item.
    Hope this helps.
    Regards,
    M Tajuddin
    web: http://tajuddin.whitepagesbd.com

Maybe you are looking for