Updating a record using variables

I want to use a variable(s) to update my record. I get a Java excpetion when using this code:
<%@ page import="java.sql.*"%>
<%@ include file = "/html/common/init.jsp" %>
<% String ticketid = request.getParameter("ticketid"); %>
<% String comment = request.getParameter("comment"); %>
<% String userid = user.getUserId(); %>
<% String comment_body = "comment_body" %>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/helpdesk", "root", "password");
Statement updStmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet updRs = updStmt.executeQuery("SELECT * FROM HISTORY WHERE (ticketid) = ('"+ticketid+"')");
updRs.next();
updRs.updateString "('"+comment_body+"', '"+comment+"')";
updRs.updateRow();
con.close();
%>
Here is the exception;
An error occurred at line: 7 in the jsp file: /Projects/Help Desk/PostComments.jsp
Generated servlet error:
C:\Program Files\Liferay\server\default\work\jboss.web\localhost\_\org\apache\jsp\Projects\Help_0020Desk\PostComments_jsp.java:546: ';' expected
String comment_body = "comment_body"
^
An error occurred at line: 10 in the jsp file: /Projects/Help Desk/PostComments.jsp
Generated servlet error:
C:\Program Files\Liferay\server\default\work\jboss.web\localhost\_\org\apache\jsp\Projects\Help_0020Desk\PostComments_jsp.java:558: not a statement
updRs.updateString "('"+comment_body+"', '"+comment+"')";
^
An error occurred at line: 10 in the jsp file: /Projects/Help Desk/PostComments.jsp
Generated servlet error:
C:\Program Files\Liferay\server\default\work\jboss.web\localhost\_\org\apache\jsp\Projects\Help_0020Desk\PostComments_jsp.java:558: ';' expected
updRs.updateString "('"+comment_body+"', '"+comment+"')";
^
3 errors

Thanks for the insult.<rant>
Your problem was that you were missing a semi-colon at the end of line, which every Java statement requires. The error messages that you posted would tell most people who have more than casual experience with compiling Java that you have a trivial syntax problem.
The people who take the time to answer the questions in this forum are mostly experienced professionals who answer questions on a volunteer basis out of the goodness of their heart. It takes time, it takes work, and we get the gratification of helping people, learning about new problems, and learning the tricks that the other pros know that we don't. Therefore it is frustrating to see a problem that ought to be solvable by anyone who's gotten past their first program harder than "hello world".
However, I don't see anything insulting in our responses so far, or about saying that the impression I have from this and all your other posts is that you don't have the first idea about how to do what you're trying to do and you want this forum to design your application for you. While design questions are certainly appropriate in the forum, both the basic level and the number of your questions suggest that you really need to spend some time getting educated, by reading books, all the Java "how to" articles on the web, or examining the code of all the open source projects that happen to do similar things. Or you should go to school, hire a tutor, or a mentor within your development environment. You're acting like you expect the forum to do your work for you, and be polite and happy about it.
I appreciate that trying to learn all these areas of Java at once is very hard and can be frustrating; it's taken me about 5 years to get to "above average" in some areas and I still have an enourmous amount to learn about other areas, even though I started as a senior programmer who has been working in non-Java, non-web areas for 25 years. Learning new technologies takes an enormous amount of work; your posting of an issue that many college freshman solve in their first "hands-on" project suggests to me that you are utterly unwilling to do your own work or take the time to think about your problems before posting. I write that not to insult you - it's truly how I feel - but to help you understand why you might not be getting the answers you seek in this forum; for many of us, you're just asking too much and whining about "insults" doesn't help your cause.
Sorry if we hurt your feelings. After that rant, I'm going to attempt to restrict my responses to the technical issues at hand.
</rant>

