Insert a field and update the same row.

Hi,
I am inserting a value in a row.
And later within a cursor loop I am trying to update the same row. But it is not working....
CREATE OR REPLACE procedure Del_Note_stage
Is
v_delNote Delivery_Note.Delivery_Note_id%type;
Cursor C1 is Select Heading_Name,File_Data from Sqlload_Stage;
Begin
dbms_output.put_line('i am here a ');
Select Delivery_Note_Id_Seq.nextval into v_delNote from dual;
Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED) Values(v_delNote,sysdate,'Config','N');
commit;
dbms_output.put_line('i am here b'||v_delNote);
For sqlload_rec in C1
   Loop
    dbms_output.put_line(sqlload_rec.Heading_Name);
    dbms_output.put_line('Del Note Id is :'||v_delNote);
    update DELIVERY_NOTE_STAGING  set deployed_by='TOM' where delivery_note_id=v_delNote;
End loop;
End;

But it is not working....Why not?
Please read: http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
Why are you updating after inserting?
Just add deployed_by to the insert statement, or use a default value for that column.
Also you don't need to select your Delivery_Note_Id_Seq.nextval from dual, just use it in your insert statement.
Something like:
Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED,deployed_by )
Values( Delivery_Note_Id_Seq.nextval,sysdate,'Config','N', 'TOM' /*or USER*/);

