Problem in doing an update statement

Hello all
i should write an update statement,
these tables : country: name,code,population,nextyearr_population ...
nextyear_population is empty,at first i should get population_growth from population table then calculate the next year population according to corrent population and population_growth
population: country(actually is code not name of country) ,population_growth,....
i wrote so and i got this error
Error starting at line 1 in command:
update country c
set c.nextyear_population=(c.population+ ((c.population*(select pop.population_growth from population pop join country co on co.code=pop.code))/100)
where country.code=population.country
Error at Command Line:4 Column:20
Error report:
SQL Error: ORA-00904: "POPULATION"."COUNTRY": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:   
*Action:
--  File created - Wednesday-May-15-2013  
--  DDL for Table COUNTRY
  CREATE TABLE "intern"."COUNTRY" ("NAME" VARCHAR2(40), "CODE" CHAR(2), "CAPITAL" VARCHAR2(40), "PROVINCE" VARCHAR2(40), "POPULATION" NUMBER, "AREA" NUMBER, "NEXTYEAR_POPULATION" NUMBER)
   COMMENT ON COLUMN "intern"."COUNTRY"."NAME" IS 'the country name'
   COMMENT ON COLUMN "intern"."COUNTRY"."CODE" IS 'the internet country code (two letters)'
   COMMENT ON COLUMN "intern"."COUNTRY"."CAPITAL" IS 'the name of the capital'
   COMMENT ON COLUMN "intern"."COUNTRY"."PROVINCE" IS 'the province where the capital belongs to'
   COMMENT ON COLUMN "intern"."COUNTRY"."POPULATION" IS 'the population number'
   COMMENT ON COLUMN "intern"."COUNTRY"."AREA" IS 'the total area'
   COMMENT ON TABLE "intern"."COUNTRY"  IS 'the countries of the world with some data'
REM INSERTING into intern.COUNTRY
SET DEFINE OFF;
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Andorra','ad','Andorra la Vella','Andorra la Vella',69865,468,null);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('United Arab Emirates','ae','Abu Dhabi','Abu Dhabi',2523915,82880,null);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Afghanistan','af','Kabul','Kabul',28513677,647500,null);
--  File created - Wednesday-May-15-2013  
--  DDL for Table POPULATION
  CREATE TABLE "intern"."POPULATION" ("COUNTRY" CHAR(2), "POPULATION_GROWTH" NUMBER, "INFANT_MORTALITY" NUMBER)
   COMMENT ON COLUMN "intern"."POPULATION"."COUNTRY" IS 'the country code'
   COMMENT ON COLUMN "intern"."POPULATION"."POPULATION_GROWTH" IS 'population growth rate (percentage, per annum)'
   COMMENT ON COLUMN "intern"."POPULATION"."INFANT_MORTALITY" IS 'infant mortality (per thousand)'
   COMMENT ON TABLE "intern"."POPULATION"  IS 'information about the population of the countries'
REM INSERTING into intern.POPULATION
SET DEFINE OFF;
Insert into intern.POPULATION (COUNTRY,POPULATION_GROWTH,INFANT_MORTALITY) values ('ad',0.95,4.05);
Insert into intern.POPULATION (COUNTRY,POPULATION_GROWTH,INFANT_MORTALITY) values ('ae',1.54,14.51);
Insert into intern.POPULATION (COUNTRY,POPULATION_GROWTH,INFANT_MORTALITY) values ('af',4.77,163.07);thank you in advance
im using oracle11g and ubuntu 12
best,david

