Updating data in a table...please help

Hi,
I'm having a problem with the following code..
OracleTransaction myOracleTransaction = null;
OracleCommand myOracleCommand = conn.CreateCommand();
myOracleCommand.CommandText = "UPDATE conturi_curente set cod_cont=12 where cod_cont=100000;";
try
myOracleTransaction = conn.BeginTransaction();
int x = Int32.Parse(lstBoxConturiCurente.SelectedItem.ToString());
MessageBox.Show(x + "");
// string cmdQuery = "UPDATE conturi_curente set cod_cont=12 where cod_cont=100000;";
myOracleCommand.ExecuteNonQuery();
myOracleTransaction.Commit();
catch (Exception exc)
MessageBox.Show(String.Format("{0}\r\n{1}", exc.Source, exc.Message));
and I get the message "ORA-00911 Invalid character", and I have no idea what the problem is..
Please help...I am new at working with ODP...and there are very few examples on the net..
thank you.

remove semicolon (;) from your query command text

Similar Messages

  • Update Date Field in Table Row to SysDate

    This appears to be an easy thing to do, but I can't figure out the best way to do it.
    I have a table with 2 input text boxes and some output text boxes.  When either input text box changes for a row, I need to update the date in one of the output text boxes in the same row to the current date. Then, when I commit the changes, the database should show the current date for that date field in that record.
    I'm using JDev 11.1.1.6
    Thanks,
    Ray

    Any help would be appreciated.
    I figure the RowImpl class is being instantiated when the table loads.  Is there a method in the RowImpl class that gets called when a row is changed?  Should I have an action on my submit button that scrolls through all rows to see if any are dirty and update the date from there?
    Please help.

  • Efficient way of updating data to database table

    what is the efficient way of updating data to database table  .
    i have huge amount of data in my internal table  , how to use update statement in this case .
    1. database table having 20 fields  ,
    2. one is key field and suppose 20 th field i want to change  .
    3. I have data for only 2 fields , i.e for ( 1 st and last 20 th field ) .
    i can't use update statement in loop , as it is not good practice(hits database several times ) .
    do it effects all the 20 fields for  particular record .

    Hi,
    Use UPDATE statement , check below description from SAP help.
    UPDATE dbtab FROM TABLE itab. or UPDATE (dbtabname) FROM TABLE itab.
    Effect
    Mass update of several lines in a database table.Here, the primary key for identifying the lines tobe updated and the values to be changed are taken from the lines of theinternal table itab. 
    The system field SY-DBCNT contains the number of updated lines,i.e. the number of lines in the internal table itab which havekey values corresponding to lines in the database table.
    Regards
    L Appana

  • My ipad air getting close all apps automatically within seconds while connecting wifi. This issue is started after the updation of the iSO 8, Please help me to rectify this issue.

    Hi,
    My ipad air getting close all apps automatically within seconds while connecting wifi. This issue is started after the updation of the iSO 8, Please help me to rectify this issue.
    Expecting some quick solution in this regard,
    Thanks
    Prabhu

    (A) Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.
    (B) Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing will be reset

  • I can't update my ipad 1st gen.. it says that 4.2 is the latest version. i'm in Lion and my itune are updated to the latest version. please help!!!

    i can't update my ipad 1st gen.. it says that 4.2 is the latest version. i'm in Lion and my itune are updated to the latest version. please help!!!

    i check everything and it's all up to date....the ipad show up in the device as well.. this is what it looks like

  • I bought iPhone 4 for my wife, didn't create a separate apple ID account for her at that time. How can I now create a new one for her, sync her phone to the same PC that I sync my iPhone with without loosing all of her data, contacts, etc. Please help!

    I bought iPhone 4 for my wife, didn't create a separate apple ID account for her at that time. How can I now create a new one for her, sync her phone to the same PC that I sync my iPhone with without loosing all of her data, contacts, etc. Please help!

    I bought iPhone 4 for my wife, didn't create a separate apple ID account for her at that time. How can I now create a new one for her, sync her phone to the same PC that I sync my iPhone with without loosing all of her data, contacts, etc. Please help!

  • I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me..

    I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me build the string .Below is the query and the out put. ( the string is building fine except the parameters are with out quotes)
    here is the procedure
    create or replace
    procedure temp(
        P_MTR_ID VARCHAR2,
        P_FROM_DATE    IN DATE ,
        P_THROUGH_DATE IN DATE ) AS
        L_XML CLOB;
        l_query VARCHAR2(2000);
    BEGIN
    l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
       ' AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ',''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
        ' AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ','' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
    SELECT DBMS_XMLQUERY.GETXML('L_QUERY') INTO L_XML   FROM DUAL;
    INSERT INTO NK VALUES (L_XML);
    DBMS_OUTPUT.PUT_LINE('L_QUERY IS :'||L_QUERY);
    END;
    OUTPUT parameters are in bold (the issue is they are coming without single quotes otherwise th equery is fine
    L_QUERY IS :SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),'9999999.000') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),'$9,999,999.00') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),'9999999.000') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,'mm/dd/yyyy') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,'hh24:mi'), '00:00','24:00', TO_CHAR(s_datetime+.000011574,'hh24:mi')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '1'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,'DD-MON-YY') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '2'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,' DD-MON-YY') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)

    The correct way to handle this is to use bind variables.
    And use DBMS_XMLGEN instead of DBMS_XMLQUERY :
    create or replace procedure temp (
      p_mtr_id       in varchar2
    , p_from_date    in date
    , p_through_date in date
    is
      l_xml   CLOB;
      l_query VARCHAR2(2000);
      l_ctx   dbms_xmlgen.ctxHandle;
    begin
      l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,'' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
      l_ctx := dbms_xmlgen.newContext(l_query);
      dbms_xmlgen.setBindValue(l_ctx, 'P_MTR_ID', p_mtr_id);
      dbms_xmlgen.setBindValue(l_ctx, 'P_FROM_DATE', to_char(p_from_date, 'DD-MON-YY'));
      dbms_xmlgen.setBindValue(l_ctx, 'P_THROUGH_DATE', to_char(p_through_date, 'DD-MON-YY'));
      l_xml := dbms_xmlgen.getXML(l_ctx);
      dbms_xmlgen.closeContext(l_ctx);
      insert into nk values (l_xml);
    end;

  • I have not been able to update my fairy farm game for the last 5days as it quit at launch. I am afraid to delete and reinstall the game as i might lose all. Anyone knows if there is an update for this game? Please help. Thanks

    I have not been able to update my fairy farm game for the last 5days as it quit at launch. I am afraid to delete and reinstall the game as i might lose all. Anyone knows if there is an update for this game? Please help. Thanks

    Erdygirl please be aware you are posting to a public forum.  I have removed your personal information from your previous post.
    Please check your account at http://www.adobe.com/ to locate your serial number.  You can find more information on how to locate your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.

  • Creating a external content type for Read and Update data from two tables in sqlserver using sharepoint designer

    Hi
    how to create a external content type for  Read and Update data from two tables in  sqlserver using sharepoint designer 2010
    i created a bcs service using centraladministration site
    i have two tables in sqlserver
    1)Employee
    -empno
    -firstname
    -lastname
    2)EmpDepartment
    -empno
    -deptno
    -location
    i want to just create a list to display employee details from two tables
    empid firstname deptno location
    and same time update  in two tables
    adil

    When I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list.  When I attempt to edit it, I get an error:
    External List fails when attached to a SQL view        
    Sorry, something went wrong
    Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
    I can edit the view in SQL Manager, so it seems strange that it fails.
    Any advice would be greatly GREATLY appreciated. 
    Thanks,
    Randy

  • I have a problem in the data entry Visa card please help

    I have a problem in the data entry Visa card please help

    abdulaziz711 wrote:
    I have a problem in the data entry Visa card please help
    Is this what you mean...
    http://support.apple.com/kb/TS1646
    If no joy...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Hello Since yesterday evening. My itunse program does not work my mobile. Note  I update the program to ios7 Please help me Thank you

    hi
    Hello
    Since yesterday evening. My itunse program does not work my mobile.
    Note
    I update the program to ios7
    Please help me
    Thank you

    I found this strange glitch that wouldn't let me open my iTunes Store. I tried all the reset options and still iTunes would close a second after it opened. I fixed this. Instead of using the iTunes Store icon on your home page to open it. Go into music and click on store. It will say "Cannot Connect To Store". Just tap ok. Then tap on "featured" on the bottom of the screen. That will take you to the store front page. After that is loaded. Back out and the icon for iTunes Store on the home page should work just fine. Hope that helps.

  • Recently updated my iphone 4s software. now it won't sync w/ itunes, says i need updated itunes. i updated itunes... now it says that my desktop software is old and can't run new itunes. Yet, i cant update my computer either. PLEASE HELP!!!! UGHH

    recently updated my iphone 4s software. now it won't sync w/ itunes, says i need updated itunes. i updated itunes... now it says that my desktop software is old and can't run new itunes. Yet, i cant update my computer either. PLEASE HELP!!!! UGHH

    Why can't you update your computer operating system ("desktop software")? What software would that be?

  • My Documents and Data on my phone are taking up half of my storage! I have no idea what my documents and data are?! Please help!

    My Documents and Data on my phone are taking up half of my storage! I have no idea what my documents and data are?! Please help! I need to reduce it

    DDAAYY wrote:
    i need to free storage on my phone,
    because you want to put more Documents & Data on it.
    Make sure you sync photos to computer then delete from Camera Roll. (Camera Roll photos are part of Documents & Data).
    Delete some apps on the iPhone.
    Then Restore iPhone in iTunes.

  • Will I lose my photos in recovery mode? I tried to update to latest software and I received a message that iphone needs to be updated to factory settings.  Please help.  I cannot use iphone.

    will I lose my photos in recovery mode? I tried to update to latest software and I received a message that iphone needs to be updated to factory settings.  Please help.  I cannot use iphone.

    I would "guess", since you were in the middle of backing up, your backup is corrupt & most likely unusable. Only one way to find out though, & that's by trying to restore from that backup. If your pics are not there, they are gone.

  • HT1222 I have tried to download iOS7 but the iTunes keep asking me to upgrade iTunes version 11.5 and my one is 11.5 so when I clicked it says no update available. Could you please help me? many thanks.

    I have tried to download iOS7 but the iTunes keep asking me to upgrade iTunes version 11.5 and my one is 11.5 so when I clicked it says no update available. Could you please help me? many thanks.

    Hi bodeboni!
    You will probably want to download the newest version of iTunes (iTunes 11.1) directly from Apple and install it on your computer if you are having issues updating. The link for the download can be found here:
    Apple - iTunes - Download iTunes Now
    http://www.apple.com/itunes/download/
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • HT6162 Hi guys, I downloaded this new iOS7.1 but it always fails to install. It says I am not connected to the Internet while I have all the network and second excuse it gives is that the software update is currently unavailable. Please help.

    Hi guys, I downloaded this new iOS7.1 but it always fails to install. It says I am not connected to the Internet while I have all the network and second excuse it gives is that the software update is currently unavailable. Please help.

    Hi Romantilizer,
    Hook your phone up to iTunes on the computer you sync with and do your update from there. This is a robust iOS release, and doing it OTA is not always successful. I tried on my iPhone a couple of times, and it aborted the update twice. Did it via the Mac, and it was fine.
    It takes a bit of time, so hook it up, make sure it is updating your phone, and then find something else to do for a couple of hours.
    Cheers,
    GB

Maybe you are looking for

  • How do I sync my iPhoto library on my mac to my iPad

    How do I sync photos from my Iphoto library to my iPad 2? Any help would be great!

  • FaceTime on 3GS

    I have just bought a new iPhone 3GS from the 'Three" Network in the UK.  On delivery I upgraded to IOS 5 and everything is working as I would wish... Except FaceTime There is no icon for the app, and no option to enable it in the Settiings=>Phone I'm

  • Transferring users to new CUA without transferring parameters

    Greetings, we are in the process of moving our CUA users from our current (4.6) system to our new CUA (Web AS 7.0) system. We would like to transfer the users from the old CUA (4.6) to the new CUA (7.0). After we add the old CUA to the new CUA distri

  • Project stock exist in a plant and WBS but with different company code

    Hello, As I know I can not create a PO in company A, but was assigned to a WBS maintained in company code B. The system will check if the WBS getting the same company code with the PO, and pop up  the error message if the company code was differect.

  • Camera Profiles with Older Lightroom Version

    Using an older version (LR 2.7) on an older Mac G5. Would like to download the camera profiles for my Canon cameras (1Ds MK2, G12) from Adobe but can't find them on line. Since this version is old, do compatible profiles still exist? If so, where mig