Similar Messages

  • I need to update specific records(of variable lengths) in a file. I can get the correct record but when I update it(add info), it overwrites part of the record following it. I am using labview 6.0

    I need to update specific records(of variable lengths) in a file. I can get the correct record but when I update it(add or change info), it overwrites part of the record following it. I am using labview 6.0. I need to be able to insert information into the middle of a file without disturbing the data before and after

    It's hard to give more specifics without more detail, but in general you're going to need to read in the entire file, split it into three pieces (everything before the record of interest, the record itself, and everything after the record of interest), modify the record, reassemble the three pieces in proper order, and write the whole thing back to the file.Of course if the file is very large you might not want to actually implement it this way, but conceptually at least, this is what you are looking at.If this file some sort of proprietary format?Mike...PS: this type of issue is why I really like databases...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Updating a record using pay element using the API (Almost Done)

    Hi Everyone,
    I have a question about updating a record using the PAY_ELEMENT_ENTRY_API.update_element_entry
    I have process that doesn't error out, but its doesn't seem to update the record. So my question is, is the query below the correct way to get the element name and object version number when using this API? If not, what do I need to do?
    BEGIN
    SELECT MAX(pee.element_entry_id)
    INTO x_element_id_mgr
    FROM pay_element_types_f pet,
    pay_element_links_f pel,
    pay_element_entries_f pee,
    per_all_assignments_f paaf,
    per_all_people_f papf
    WHERE pee.element_link_id = pel.element_link_id
    AND pel.element_type_id = pet.element_type_id
    AND paaf.assignment_id = pee.assignment_id
    AND papf.person_id = paaf.person_id
    AND pet.element_name = 'Mgr Rec Pct'
    AND sysdate BETWEEN pee.effective_start_date AND pee.effective_end_date
    AND sysdate BETWEEN pel.effective_start_date AND pel.effective_end_date
    AND sysdate BETWEEN pet.effective_start_date AND pet.effective_end_date
    AND sysdate BETWEEN paaf.effective_start_date AND paaf.effective_end_date
    AND sysdate BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND paaf.assignment_id = c_staging.assignment_id
    AND papf.person_id = c_staging.person_id;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    --ROLLBACK TO s1;
    v_error_message := 'For employee number '||c_staging.employee_number||' No data found for element name Mgr Rec Pct' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    WHEN OTHERS THEN
    --ROLLBACK TO s1;
    v_error_message := 'For employee number '||c_staging.employee_number||' Error found for element name Mgr Rec Pct' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    END;
    --- Get OVN
    BEGIN
    SELECT MAX(Object_version_number)
    INTO x_ele_object_version_number
    FROM pay_element_entries_f
    WHERE element_entry_id = x_element_id_mgr;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_error_message := 'For employee number '||c_staging.employee_number||' Error in getting the OVN for Mgr Rec Pct ' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    WHEN OTHERS THEN
    v_error_message := 'For employee number '||c_staging.employee_number||' Error in getting the OVN for Mgr Rec Pct' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    END;

    Your SQL isn't bad, although you're including loads of tables you don't need to so it's probably not as fast as it could be. I'm not sure you know what element entry to update so let's look at an example:
    -- | Element Entry Id | OVN | Start Date | End Date    | Pay Value |
    -- +------------------+-----+------------+-------------+-----------+
    -- | 123                2    1-Jan-2009   31-Jan-2011   USD 400
    -- | 123                1    1-Feb-2009   18-Jun-2011   USD 500
    -- | 123                1    19-Jun-2011  25-Jun-2011   USD 600
    -- | 123                5    26-Jun-2011  31-Dec-4712   USD 700Here the one element entry (Id 123) has 4 effective rows. The employee gets $400 in Jan 2009, $500 from Feb 2009 to mid-June 2011, $600 for a few days later in June 2011 and then $700 from 26th June 2011 onwards.
    So your question to the forum is which one do I update. Well, that depends which one you want to update. If you want to update the 1st Jan 2009 to 31st Jan 2011 you'd pass element_entry_id => 123, ovn => 2, effective_date => to_date('1-Jan-2009', 'DD-MON-YYYY') and datetrack_mode => 'CORRECTION'.
    If you wanted to update the $700 row you'd pass OVN 5 and an effective date of 26th June 2011. And so-on.
    Now in your SQL you're filtering based on sysdate, which means you'd be updating the $500 row (ovn=1). Is that what you want?
    I have simplified your SQL as follows:
    SELECT pee.element_entry_id
          ,pee.object_version_number
    INTO   x_element_id_mgr
          ,x_ele_object_version_number
    FROM   pay_element_entries_f pee
          ,pay_element_types_f pet
    WHERE  pee.assignment_id = c_staging.assignment_id
    AND    pee.element_type_id = pet.element_type_id
    AND    pet.element_name = 'Mgr Rec Pct'
    AND    trunc(sysdate) BETWEEN
           pee.effective_start_date AND pee.effective_end_date
    AND    trunc(sysdate) BETWEEN
           pet.effective_start_date AND pet.effective_end_date;This selects both the entry Id and OVN in one go; there's no need to have 2 SQL statements. If multiple entries are allowed, this SQL could return more than one row so just watch out for that. If you don't want the row as of sysdate change the two sysdate joins accordingly.
    I hope that helps.

  • Need to update multiple records using store procedure

    Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
    for example my source is
    emp_name sal
    abhi 2000
    arti 1500
    priya 1700
    i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
    i have tried following code
    create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select sal into p_sal from emp;
    if sal<2000 then
    update emp set sal= sal+200;
    end i;f
    end;
    and i have called the procedure using following codes
    set serveroutput on
    declare
    p_sal emp.sal%type;
    v_cursor sys_refcursor;
    begin
    upt_sal(p_sal,v_cursor);
    fetch v_cursor into p_sal;
    dbms_output.put_line(p_sal);
    end;
    the program is executing but i should get o/p like this after updating
    1700
    1900
    but i am getting first row only
    2000
    and record is not upsating...please help me with this
    thanks

    Hi Alberto,
    thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
    and i have similar kind of requirement where i need to deal with procedure which returns more than one row
    my source is
    empno ename salary
    111,abhi,300
    112,arti,200
    111,naveen,600
    here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
    here i have written store procedure like this
    create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select ename,salary into p_ename,p_salary from emp where empno=p_empno;
    end;
    and i have called this by using
    declare
    p_salary emp.salary%type;
    p_ename emp.ename%type
    v_cursor sys_refcursor;
    begin
    show_emp_det(111,p_ename,p_salary,v_cursor);
    fetch v_cursor into p_ename,p_salary;
    dbms_output.put_line(p_ename);
    dbms_output.put_line(p_salary);
    end;
    here i should get
    abhi,300
    naveen,600
    but i am getting first row only
    abhi,300
    but i want to fetch both rows...pls help me to find the solution

  • Why can't I select or update the Record using the PreparedStatement?

    the DB is oracle9i,here is the test table
    test
    id number;
    name char(10);
    intro char(10);
    I have insert a record in the table.
    Now I will select or update the record by using the PreparedStatement here is my code:
    sqlStr = "update test set intro = ? where name =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setString(2,"irixwang");
    int is = stmt.executeUpdate();
    if (is >=1 )
    System.out.println("ok");
    It will not work ,but where I change the update condiction as followed:
    sqlStr = "update test set intro = ? where id =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setInt(2,100);
    int is = stmt.executeUpdate();
    It works well,why?
    please help me!thk!!!!

    I doubt it works "well" in either case since you are inserting a string that is longer than 10 characters into a field that only holds 10 characters. But to your question....
    A char data type holds a fixed number of characters - in your case 10.
    Because it holds 10 characters it will never hold 9, regardless of what you think is in the field it will always have 10 characters in it. The value you are using for query for name is 9 characters. Since 9 characters, regardless of content, will never be equal to 10 characters there is no way that it will update.
    So your choice is to either use a varchar, which holds a variable number of characters, or to always use 10 characters for your query (pad it with spaces.)

  • Updating current record using SET_CUSTOM_PROPERTY in a multi-record form

    Hi,
    I have a multi record form and am using the SET_CUSTOM_PROPERTY method in the when validate trigger of an item. The problem is that it updates all records in the form instead of updating just the current record.
    Any inputs to resolve this would be helpful.
    Thanks

    I cannot reproduce the issue here.
    I have modified the sample dialog shipped with th article to have a block that displays 2 records
    <p>See the screenshot here</p>
    Here is the code in the When-Button-Pressed trigger:
      Set_Custom_Property( 'BLZ.BEAN', 1, 'READIMGFILE', 'd:/coyote.jpg' ) ;
      Set_Custom_Property( 'BLZ.BEAN', 2, 'READIMGFILE', 'd:/oracle_community.gif' ) ;So everything is ok for me.
    Francois

  • Unable to update a record using PAI, in Module pool

    Hi Experts,
                        I m unable to update the records in to the table using P A I in module pool, could any one help me out dear.
    The prg is as follows:
    INCLUDE MZFIRSTPAGETOP                          .    " global Data
    TABLES: ZCHP_CUST_INFO.
    DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
            REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
            DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
            PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
            EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
            COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
            COMM like ZCHP_CUST_INFO-ADDRESS.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'FOR1000'.
      SET TITLEBAR '1000'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
    INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
    INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    CASE SY-UCOMM.
      WHEN 'SUBMIT'.
    Updating the record.
            ZCHP_CUST_INFO-REQ_NUM = C_KNUMV.
            ZCHP_CUST_INFO-CREATED_BY = CNAME.
            ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
            ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
            ZCHP_CUST_INFO-SHORT_TEXT = DESC.
            ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
            ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
            ZCHP_CUST_INFO-ADDRESS = COMM.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    WHEN 'RESET'.
           CLEAR: CNAME,REQTYP,PRIO_TYPE,
    DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
      WHEN 'CANCEL'.
            LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT
    Thanks in advance,
    Sunil

    Hi Kal chand,
                      This is the whole prg where the records are not updated. But the ref number is updated.
    INCLUDE MZFIRSTPAGETOP                          .    " global Data
    TABLES: ZCHP_CUST_INFO.
    DATA: OKCODE LIKE SY-UCOMM.
    CONSTANTS: LC_NUMBER_RANGE TYPE INRI-NRRANGENR VALUE '01',
               LC_COND_OBJECT TYPE INRI-OBJECT VALUE 'KONV'.
    DATA: L_IS_REPL_DELIV TYPE XFLAG,
          C_KNUMV TYPE I.
    DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
            REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
            DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
            PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
            EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
            COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
            COMM like ZCHP_CUST_INFO-ADDRESS.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'FOR1000'.
      SET TITLEBAR '1000'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
    INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
    INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    CASE SY-UCOMM.
      WHEN 'SUBMIT'.
    *FOR INCREMENTING THE VALUE.
    C_KNUMV = C_KNUMV + 1.
    USED FM TO GENERATE NUMBERS.
    CALL FUNCTION 'NUMBER_GET_NEXT'
         EXPORTING
           nr_range_nr = lc_number_range
           object      = lc_cond_object
         IMPORTING
           number      = c_knumv.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Updating the record.
            ZCHP_CUST_INFO-REQ_NUM = C_KNUMV.
            ZCHP_CUST_INFO-CREATED_BY = CNAME.
            ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
            ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
            ZCHP_CUST_INFO-SHORT_TEXT = DESC.
            ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
            ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
            ZCHP_CUST_INFO-ADDRESS = COMM.
    *ENDIF.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    WHEN 'RESET'.
           CLEAR: CNAME,REQTYP,PRIO_TYPE,
    DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
      WHEN 'CANCEL'.
            LEAVE PROGRAM.
    ENDCASE.
    regards,
    Sunil

  • Update Multiple records using NW CE WebDyn Pro 7.2 interface ITEMDETAILS

    We are trying to use SAP Netweaver CE 7.2 and NetWeaver Design Studio 7.2 with the Web Dynpro application interfaces configured to connect to our MDM 7.1 SP06 repositories to develop web screens that allow our end users the ability to maintain MDM repository data without the use of DataManager.
         Our first application was to be a simple one to show the business the benefit of SAP Netweaver. Itu2019s very easy to use the interfaces for SEARCH, RESULTSET, ITEMDETAILS, MATCH and MERGE if you plan to maintain one record at a time. We would like to update many records at the same time.
    Using the configuration described previously, I find that I am able to select multiple records at one time using the RESULTSET interface and the Context folder of u201CSelectedRecordsu201D but I am not able to pass multiple records at one time to the context u201CIODatau201D used by the ITEMDETAILS interface and allow my end users to see and update multiple records at one time.
    If I can pass multiple records from RESULTSET to ITEMDETAILS for display and update would you please provide me with an example of how I would do this in NetWeaver Design Studio for NW CE 7.2..
    If I can NOT pass multiple records from RESULTSET to ITEMDETAILS for display and update, Would I then have to write my own wrapper application to read multiple records selected using the RESULTSET interface and the develop my own UPDATE view to display and update more than one record at a time. This would be time consuming since I would also have to write my own back out procedures and validation of update procedures that already happen within ITEMDETAILS.  Do you happen to have any CE application examples that show how this is done for a NW CE MDM repository that I can see? The current documentation u201CHow to Build Web Applications Using MDM Web Dynpro Components. pdfu201D falls short in the area of updating multiple records.
    Thank you in Advance

    Bugs aside, if it's VERY noisy, that might just be the out-of-sync problem (something I'm very familiar with now).
    Search the forum for "aggregate sync" and you should get some clues, if this is indeed the problem.
    Short of it is, you need to sync the two devices together. Easiest way seems to be to connect the two devices via S/PDIF and set Clock Source to S/PDIF for the "slave" device (set in Audio Midi).
    You can also just set the Clock Source as the "master" device in the drop down, bypassing the need for the S/PDIF cable altogether, but I haven't tried this myself.
    Macbook Pro CD / iMac C2D   Mac OS X (10.4.8)  

  • Update Multiple Records Using ASPVBscript

    I am trying to display multiple records on a page with a
    checkbox for each record, the checked value = Y. Then select
    multiple checkboxes and update each record at one time. I am using
    MS SQL as my DB. Is there an extention or command that I can use to
    accomplish this. Can anyone help.
    Thanks

    You need to give distinct values to your checkboxes and value
    fields. This
    can be done inside the DW Repeat Region loop code as it
    generates the rows.
    You then set another loop for the update. It is quite
    straightforward
    really.
    Have a look at Julian's site, here:
    http://www.charon.co.uk/content.aspx?CategoryID=27&ArticleID=41
    Also, there are a couple of links at the bottom of the above
    page. They use
    slightly different approaches and are usefull too.
    "StarM3d" <[email protected]> wrote in
    message
    news:f470in$p4v$[email protected]..
    >I am trying to display multiple records on a page with a
    checkbox for each
    > record, the checked value = Y. Then select multiple
    checkboxes and
    > update
    > each record at one time. I am using MS SQL as my DB. Is
    there an
    > extention or
    > command that I can use to accomplish this. Can anyone
    help.
    >
    > Thanks
    >
    >

  • Update multiple records using checkbox

    Hi All,
    I have one requirement related to multiple record update using checkbox.
    HTML form has 6 columns and many rows.
    Now i want to update all 6 columns in the table for selected checkbox.
    Can any body give me some idea/code about this.
    Thanks in advance.
    Ravi

    I did not understand your idea.
    multiple columns can be updated as follows...
    update table set col1=value,col2=value,col3=value where conditions;
    We are using adodb driver in our environment. So I will explain concern to it. Store all the form new values in $var array and you can pass this $var to query execution.
    A vague idea
    $rs = $conn->Execute($update_sql,$var);     
    if ($rs===false) die('DB Error: '. $conn->ErrorMsg() );

  • How to insert new record or update existing record using a complex view?

    Currently I created this screen, there is no problems on display data, only on the update funtionality (it means insert / update / delete on the table for which the view is based on).
    I have a table and a complex view in order to display the information from the table in a tabellar form (i.e up to 70 record in same "record" in the form, one for each item)
    The view is like this
    select a.f1, a.f2, get_value(a.pk1,1) a1, get_value(a.pk1,2) a2, get_value(a.pk1,3) a3............
    from my_table a
    where a.proj_id = user
    and I want to permit the update of the field a1, a2, a3 in a multiposition canvas (tabellar).
    I created an INSTEAD-OF trigger.
    But it not work only in the form. I receive the error FRM-40654 when I try to change the existing value in the running form based on that view.
    The view is woking and updatable using sql-plus.
    If I query
    select * from ALL_UPDATABLE_COLUMNS where table_name = 'SPV_BOQ_BOM_POS_ACTIVITIES';
    in which 'SPV_BOQ_BOM_POS_ACTIVITIES' is the name of my view.
    The question is: why if the view is updatable using SQL*Plus, is not updatable using Oracle Form 10gR2 ?
    Someone could help me asap?
    Thanks

    I removed on the datablock three items that are not showed, one of this is the Sysdate of update on the table for which the view is based.
    I removed also the on-lock trigger and the update from the form is NOT working fine.
    But for now I can still mantaing the ON-LOCK trigger.
    Is not a priority to remove this trigger.
    I still have the problem when the field is null, it mean that in the table SP_BOQ_BOM_POS_ACTIVITIES the record not exist.
    I try now to explayn better.
    SPV_BOQ_BOM_POS_ACTIVITIES is the name of the view.
    SP_BOQ_BOM_POS_ACTIVITIES is the name of the table.
    This are the desc
    desc SPV_BOQ_BOM_POS_ACTIVITIES
    Describing SPV_BOQ_BOM_POS_ACTIVITIES....
    NAME Null? Type
    BOQ_HEADER_ID NOT NULL NUMBER(12,0)
    BB_ID NOT NULL NUMBER(12,0)
    BOQ_ID NOT NULL NUMBER(12,0)
    PROJ_ID NOT NULL VARCHAR2(10)
    ACT_GROUP_CODE VARCHAR2(30)
    TOTAL_QTY NUMBER
    ACT_CODE_1 VARCHAR2(4000)
    QTY_1 NUMBER
    ACT_CODE_2 VARCHAR2(4000)
    QTY_2 NUMBER
    ACT_CODE_3 VARCHAR2(4000)
    QTY_3 NUMBER
    ACT_CODE_4 VARCHAR2(4000)
    QTY_4 NUMBER
    ACT_CODE_5 VARCHAR2(4000)
    QTY_5 NUMBER
    ACT_CODE_6 VARCHAR2(4000)
    QTY_6 NUMBER
    USR_ID NOT NULL VARCHAR2(10)
    LMOD NOT NULL DATE
    INT_REV NOT NULL NUMBER(6,0)
    The field QTY_1, QTY_2.... QTY_6 are calculated with a customer stored function from the table SP_BOQ_BOM_POS_ACTIVITIES.
    Also the field ACT_CODE_1, ACT_CODE_2, .... ACT_CODE_6 are calculated with a customer stored function from the table SP_BOQ_BOM_POS_ACTIVITIES.
    desc SP_BOQ_BOM_POS_ACTIVITIES
    Describing SP_BOQ_BOM_POS_ACTIVITIES....
    NAME Null? Type
    BBPA_ID NOT NULL NUMBER(12,0)
    BOQ_HEADER_ID NOT NULL NUMBER(12,0)
    BB_ID NOT NULL NUMBER(12,0)
    BOQ_ID NOT NULL NUMBER(12,0)
    PROJ_ID NOT NULL VARCHAR2(10)
    ACT_GROUP_CODE NOT NULL VARCHAR2(30)
    ACT_CODE NOT NULL VARCHAR2(30)
    QTY NUMBER(12,0)
    FLG_MANUAL_CHANGE VARCHAR2(1)
    USR_ID NOT NULL VARCHAR2(10)
    LMOD NOT NULL DATE
    INT_REV NOT NULL NUMBER(6,0)
    If I use SQL Navigator this insert working fine
    insert into SPV_BOQ_BOM_POS_ACTIVITIES
    (BOQ_HEADER_ID, BB_ID, BOQ_ID, PROJ_ID, ACT_GROUP_CODE, ACT_CODE_1, QTY_1)
    values (5050, 5015, 30486, 'B39368', 'TEST', '0101010101010101', 1709)
    1 row(s) inserted
    Instead using the Screen, at runtime, I receive the message:
    FRM-40400 Transation Complete: 1 records applied and saved
    but nothing is saved in the table SP_BOQ_BOM_POS_ACTIVITIES, and the view SPV_BOQ_BOM_POS_ACTIVITIES contain the calculated QTY_1 for the 'key', with null value.
    Moreover If in the field QTY_1 (NUMBER) I put a character, instead a Number, just to see if the Screen attempts or not an UPDATE or AN INSERT, the message is FRM-40509: Oracle Error. UNABLE TO UPDATE RECORD. Why happen an Update and not an INSERT using the Screen?
    In effect, the trial using SQL navigator of the following statement
    insert into SPV_BOQ_BOM_POS_ACTIVITIES
    (BOQ_HEADER_ID, BB_ID, BOQ_ID, PROJ_ID, ACT_GROUP_CODE, ACT_CODE_1, QTY_1)
    values (5050, 5015, 30486, 'B39368', 'TEST', '0101010101010101', 'r');
    I got Invalid Number and it's ok as answer from the database.
    Edited by: fmariani on 30-apr-2009 1.51

  • How to update multiple records using for loop

    Hi I want to update a particular column of few rows in database i had written followin code after that few lines of code and calling action from the task which having commit return ,still it's not updating particular colum.I had debug the code loop is running fine but still changes are not reflecting to database.Let me know if there is any prob with following code snippet.
    RealEstatePropertyUnitDetailsVOImpl realEstatePropertyUnitDetailsVO = RealEstatePropertyUnitDetailsVOImpl)realEstateService.getRealEstatePropertyUnitDetailsVO();
    for(Row row : realEstatePropertyUnitDetailsVO.getAllRowsInRange())
    if("N".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn"))
    || "false".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn")))
    row.setAttribute("RlstdAvlblYn", "Y" );
    System.out.println("RlsthId "+row.getAttribute("RlstdRlsthId"));
    System.out.println("AvlbYN "+row.getAttribute("RlstdAvlblYn"));
    System.out.println("RlstdUnitId "+row.getAttribute("RlstdUnitId"));
    }

    Vishwesh,
    I'd start with something along the lines of ...
        RowSet vo = (RowSet)getRealEstatePropertyUnitDetailsVO();
        vo.reset();
        while (vo.hasNext())
          Row row = vo.next();
          row.setAttribute("Attribute", value);
        }getAllRowsInRange() may exclude some rows outside the "range". Also, the vo.reset is needed since your View Object currency may not be at the beginning of your RowSet.
    Hope that helps.
    Will

  • How to Update a Row using ADF

    Hi every one
    Can any one help me out, How to Update a Row using ADF.
    Thanks in advance

    In addition to Clear to my question
    By Using ADF BC How can I update a record in a database.
    I have VO and EO associated with a table.
    How can I update a record using ADF BC
    Message was edited by:
    user616296

  • Programmatic updating multiple records of a table in ADF

    Hi,
    I am using Jdeveloper : 10g 10.1.3.3
    Problem : I need to update multiple records in DB using ADF feature.
    The senario is like user is shown records of item consisting of item name, item code, category code, price etc. then user clicks "change category code" link availabe against each record. In next page user is shown current code and provided a text box to enter new code. Once i get this in my bean i need to update all records as:
    update item_info set category_code = :new_code where category_code = :current_code. Means to udate category code in all the records where category_code is :current_code.
    I have Entity and View Object for this table.
    How do i update multiple records using created view which is entity based?
    Have A Nice Time!
    Regards,
    Kevin

    In ADF you don't use update statement directly. This is done by the framework.
    You have to search for the records which match your condition category_code = :current_code using your VO based on the entity.
    Then iterate over the result set and change each row to your need setCategoryCode(newCode);
    When you commit the changes they are persist them in the DB.
    To see the changes in the UI you have to update the display using PPR or execute the query again.
    Timo

  • Updating multipule records

    Hi I need to update multipul records using a Dreamweaver
    update from can anyone point me in the right direction please. I
    don't have any problems updating single items but multipuls seem to
    be a problem. I'm not exactly a wiz on asp so please take this into
    consideration when replying
    Cheers
    Chris

    Check out this link, ther eis a tutorial there that might
    explain it all to you ::
    http://www.toofoo.co.uk/tootorials/
    Good luck.

Maybe you are looking for