Similar Messages

  • Change field value in a table, based on another field value in the same row (for each added row)

    Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
    I am using this code :
    <HTML>
    <HEAD>
    <SCRIPT>
    function addRow(tableID) {
    var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
    for(var i=0; i<colCount; i++ ) {
    var newcell = row.insertCell(i);
    newcell.innerHTML = table.rows[1].cells[i].innerHTML;
    switch(newcell.childNodes[0].type) {
    case "text":
    newcell.childNodes[0].value = "";
    break;
    case "checkbox":
    newcell.childNodes[0].checked = false;
    break;
    case "select-one":
    newcell.childNodes[0].selectedIndex = 0;
    break;}}}
    function deleteRow(tableID) {
    try {var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    for(var i=0; i<rowCount; i++) {
    var row = table.rows[i];
    var chkbox = row.cells[0].childNodes[0];
    if(null != chkbox && true == chkbox.checked) {
    if(rowCount <= 2) {
    alert("Cannot delete all the rows.");
    break;}
    table.deleteRow(i);
    rowCount--;
    i--;}}}catch(e) {alert(e);}}
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
    <INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
    <TABLE id="dataTable" width="350px" border="1">
    <TR>
    <TD width="32"></TD>
    <TD width="119" align="center"><strong>Activity</strong></TD>
    <TD width="177" align="center"><strong>Cost</strong></TD>
    </TR>
    <TR>
    <TD><INPUT type="checkbox" name="chk"/></TD>
    <TD>
    <select name="s1" id="s1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </TD>
    <TD><input type="text" name="txt1" id="txt1"></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • Updating the same row in different sessions

    Hi,
    I've one table application(appl_no varchar2(10), locked_user varchar2(8)) which is used to track which user is logged in at present.
    As soon as any user is logged in to the system via front end, the user ID is populated to locked_user column so that no other user cannot access the same appl_no. As soon as the user exits from the front end, the locked_user is updated to null.
    We've experiencing a strange behaviour in our system where one user exits from front end and at the same time(previous transaction is not committed) the same user ID opens the same application in another session, but the session session doesn't gets hanged(waiting for the lock to be released) and tries to update the same row which was locked by first user's session. We come to know this thing when the trigger on the table gets fired in both sessoins.
    Now I want to know if there is any locking machanism in Oracle where the same row can be updated in 2 different sessons one after another when the first session has not committed its changes?
    Thanks
    Deepak

    And obviously no two sessions can update the same record at the same time
    Yes I know that and I tried the same thing by myself on 2 different sql sessions which is not happening, but this is happening when the same is being done from front end(Power Builder based application).
    Just wanted to check is there any possibility where this can be possible?
    Thanks
    Deepak

  • Possible? two users/computers to share and update the same calendar?

    We would like to have two people update the same calendar. How is this possible? Subscribers can't update?
    Thanks

    In short it isn't possible (currently). Subscribers cannot edit a calendar they subscribe to - it is read-only.
    See this thread for more detail: http://discussions.apple.com/thread.jspa?threadID=705054&tstart=45

  • Compare and update the same Column

    Hi ,
    SQL&gt; select * from
    v$version;
    BANNER
    Oracle Database 10g Express
    Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 -
    Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows:
    Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 -
    Production
    I am having an issue in Updating the column in a Table.......
    What i am trying to do is ...Compare 2 column and then update one of the compared column....
    Table 1 Name: TEST1 _
    bq. LNID \\ NEW_AN8 \\ OLD_AN8 \\ OLD_DESC \\ 2 \\ 123002 \\ 100001 \\ C2370 \\ 125846 \\ 100001 CS24 \\ 123024 \\ 100028 \\ C2392 \\ 125868 \\ 100028 CS25 \\ 123025 \\ 100036 C2393 \\ 125869 \\ 100036 CS26 123026 \\ 100116 \\ C2394 \\ 125870 \\ 100116 \\ CS
    TEST2_
    SZAN8     SZAN82     SZAN86     SZAT1
    123,002 100,001 100,001 C
    125,846 100,001 100,001 CS
    123,024 100,028 100,028 C
    125,868 100,028 100,028 CS
    125,869 100,036 100,036 CS
    123,025 100,036 100,036 C
    125,870 100,116 100,116 CS
    123,026 100,116 100,116 C
    I wanted to update SZAN82 of TEST2 table..... based on the SZAT1 value ...
    I shud be able to pick the CS type record first then the C type record and the SZAN82 value and check whether it is present in the TEST1 table if it present then I shud update the AN82 value,,
    UPDATE LPLSCHEMA.LPL_F0101Z2_CUSTOMER C SET (SZAN82)=
    (SELECT NEW_AN8 FROM LPL_CROSS_CUSTOMER B,LPL_F0101Z2_CUSTOMER C WHERE C.SZAT1='CS' AND B.OLD_DESC='CS'and C.szan82=B.old_an8);
    I tried like tis .... i got an Error sub query more than one rows ...
    Thanks in Advance !!
    Ananda
    Edited by: Ananda on Jan 2, 2009 6:30 PM
    Edited by: Ananda on Jan 2, 2009 6:30 PM
    Edited by: Ananda on Jan 2, 2009 6:34 PM
    Edited by: Ananda on Jan 2, 2009 6:37 PM

    Or:
    UPDATE  LPLSCHEMA.LPL_F0101Z2_CUSTOMER C
      SET   SZAN82 = (
                      SELECT  NEW_AN8
                        FROM  LPL_CROSS_CUSTOMER B
                        WHERE C.SZAT1='CS'
                        AND B.OLD_DESC='CS'
                        AND C.szan82=B.old_an8
      WHERE (SZAT1,szan82) IN (
                                SELECT  'CS',
                                        old_an8
                                  FROM  LPL_CROSS_CUSTOMER B
                                  WHERE B.OLD_DESC='CS'
                              );Or, depending on your version and table structure:
    UPDATE  (
             SELECT  C.SZAN82,
                     B.NEW_AN8
               FROM  LPL_CROSS_CUSTOMER B,
                     LPL_F0101Z2_CUSTOMER c
                     WHERE C.SZAT1='CS'
                     AND B.OLD_DESC='CS'
                     AND C.szan82=B.old_an8
      SET   SZAN82 = NEW_AN8
    /SY.

  • Inserting sequence value from JDBC and getting the same value back

    Hi: Gurus I have a table whose primary key is a sequence. I wonder how to make sure I get the same sequence value back for current transaction so I update the other table whose foreign key is the sequence value from first table.
    E.g lets say I do this
    String query_insert = INSERT INTO table1 (column1, ....) VALUES (HIGHLIGHT_ID_SEQ.nextval, ...);
    pstmt = con.prepareStatement(query_insert);
    pstmt.executeUpdate();
    How I make sure no other transaction update the sequence value so I can read the last inserted sequence value and update the second table with this value
    String query_select = "SELECT HIGHLIGHT_ID_SEQ.currval FROM DUAL";
    pstmt = con.prepareStatement(query_select);
    Regards,
    Rashid.

    <rant>No version again. I wonder why people requiring help want to stay anonymous and never want to type their version, only 4 digits. In this case, jdbc, not only the version of the driver is important, but also it's type. Waving a magic wand again? </rant>
    Look up the returning into clause of the insert statement in the sql reference manual for your version.
    Sybrand Bakker
    Senior Oracle DBA

  • Two Infopath forms to submit or update the same sharepoint list

    Hi, I'm building a request SharePoint site so users can submit a request from a simplified InfoPath form (with only 5 out of 10 fields), but support personnel can open the form and then see all 10 fields.  For the list view, I know I can create custom
    views when user's see the list.  But when they open an item, I only want them to see the fields they entered and not the other fields the support personnel can see.  So I guess my question is: can I create two InfoPath forms to update one list or
    can I create an InfoPath form that has two views so one view suppresses fields and the other does not (based on permissions perhaps).

    Hi Darby,
    I would suggest creating two views, instead of two forms. Views can be shown/hidden based on the logged in users, takes few rules to configure based on the logged in users. you can also explore web service to get the users from groups to show/hide based
    on the user group, little overhead but give more control due to the fact of one single form.
    Two forms will be bit complex, if you want to update the same rows of information.
    here are some references -
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    http://claytoncobb.wordpress.com/2009/06/21/userprofileservice-extended/
    http://sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=daba3a3b%2Dc338%2D41d8%2Dbf52%2Dcd897d000cf3&ID=80&Web=dbb90e85%2Db54c%2D49f4%2D8e97%2D6d8258116ca0
    http://office.microsoft.com/en-us/infopath-help/add-delete-and-switch-views-pages-in-a-form-HA101732801.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • How to generate a value to field in a row based on another two fields in the same row ???

    I have a quantity and unit price and there is also a field in the same row called total price. I want to get the value automatically of total price from multiplying quantity and unit price.

    Here you go:
    page code
                            <af:panelGroupLayout id="pgl2" layout="horizontal" styleClass="AFStretchWidth">
                                <af:inputText label="Quantity" id="quantity" value="#{bindings.quantity1.inputValue}" autoSubmit="true"
                                              valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                                <af:spacer width="10" height="10" id="s1"/>
                                <af:inputText label="Price" id="price" value="#{bindings.price1.inputValue}" autoSubmit="true"
                                              valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                                <af:spacer width="10" height="10" id="s2"/>
                                <af:inputText label="Sum" id="total" value="#{bindings.total1.inputValue}" partialTriggers="quantity price" readOnly="true"/>
                            </af:panelGroupLayout>
    page bindings
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="12.1.2.66.68" id="SetItemPageDef" Package="de.hahn.blogtest12c.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables">
          <variable Name="quantity" Type="java.lang.Number"/>
          <variable Name="price" Type="java.lang.Number"/>
          <variable Name="total" Type="java.lang.Number"/>
        </variableIterator>
      </executables>
      <bindings>
        <attributeValues IterBinding="variables" id="quantity1">
          <AttrNames>
            <Item Value="quantity"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="variables" id="price1">
          <AttrNames>
            <Item Value="price"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="variables" id="total1">
          <AttrNames>
            <Item Value="total"/>
          </AttrNames>
        </attributeValues>
      </bindings>
    </pageDefinition>
    and bean code
        public void valueChangeListenerItem(ValueChangeEvent valueChangeEvent) {
            String comp = valueChangeEvent.getComponent().getId();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("quantity1");
            Number q = (Number) attr.getInputValue();
            if (q == null)
                q = 0;
            attr = (AttributeBinding) bindings.getControlBinding("price1");
            Number p = (Number) attr.getInputValue();
            if (p == null)
                p = 0;
            if ("price".equals(comp)) {
                p = (Number) valueChangeEvent.getNewValue();
            } else {
                q = (Number) valueChangeEvent.getNewValue();
            // set new value
            attr = (AttributeBinding) bindings.getControlBinding("total1");
            Number t = q.doubleValue() * p.doubleValue();
            attr.setInputValue(t);
            // update Total
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            UIComponent ui = facesCtx.getViewRoot().findComponent("total");
            if (ui != null) {
                // PPR refresh a jsf component
                AdfFacesContext.getCurrentInstance().addPartialTarget(ui);
    Timo

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

  • Get Min value and another column value from the same row

    hi all - for each customer and product, I need to grab the row that has the min value for field Value1. I could've just done group by on customer and product and min on Value1, but I also need to grab Vlaue2 from the same row where the minimum value for
    Value1 lies.
    DECLARE @Temp TABLE (CustomerID INT, ProductID VARCHAR(10), Trans_Date Date, Value1 INT, Value2 INT)
    INSERT INTO @Temp VALUES (123, 'ABC', '1/1/2013', 10, 100)
    INSERT INTO @Temp VALUES (456, 'ASD', '1/1/2013', 40, 500)
    INSERT INTO @Temp VALUES (456, 'ASD', '2/1/2013', 90, 700)
    INSERT INTO @Temp VALUES (123, 'ABC', '2/1/2013', 20, 700)
    SELECT * FROM @Temp
    The output should be
    123, ABC, 10, 100
    456, ASD, 40, 500
    I know that I can just join the table to itself and get the desired output but I am dealing with a table that has millions of rows and I was hoping there is more efficient way to do this. any help would be highly appreciated...

    Here is a correction on your DDL to make it into nearly valid table.
    CREATE TABLE Sales
    (customer_id INTEGER NOT NULL,
    product_id CHAR(10) NOT NULL,
    transaction_date DATE NOT NULL,
    PRIMARY KEY (customer_id, product_id, transaction_date),
    value1 INTEGER NOT NULL,
    value2 INTEGER NOT NULL);
    Here is the current syntax for insertion:
    INSERT INTO Sales
    VALUES (123, 'abc', '2013-01-01', 10, 100),
    (456, 'asd', '2013-01-01', 40, 500),
    (456, 'asd', '2013-02-01', 90, 700),
    (123, 'abc', '2013-02-01', 20, 700);
    WITH
    X
    AS
    (SELECT customer_id, product_id, transaction_date, value1, value2,
    MIN(value1) OVER () AS value1_min
    FROM Sales)
    SELECT X.*
    FROM X
    WHERE X.value1_min = X.value1;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Data Sets - Is there a way to put two fields in the same row?

    I am working on my first Spry Data Set (in Dreamweaver CS4) which, if I can get it figured out, will eventually be used as a calendar on a client's web site. You can see the beginning of the project here:
    http://www.rieradesignco.com/calendarlist_spry.html
    My question is, can I put two or more fields on one row? Specifically, I would like the part that looks like this...
    3
    [WED]
    Fusion
    ... to look like this:
    3   [WED]   Fusion
    I tried simply moving the fields (in Design View) so that they looked like they would be in the same row, but as you can see, that didn't do the trick. (You can see what I did here, in the highlighted part of the screenshot:  http://www.rieradesignco.com/spryquestion.jpg). I also tried nesting a table within the table on my html data document that contained the three fields I needed - it worked okay, but that just makes the table more difficult to work with. I don't want to simply type the three items into one field, because it will be a long list and they all need to line up perfectly.
    Is there another way to do it?

    Change the following line to include the red coloured parts
    <div class="MasterColumn" spry:repeat="ds4" spry:setrow="ds4" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">
      <span>{Dsp_#}</span><span>{Dsp_WkDay}</span><span>{Dsp_Event}</span>
    </div>
    The add the following style rule to your document:
    .MasterColumn span {
        display: inline-block;
    I hope this helps.
    Ben

  • Updating the particular row and column in a JTable

    Hi,
    I have a JTable which is having fixed number of columns. When i am trying to update a particular cell in the table
    during programm execution i am not able to do it.
    I am getting the row number and column number correctly. But when i am going to set the data it is not setting at the same row. It is setting some other row according to the m_index (according to the sorting).
    i am doing :
    JTableModel model = (JTableModel) m_TablePan.getTableModel();
    model.setValueAt(savedData, row, column);

    See the convertXxxIndexToView and convertXxxIndexToModel methods.
    db
    Edited by: Darryl.Burke -- wrong methods suggested
    Edit2: Evidently lipumama doesn't follow up on many questions posted.
    One for the blacklist.

  • ADF 11g Partial Triggers Row Column Update By Column in the Same Row

    Hi.
    I have a situation whereby I have a checkbox in a table row, which has an eventchangelistener, which upon activation, trys to update another column in the same row. I can not get this to work through partial triggers, even though I have set up my ids up correctly. The row though can be updated by a command button outside of the table using the same coding techniques, but I need it updated via the checkbox.
    Is there a limitation in updating a column within a row, from another row column's event change listener.
    Thanks.

    Updating the other rows from the checkbox works fine for me. Here is what I did.
    I DnD Emp table with a new column that says if the emp is new hire. If the checkbox is checked, I set Firstname and Lastname for that row as NewHire. I have partial triggers on Firstname and Lastname columns to update whenever checkbox is checked/unchecked and autosubmit on checkbox to true. Hope this helps.
    Try adding column selection property to single and see if it helps.
    Edited by: asatyana on Jan 16, 2012 12:48 AM
    Edited by: asatyana on Jan 16, 2012 12:49 AM

  • Nsert/Update and Add Column at the same Table and at the "same" Time

    Hello,
    I want Insert/Update and Add Column at the same Table and at the "same" Time but in different sessions.
    Example:
    At first the "insert/update" statement:
    Insert into TestTable (Testid,Value) values (1,5105);
    After that the "add" statement:
    Alter table TestTable add TestColumn number;
    - sadly now I get the message: ORA-00054: resource busy and acquire with NOWAIT specified
    "insert/update" statement:
    Insert into TestTable (Testid,Value) values (2,1135);
    After that the execute commit.
    I don't know when the first session set the commit statement so I want that the DB the "Alter Table..." statement execute if it's possible.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.
    Thanks for ideas

    Well I want to walk in the rain without and umbrella and still stay dry, but it ain't gonna happen.
    You can't run a DDL statement against a table with transactions pending. Session 2 has to wait until session commits or rollbacks (or until the session is killed). That's just the way it is.
    This makes sense if you think about it. The data dictionary has to be consistent across all sessions. If session 2 was allowed to change the table structure whilst session 1 has a pending transaction then the database is in an inconsistent state. This is easier to see if you consider the reverse situation - the ALTER TABLE statement run by session 2 does a DROP COLUMN TESTID rather than adding a column: now what should happen to session 1's INSERT statement? You have retrospectively invalidated a statement that was perfectly legal when it was executed.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.Fnord.
    Cheers, APC

  • Multiple selection of rows and delete the same

    hi how can we select the multiple rows in a table and delete the same.
    if i have 3 rows i have to select 2 rows and if i press the delete button the selected rows should be deleted.
    Can any one help me .
    Thanks
    Badri

    hi
    in the layout of the screen u might have dragged and dropped the table control
    double click on it u will get attributes screen in that u select MULTIPLE under Line-Selection
    under attributes tab.
    the internal table in table control must be like
    data : begin of itab occurs 0,
             empno type .......,
             empname......,
             empcity.....,
             check(1), " for tab selection"
             end of itab.
    data : itab1 like itab occurs 0 with header line.
    in the attributes screen of the table control
    pass the value ITAB-CHECK to the field W/SELECTION
    in SE51
    PBO
    Module_status_0800
    loop with control table_control_name.
    module_fill_tcontrol.
    endloop.
    PAI
    Module_user_command_0800
    loop with control table_control_name.
    module_read_tcontrol.
    endloop.
    in se38
    Module_fill_tcontrol. 
    endmodule.
    Module_read_tcontrol.
    READ TABLE itab1 INDEX control-current_line.
      IF sy-subrc EQ 0.
        MODIFY itab1 FROM itab  INDEX control-current_line.
      ELSE.
        MOVE-CORRESPONDING itab TO itab1.
        APPEND itab1.
        CLEAR itab1.
      ENDIF.
    endmodule.
    module_user_command.
    case sy-ucomm.
    WHEN 'DELE'.
          DELETE itab1 WHERE check = 'X'.
    endcase.
    endmodule.
    Regards
    Murali.M

Maybe you are looking for

  • How to submit a form by pressing enter key

    Hi, I'm having a problem..............i have a form having text field and a button created using struts html tags..........when user enters the value and presses the button then the value is being taken........... but if the user enters the data and

  • Uneditable JTextArea

    I have created a simple JTextArea with a scrollPane printJTextArea = new JTextArea();         // setting up my text area for output       printJScrollPane = new JScrollPane(printJTextArea); // putting my text area in a scrollpane       printJScrollPa

  • SAPScript font printing

    Dear all, I have a same version of SAPScript layout in both Dev and Prod server. But the printing in Dev suddenly having alignment problem. Below is the printing example before and after in DEV; the spacing between each character become wider: Before

  • Expiration of an email account

    Hello is it possible to expire an email account at a definite date? we are running the following version of messaging server; Sun Java(tm) System Messaging Server 6.2-6.01 (built Apr 3 2006) libimta.so 6.2-6.01 (built 11:20:35, Apr 3 2006) SunOS mail

  • Lags between app and back button

    I just experienced this problem lately. When I pressed the app button to go into the app pages, it takes about 3 seconds for the 1st app page to appear. Following this, when I want to return to the home screen, I press the back button, and the icons