Hi, David,
Thanks for posting the CREATE TABLE and INSERT statements.
Don't forget to post the results you want from thatsample data (that is, the contents of country after everything is finished).
1003209 wrote:
... i wrote so and i got this error
Error starting at line 1 in command:
update country c
set c.nextyear_population=(c.population+ ((c.population*(select pop.population_growth from population pop join country co on co.code=pop.code))/100)
where country.code=population.country
Error at Command Line:4 Column:20
Error report:
SQL Error: ORA-00904: "POPULATION"."COUNTRY": invalid identifier
00904. 00000 -  "%s: invalid identifier"
In the UPDATE statement itself (outside of sub-queries) you can only reference the table being UPDATEd, but in the WHERE clause:
where country.code=population.countryyou're trying to reference another table, population. That's what caused the error.
You either need another sub-query, or MERGE, which will probably be simpler and more efficient than UPDATE.

Similar Messages

  • Weird problem when executing an update statement

    Please help me out with this issue. This a very weird problem i'm facing while executing the following update statement.
    update tblo.S_TABLE c
    SET (ACCNT_NAME, ACCNT_LOC)
    =
    (select NAME, LOC from S_TABLE1 p
    where p.ROW_ID = c.ACCNT_ID)
    where ROW_ID = 'XXXXX'
    The statement executes perfectly fine in "SQL Plus" but when i try from my application or any SQL Tool that uses ODBC, it fails with the following error
    <eb1>ORA-00923: FROM keyword not found where expected
    State:S1000,Native:923,Origin:[Oracle][ODBC][Ora]</eb1>
    ODBC Driver Used: 9.2.0.2.0

    Yes this could most probably be resolved by upgrading the driver. I'hv tried MS Oracle ODBC driver but that is even more problematic!
    The applications works fine in another environment which uses a Merant ODBC driver. Thanks for your time and advice.

  • What lock does the Update Statement use?

    Hi All,
    Does the below statement will put a row level lock or exclusive lock.
    update employee set emp_name='Emp1' where emp_id=1;
    Regards
    W

    UKJA@ukja102> drop table t1 purge;
    Table dropped.
    Elapsed: 00:00:00.93
    UKJA@ukja102> create table t1(c1 int);
    Table created.
    Elapsed: 00:00:00.09
    UKJA@ukja102>
    UKJA@ukja102> insert into t1 values(1);
    1 row created.
    Elapsed: 00:00:00.00
    UKJA@ukja102> commit;
    Commit complete.
    Elapsed: 00:00:00.03
    UKJA@ukja102>
    UKJA@ukja102> update t1 set c1 = 2;
    1 row updated.
    Elapsed: 00:00:00.00
    UKJA@ukja102>
    UKJA@ukja102> set serveroutput on
    UKJA@ukja102>
    UKJA@ukja102> col sid new_value my_sid
    UKJA@ukja102>
    UKJA@ukja102> select sid
      2  from v$mystat where rownum = 1
      3  ;
           SID                                                                                                                                                                                             
           139                                                                                                                                                                                             
    Elapsed: 00:00:00.03
    UKJA@ukja102>
    UKJA@ukja102> exec print_table('select * from v$lock where sid = &my_sid');
    ADDR                          : 695C4224                                                                                                                                                               
    KADDR                         : 695C423C                                                                                                                                                               
    SID                           : 139                                                                                                                                                                    
    TYPE                          : TM                                                                                                                                                                     
    ID1                           : 74212                                                                                                                                                                  
    ID2                           : 0                                                                                                                                                                      
    LMODE                         : 3                                                                                                                                                                      
    REQUEST                       : 0                                                                                                                                                                      
    CTIME                         : 0                                                                                                                                                                      
    BLOCK                         : 0                                                                                                                                                                      
    ADDR                          : 69612444                                                                                                                                                               
    KADDR                         : 69612560                                                                                                                                                               
    SID                           : 139                                                                                                                                                                    
    TYPE                          : TX                                                                                                                                                                     
    ID1                           : 458787                                                                                                                                                                 
    ID2                           : 13053                                                                                                                                                                  
    LMODE                         : 6                                                                                                                                                                      
    REQUEST                       : 0                                                                                                                                                                      
    CTIME                         : 0                                                                                                                                                                      
    BLOCK                         : 0                                                                                                                                                                      
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.14DML acquires TX lock in exclusive(6) mode(row level lock) and TM lock in row exclusive(3) mode.
    =======================================
    Oracle Performance Storyteller
    Dion Cho
    http://ukja.tistory.com
    http://wiki.ex-em.com/index.php/performance_in_depth
    http://wiki.ex-em.com/index.php/optimizing_oracle_optimizer
    =======================================

  • Problem with a sqlite update statement using variables

    Flash Builder/Flex 4
    I'm trying to create a routine that will allow me to change the name of an author in a sqlite table.
    I have this update statement which works with hardcoded data:
    //trace("updateName function newAuthorName: " + newAuthorName (returns Dusty));
    //trace("updateName function oldAuthorName: " + oldAuthorName (returns Kristin));
    updateStmt = new SQLStatement();
    updateStmt.sqlConnection = conn;
    var sql:String = "UPDATE tableName SET authorNameColumn = 'Dusty' WHERE authorNameColumn = 'Kristin' ";
    updateStmt.text = sql;
    updateStmt.execute();
    If I change the statement to
    "UPDATE tableName SET authorNameColumn  =" +  newAuthorName +  "WHERE authorNameColumn =" + oldAuthorName;
    I get SELECT error: SQLError: 'Error #3115: SQL Error.', details:'near 'authorNameColumn': syntax error'
    I've tried changing many things about this statement trying to isolate the problem, but it seems to not like the variables.

    Lee;
    Thanks for your help.
    I'm relatively new to this Flex stuff.
    I've been trying to fix this problem for hours and you know how it is when you keep looking at the same thing for too long.
    The article you linked to helped. I finally just copied the text from it and changed the variable name to my own.
    FINALLY!! I can go do something else now.
    Grins
    Kristin

  • Trying to run an install to update to Firefox 3.6.16 but Software Update is not making any apparent progress past "Connecting to the update server". Just keeps running... Is this a problem or does the update just take a really long time?

    My computer's current version of Firefox is 3.6.13; clicked on Software Update and received an "strong suggestion" to download the newest version 3.6.16. Clicked to update and now "Downloading Update" has been showing "Connecting to the update server..." for 10+ minutes.

    * Download a new copy of the Firefox program.
    * Firefox 3.6: http://www.mozilla.com/en-US/firefox/all-older.html
    * Firefox 4.0: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install.
    * Install the new version that you have downloaded.
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

  • TS1702 After doing an update on tribez everything has disappeared ...... Anyone else have the same problem??

    HAs anyone else had the same problem, after doing an update nothing will come up for tribez just a blank screen. My late nights are not the same now!!!

    Your Performance preferences screen capture reveals you have a single hard drive with little available space to accommodate both the Photoshop scratch file and the swap files of the OS.
    It's obvious that Bridge finds itself at times with insufficient space to build its cache.
    However, it's unclear why that should affect only DNG files and not other type of image files.  Puzzling, unless the DNG files are the only large image files you have.
    Parts of the following may illustrate what happens when the scratch file is on your boot drive:
    The rule of thumb I follow to figure out scratch space says to figure on 50 to 100 times the size of your largest file ever multiplied by the number of files you have open.  I have seen the scratch file exceed 800 GB once, an admittedly rare occurrence, but it often exceeds 200 GB when stitching large panoramas and the like.
    As an example—and stressing that I'm aware that others have even more scratch space than I do—I keep two dedicated, physically separate hard drives as my primary and secondary Photoshop scratch disks and a lot of GB free on my boot drive for the OS.  I also have 16 GB of RAM installed.
    Additionally, if you only have a single HD, i.e. your boot drive, you'd need it to be large enough to accommodate both the swap files of the OS as well as Photoshop's scratch.

  • UPDATE statement and database locks

    Hello everybody,
    I have a problem related to an UPDATE statement. There are two applications, let say A and B.
    Application A executes:
    update some_table
    set some_field = 'value_A',
    where pk_field=1
    no commit!
    Application B executes:
    update some_table
    set some_field = 'value_B',
    where pk_field=1
    Now application B is locked and wait until application A executes a commit.
    THIS IS A PROBLEM!
    I know one way to solve this problem:
    Both applications should execute "select for update nowait" before
    updating a row.
    Is there any other solutions? Something like "update nowait"?
    thanks in advance
    Dmitri Geller
    DGeller (at) lhsgroup dot com

    The major difference between my approach and standard "select for update nowait + update"
    approach, is more information for user : who blocked his object, and when. Else , i don't see the
    differences. Yep. And a Boieng 747 and bicycle is not much a difference as both are used for transporting people.
    Are you against select + nowait ?No, I am for understanding transaction isolation, serialisation, ACID principles, the differences between optimistic and pessimitic locking and so on
    You wrote "THE LOCK is good". OK, and what about time ?The two has NOTHING to do with one another. Not a single thing.
    In real industrial systems the users cannot wait more then few seconds. But the transactions can
    run much more. It isn't acceptable.If by implication you mean that I'm in the .edu environment that does not deal with "real corporate systems", I'm not.
    I recently wrote a special replicator in PL/SQL. It makes extensive use of customised parallel processing (does not use PQ as it also support Oracle SE). It hits very busy tables (with far over a 1000 rows/sec transaction rate). I did not have to hack my own form of locking. Performance is excellent.
    Why? Not because I am a brilliant Linus-like programming genius. Simply because I used Oracle as it has been designed to use.
    Can you claim the same? Can you show me the Oracle reference material that states that you need to write your own Lock Manager? Can you show me expert opinion from recognised inviduals such as Tom Kyte, Jonathan Lewis, Gary Milsap and others that state that Oracle's concurrency controls need to be hacked like you did in order to make it work?
    Can you provide me with any sound technical evidence to backup your claims that your method is better than what Oracle has built into the core of the database?

  • LOG ERRORS failing to capture 2291 errors on UPDATE statement

    We are running Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
    We have often successfully used the error logging clause when performing batch inserts to the database. However, we now have a situation where an UPDATE statement is failing and rolling back upon encountering a foreign-key referential constraint [ORA-02291]. It is successfully recording Check constraint errors [ORA-02290]. The foreign keys are not deferred, and they have nothing to do with any unique constraints or indices on the table that is the target of the UPDATE statement. The Error-logging table was created by using the DBMS_ERRLOG package. We recreated it to make sure that we had not introduced column format errors. The same problem occurs. The UPDATE statement is attempting to update approximately 12000 rows. Any help in understanding this problem would be appreciated.
    Here is the error statement
    ORA-02291: integrity constraint (OIFS.FRAME_FK07) violated - parent key not found
    Here is the problem statement and its surrounding PLSQL block:
    BEGIN <<update_records>>
    UPDATE frame f
    SET (company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    update_date,
    update_user,
    -- comments,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    ) =
    (SELECT company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    SYSDATE,
    user_in,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    FROM oifs.respondent r
    WHERE r.cin = f.cin
    WHERE f.cin IN
    (SELECT cin
    FROM
    (SELECT cin,
    company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    FROM oifs.respondent
    MINUS
    SELECT cin,
    company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    FROM oifs.frame
    LOG ERRORS INTO oifs.frame_load_errors
    (job_num || ' ' || TO_CHAR(SYSDATE, 'YYYYMMDD HH24:MI:SS') || ' update')
    REJECT LIMIT UNLIMITED;
    EXCEPTION
    WHEN OTHERS THEN
    ohub.err_pkg.record_and_continue(msg_in => 'problem in updating FRAME rows');
    RAISE;
    END update_records;

    Thank you for your help. It pointed me in the right direction, which was to temporarily disable the triggers. The ORA-02291 errors were then properly captured in the error-logging-table.
    The problem did not appear to be related to the trigger. The problem that was captured in my PLSQL error-handler but not the error-logging-table was an ORA-02291, which was specific to the original table. The trigger-driven processing did not seem to generate any errors (I have PLSQL error-handling logic in there as well).
    I was aware of Tom Kyte's statement, and I knew triggers were dicey when I decided to use them. It seemed the best way to try to ensure database integrity when regular Foreign-Key and Check constraints did not suffice. I am now paying the price for that decision.

  • Update statement time too long

    HI
    im doing this update statement using toad and its been an hour now and not finished ( its only 900 records)
    and when i try to update 20 records only it takes about 3min
    update IC_ITEM_MST set WHSE_ITEM_ID ='503' where ITEM_NO like 'PP%'
    thnx
    Edited by: george samaan on Dec 21, 2008 10:35 PM

    select * from v$locked_object
    gave me this
    XIDUSN XIDSLOT XIDSQN OBJECT_ID SESSION_ID ORACLE_USERNAME
    OS_USER_NAME PROCESS LOCKED_MODE
    11 15 10999 36834 97 APPS
    appltst2 897256 3
    10 47 347465 63200 14 APPS
    Administrator 3124:2324 2
    10 47 347465 63569 14 APPS
    Administrator 3124:2324 2
    10 47 347465 63867 14 APPS
    Administrator 3124:2324 3
    10 47 347465 64380 14 APPS
    Administrator 3124:2324 2
    10 47 347465 64447 14 APPS
    Administrator 3124:2324 2
    10 47 347465 64934 14 APPS
    XIDUSN XIDSLOT XIDSQN OBJECT_ID SESSION_ID ORACLE_USERNAME
    OS_USER_NAME PROCESS LOCKED_MODE
    Administrator 3124:2324 2
    10 47 347465 78678 14 APPS
    Administrator 3124:2324 3
    10 47 347465 79069 14 APPS
    Administrator 3124:2324 3
    10 47 347465 64026 14 APPS
    Administrator 3124:2324 3
    10 47 347465 93468 14 APPS
    Administrator 3124:2324 3
    10 47 347465 209903 14 APPS
    Administrator 3124:2324 3
    10 47 347465 80084 14 APPS
    Administrator 3124:2324 3
    XIDUSN XIDSLOT XIDSQN OBJECT_ID SESSION_ID ORACLE_USERNAME
    OS_USER_NAME PROCESS LOCKED_MODE
    0 0 0 36944 60 APPS
    appltst2 1572894 3
    14 rows selected.

  • Problem in Update statement using Execute Immediate

    Hi All,
    I am facing problem in update statement.
    I am creating dynamic sql and use "execute immediate" statement to execute a update statement.
    But it is not updating any thing there in the table.
    I have created a query like :
    update_query='Update '|| Table_Name ||' t set t.process_status =''Y'' where t.tid=:A';
    Execute immediate update_query using V_Id;
    commit;
    But it is not updating the table.
    I have a question , is execute immediate only does insert and delete?
    Thanks
    Ashok

    SQL> select * from t;
                     TID P
                     101 N
    SQL> declare
      2     V_Id          number := 101;
      3     Table_Name    varchar2(30) := 'T';
      4     update_query  varchar2(1000);
      5  begin
      6     update_query := 'Update '|| Table_Name ||' t set t.process_status =''Y'' where t.tid=:A';
      7     Execute immediate update_query using V_Id;
      8     commit;
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> select * from t;
                     TID P
                     101 Y                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help with doing SELECT sub query within the SET of an UPDATE statement

    After doing some research, it appears as if it's possible to use a SELECT subquery in the SET of an UPDATE statement.  i did find some examples and here is my code, however when I click the "check" button it's saying the field (my entire select subquery) is unknown and neither in one of the specified tables or defined by a "DATA".  Do I have a syntax issue or is there another reason why it's not taking this as a valid statement?  Thanks for the help!
    LOOP AT IT_DATA
    UPDATE /BIC/AZDP_O0140
       SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL )
                            FROM /BIC/AZDP_O0140
                            WHERE MATERIAL EQ IT_DATA-MATERIAL
                            GROUP BY MATERIAL).
    ENDLOOP.

    my Update does indeed have a WHERE clause but because of the issue i'm having, all my criteria in my WHERE is black text in the ABAP editor.  The editor doesn't even recognize the keywords "WHERE" or "EQ".  Below is my entire statement which contains all WHERE criteria in both the Update and the Subquery, i've just removed it for testing to help simplify the query and eliminate as many other factors as posisble that may be causing problems:
    LOOP AT IT_DATA.
       UPDATE /BIC/AZDP_O0140
       SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL ) FROM /BIC/AZDP_O0140
       WHERE WHSE_NUM EQ IT_DATA-WAREHOUSE
        AND  PLANT EQ IT_DATA-PLANT
        AND  /BIC/ZTRAN_NO EQ IT_DATA-TRANS_NUM
        AND  DELIV_NUMB EQ IT_DATA-DELIVERY
        AND  MATERIAL EQ IT_DATA-MATERIAL
        GROUP BY MATERIAL)
       WHERE WHSE_NUM EQ IT_DATA-WAREHOUSE
        AND  PLANT EQ IT_DATA-PLANT
        AND  /BIC/ZTRAN_NO EQ IT_DATA-TRANS_NUM
        AND  DELIV_NUMB EQ IT_DATA-DELIVERY
        AND  MATERIAL EQ IT_DATA-MATERIAL.
    ENDLOOP.
    i should also mention the sources i found were not within the SAP Library but instead on other third-party ABAP websites.  so because i was having issues i wanted to post here to see if anyone else has come up with a working solution.  but if this cannot be done i can likely come up with a solution for my needs using multiple internal tables, this would just have been much easier since i can get a query like this to do what i want in SQL Server.  Thought i could utilize this in ABAP as well.

  • Problem getting correct data from MS Access after doing an Update

    Hi all,
    I have a problem getting correct data after doing an update. This is the scenario
    I am selecting some(Eg: All records where Column X = �7� ) records and update a column with a particular value (SET Column X = �c� ) in all these records by going through a while loop. In the while loop I add these records to a vector too, and pass it as the return value.
    After getting this return value I go through a for loop and get each record one by one from the DB and check if my previous update has actually happened. Since No errors were caught while updating DB, I assume all records are updated properly but my record set shows one after another as if it has not been updated. But if I open the DB it is actually updated.
    This does not happen to all records, always it shows like this
    1st record     Mode = �c�
    2nd record     Mode = �7�
    3st record     Mode = �c�
    4nd record     Mode = �7�
    9th record     Mode = �c�
    10th record     Mode = �7�
    I am relatively new to java and this is someone elses code that I have to modify,So I am not sure if there some thing wrong in the code too
    //Here is the method that gets records and call to update and add to vector
    public static Vector getCanceledWorkOrders() throws CSDDBException{
    //Variable declaration
      try {
        objDBConn = DBHandler.getCSDBCon();
        strSQL  = "SELECT bal bla WHERE [Detailed Mode])=?)";
        objStmt = objDBConn.prepareStatement(strSQL);   
        objStmt.setString(1, '7');
        objWOPRs = objStmt.executeQuery();
        while (objWOPRs.next()) {
         //Add elements to a vector by getting from result set
          //updating each record as PROCESSING_CANCELLED_WO(c)
          iRetVal = WorkOrderDetailingPolicy.updateRecordStatus(objPWODP.iWorkOrderNumber, objPWODP.strPersonInformed, EMSConstants.PROCESSING_CANCELLED_WO);
          if (iRetVal == -1) {
            throw new NewException("Updating failed");
      catch (Exception e) {
        vecWONumbers = null;
        throw new CSDDBException(e.getMessage());
      }finally{
        try {
          objWOPRs.close();
          objStmt.close();
          DBHandler.releaseCSDBCon(objDBConn);
        catch (Exception ex) {}
      //return vector
    //here is the code that actually updates the records
    public static int updateRecordStatus(int iWONumber, String strPerInformed , String strStatus) throws CSDDBException{
       PreparedStatement objStmt = null;
       Connection objDBConn  = null;
       String strSQL = null;
       int iRetVal = -1;
       try{
         objDBConn  = DBHandler.getCSDBCon();
         objDBConn.setAutoCommit(false);
         strSQL = "UPDATE Table SET [Detailed Mode] = ? WHERE bla bla";
         objStmt = objDBConn.prepareStatement(strSQL);
         objStmt.setString(1, strStatus);    
         objStmt.execute();
         objDBConn.commit();
         iRetVal = 1;
       }catch(Exception e){
         iRetVal = -1;
       }finally{
         try{
           objStmt.close();
           DBHandler.releaseCSDBCon(objDBConn);
         }catch(Exception ex){}
       return iRetVal;
    //Here is the code that call the records again
      public static WorkOrderDetailingPolicy getWorkOrders(int iWorkOrderNo) throws CSDDBException{
        Connection objDBConn = null;
        PreparedStatement objStmt = null;
        ResultSet objWOPRs = null;
        WorkOrderDetailingPolicy objPWODP = null;
        String strSQL = null;
        try {
          objDBConn = DBHandler.getCSDBCon();    
          strSQL = "SELECT * FROM [Work Order Detailing] WHERE [Work Order No] = ?";
          objStmt = objDBConn.prepareStatement(strSQL);
          objStmt.setInt(1, iWorkOrderNo);
           objWOPRs = objStmt.executeQuery();
          if (objWOPRs.next()) {
            objPWODP = new WorkOrderDetailingPolicy();
            objPWODP.iWorkOrderNumber = objWOPRs.getInt("Work Order No");
            //......Get Record values
        catch (Exception e) {
          objPWODP = null;
          throw new CSDDBException(e.getMessage());
        }finally{
          try {
            objWOPRs.close();
            objStmt.close();
            DBHandler.releaseCSDBCon(objDBConn);
          catch (Exception ex) {}
        return objPWODP;
      }

    Hello,
    Can you put an example of your problem online?
    Are you sure you're not having problems with case sensitive data?
    Thanks,
    Dimitri

  • I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve things under an old Apple ID when the email used for that account no longer exists? I am trying to update a number of apps that was bought under an

    I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve apps under an old Apple ID when the email used for that account no longer exists &amp; I can't remember the password? After speaking with Apple Acct. Security, I got the security Q right but my birthday was wrong! They wanted the serial number from my phone that was 3 iPhones ago! Seriously??!!
    Any updated way to work around this? No Apple people can correct it.
    Thanks,
    Joe

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (122986)

  • After updating iphone 4s to 6.1 version my battery percentage stood at 1 percent. Does anyone has same problem? Or its update bug?

    After updating iphone 4s to 6.1 version my battery percentage stood at 1 percent. Does anyone has same problem? Or its update bug?

    THIS is "quite a few": https://discussions.apple.com/thread/3391947
    As are these:
    https://discussions.apple.com/thread/3391947?tstart=0
    https://discussions.apple.com/thread/3484755?tstart=0
    https://discussions.apple.com/thread/3481668?tstart=0
    https://discussions.apple.com/thread/3518760?tstart=0
    https://discussions.apple.com/thread/2755090?tstart=0
    https://discussions.apple.com/thread/3507356?tstart=30
    https://discussions.apple.com/thread/3482083?tstart=60
    https://discussions.apple.com/thread/3492588?tstart=60
    https://discussions.apple.com/thread/3397244?tstart=90
    And older ones:
    Battery Meter/Life Problems with 4.0.2
    4.0.2 guzzling my battery. Your's too?
    4.0.1 battery life
    Battery runs out very quicky in iOS 4.0.1
    Battery nearly nonexistant after 4.0 upgrade
    Dead battery after few hours on standby using 4.0 software
    3.1.3 battery problem
    OS 3.1.3 battery issues
    3.1.3 upgrade - shortened battery life?
    Battery life cut after 3.1.3 update on iPhone 3G
    3.1.3 Firmware is a battery killer - how do I back out this upgrade?
    Poor battery life with iPhone 3G running 3.1.2
    3.1.2 EXTREME battery drain - what gives?
    3.1 Battery nightmare
    iPhone 3GS with fw 3.1 – battery life gets even worse
    Battery Issues with 3.0.1
    BATTERY drain with 3.0
    upgrade to 3.0 drains my battery
    Battery Drain after Update 2.2.1
    Battery Life Radically Decreased after 2.2.1 Firmware Update
    As you can see, battery issues have been common since the first iphone, frequently reported after an upgrade, but not always. So to blame a specific version doesn't describe the problem sufficiently to find a resolution.

  • How does one update Flash? I currently cannot watch videos on You Tube, it says I need to upgrade, I have no problem doing this on a PC.

    How does one update Flash? I currently cannot watch videos on You Tube, it says I need to upgrade, I have no problem doing this on a PC.

    If you're not using chrome you can just go to adobe's website (http://get.adobe.com/flashplayer/) and download the newest flash player.  You run the .dmg and then open the application, which updates flash.  With the latest version of flash there should be a preference pane within system preferences to allow you to change settings and check for updates.

Maybe you are looking for