SELECT, update, SELECT the problem

Hello world

I am very new to working with Oracle with .net and I am a bit confused by something, so I hope someone can help me...
The situation is that I have 3 commands. The first selects a row in a table ("SELECT field1, Field2 FROM table1 WHERE Field1 is 1'), then Field2 = 'foo '. The second command updates the same line in this table ('UPDATE table1 SET Field2 = 'bar' WHERE field1 = 1'), then the third makes a selection re (('SELECT champ1, champ2 FROM table1 WHERE champ1 = 1').) The problem I have is that the third command bring me the same results that firstly, unchanged - even if I see this line in the database and I KNOW He is changed, and the second command worked. Field2 = always "foo"... If I refresh and refresh a couple of times, data is changed later.

Here is a code...

DataTable Table = new DataTable();
OracleConnection conn = new OracleConnection ("User Id = database; Password = password; Data Source =');
Conn. Open();
OracleDataAdapter adapter = new OracleDataAdapter ("SELECT field1, Field2 FROM TABLE1 WHERE FIELD1 = 1, conn);
Set DataSet = new DataSet();
adapter. Fill (Set);
Table = all. Tables [0];

It's all right, I get what I expect, IE: Field2 = 'FOO '...
So now, I am doing this...

OracleParameter Field2Param = new OracleParameter ("Field2", OracleDbType.Char, 64, "BAR", ParameterDirection.Input);

OracleConnection conn = new OracleConnection ("User Id = database; Password = password; Data Source =');
Conn. Open();

OracleCommand cmd = new OracleCommand (insertstr, conn);

OracleTransaction txn is conn. BeginTransaction (IsolationLevel.ReadCommitted);

cmd. Parameters.Add (Field2Param);

cmd ExecuteNonQuery());

.. .This works also, depending on the point of view of database.

So I update in the same way as before...

DataTable Table = new DataTable();
OracleConnection conn = new OracleConnection ("User Id = database; Password = password; Data Source =');
Conn. Open();
OracleDataAdapter adapter = new OracleDataAdapter ("SELECT field1, Field2 FROM TABLE1 WHERE FIELD1 = 1, conn);
Set DataSet = new DataSet();
adapter. Fill (Set);
Table = all. Tables [0];

.. .but I still get Field2 as 'FOO '...

Help, please...

Hello

Complete code would help here, because I can't tell where you are finishing the explicit transaction and data validation. Can you reproduce the complaint if you all back to back sequentially in a console application standalone with all the code inside the HAND, for example?

Here is my proposal, if: call you con. Open several times, so the second or 3rd con. Open call receives a different connection of the pool, rather than you use only and did not commit the transaction again so that it is visible to other connections.

Also, if your db is RAC, it is also delay spread of validation that can prevent the data to be visible in the other nodes, if your code is running in a tight loop and you are connected to another node.

It will be useful,
Greg

Published by: gdarling on June 27, 2011 11:25

Tags: Database

Similar Questions

  • I am also having the same problem with the same updates. I have Windows XP SP3 and it's updates with the problem.

    I am also having the same problem with the same updates. I have Windows XP SP3 and it's updates with the problem.

    Security Update for Microsoft .NET Framework 2.0 SP2 on Windows Server 2003 and Windows XP x 86 (KB2572073)
    A security update for .NET Framework 2.0 SP2 and 3.5 SP1 on Windows Server 2003 and Windows XP x 86 (KB2518864)
    Security Update for Microsoft .NET Framework 2.0 SP2 on Windows Server 2003 and Windows XP x 86 (KB2633880)

    They all install properly but switches back to windows update to install. It's some kind of loop.

    Hi billy73,

    In addition, if you still have questions, please take a look at the thread similar here with a solution as possible.

    I hope this helps!

  • Select the problem with expressions

    Hello

    I use Teststand 4.0 and a frustrating problem with the Select Case statements.

    I have attached a sequence that shows the problem.

    A loop from 0 to 10.

    The select case statement should decide which box 3 instructions corresponds to the expression and a message box is displayed.

    However the Basic program reacts as expected.

    First, he made his entry with a value of 0, it goes to the > 7 stated case.

    The second time, he enters the loop with a value of 1, it will correctly to the<3 case="">

    The other values of 2 to 10 enter no case statement.

    Is this a bug in TS 4?, or I do something wrong?

    Thank you

    Mike

    The problem is that you compare the Locals.New_Val of the Locals.New_Val property.< 3". ="" if="" those="" two="" properties="" match,="" then="" it="" will="" execute. ="" if="" you="" wanted="" that="" particular="" case="" to="" execute="" when="" locals.new_val="" is="" 0,="" you="" would="" just="" type="">

    Unfortunately there is no way to have multiple cases of a single block of code.

    In C, you could do it like this:

    Switch (newVal)

    {

    case 0:

    case 1:

    case 2:

    do something

    break;

    case 3:

    case 4:

    case 5:

    case 6:

    case 7:

    do something else

    break;

    etc...

    }

    Even in C, it's awkward, and you would probably do the following instead:

    If (newval<>

    do something

    Else if (newval<>

    do something else

    on the other

    do something else

    The reason why it works in TestStand, is that expressions will try to automatically convert types if she can do it.  false is logically equivalent to 0 and true, it is logically equivalent to 1, so what you are really comparing to in your case statement is your property (Locals.New_Val) to a Boolean expression that evaluates to 0 or 1.  It is certainly not obvious when we look at, but at least, this explains why it happens.  Another way, you could do this is to change "Point to compare" step of the 'True' selection, which will each case in order to compare the expression of the value 'true '.  I still recommend a structure if/else if/else for this kind of problem because it's easier to read, but it is possible to do what you want in this case with a select / box.

    P. Allen

    NEITHER

  • Select the problem with joined tables

    Hello everyone I have the following query
    SELECT 
        OBJEKTI.OBJEKAT_ID OBJEKAT_ID, 
        OBJEKTI.ADRESA ADRESA, 
        OBJEKTI.POVRSINA POVRSINA, 
        OBJEKTI.BROJ_IZVRSILACA BROJ_IZVRSILACA, 
        OPREMLJENOSTI.OPREMLJENOST_ID OPREMLJENOST_ID, 
        OPREMLJENOSTI.PULT PULT, 
        OPREMLJENOSTI.REKLAMA REKLAMA, 
        OPREMLJENOSTI.MOKRI_CVOR MOKRI_CVOR, 
        OPREMLJENOSTI.WC_ZA_IGRACE WC_ZA_IGRACE, 
        OPREMLJENOSTI.WC_ZA_OSOBLJE WC_ZA_OSOBLJE, 
        OPREMLJENOSTI.VENTILATOR VENTILATOR, 
        OPREMLJENOSTI.OSVJETLJENJE OSVJETLJENJE, 
        OPREMLJENOSTI.VRSTA_BROJILA VRSTA_BROJILA, 
        OPREMLJENOSTI.ELEKTRO_INSTALACIJE ELEKTRO_INSTALACIJE, 
        OPREMLJENOSTI.VODO_INSTALACIJE VODO_INSTALACIJE, 
        OPREMLJENOSTI.TELEFONSKE_INSTALACIJE TELEFONSKE_INSTALACIJE, 
        OPREMLJENOSTI.GRIJANJE_ID GRIJANJE_ID, 
        OPREMLJENOSTI.POD_ID POD_ID, 
        OPREMLJENOSTI.PROZORI_VRATA_ID PROZORI_VRATA_ID, 
        OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID1, 
        TEHNICKE_OPREMLJENOSTI.TEH_OPR_ID TEH_OPR_ID, 
        TEHNICKE_OPREMLJENOSTI.ONLINE_KLADIONICA ONLINE_KLADIONICA, 
        TEHNICKE_OPREMLJENOSTI.PANO PANO, 
        TEHNICKE_OPREMLJENOSTI.NOSACI NOSACI, 
        TEHNICKE_OPREMLJENOSTI.TV_LCD TV_LCD, 
        TEHNICKE_OPREMLJENOSTI.TV_TELETEXT TV_TELETEXT, 
        TEHNICKE_OPREMLJENOSTI.APARATI_IGRE APARATI_IGRE, 
        TEHNICKE_OPREMLJENOSTI.EVONA EVONA, 
        TEHNICKE_OPREMLJENOSTI.NOVOMATIC NOVOMATIC, 
        TEHNICKE_OPREMLJENOSTI.RULET RULET, 
        TEHNICKE_OPREMLJENOSTI.BILIJAR BILIJAR, 
        TEHNICKE_OPREMLJENOSTI.KLIMA KLIMA, 
        TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID2, 
        PONUDE.PONUDA_ID PONUDA_ID, 
        PONUDE.ONLINE_TERMINAL ONLINE_TERMINAL, 
        PONUDE.SRECKE SRECKE, 
        PONUDE.ONLINE_KLADIONICA ONLINE_KLADIONICA1, 
        PONUDE.APARATI_IGRE APARATI_IGRE1, 
        PONUDE.RULET RULET1, 
        PONUDE.BILIJAR BILIJAR1, 
        PONUDE.OBJEKAT_ID OBJEKAT_ID3 
    FROM 
        OBJEKTI, 
        OPREMLJENOSTI, 
        TEHNICKE_OPREMLJENOSTI, 
        PONUDE 
    WHERE 
    (PONUDE.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID) OR (OPREMLJENOSTI.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID)
     ORDER BY OBJEKTI.OBJEKAT_ID
    The problem I have is any WHERE clause I use I have double values that makes no sense. I checked in the tables and I not all double values. Each Opremljenost has 1 objekat (there are 2 rows of each with its own Objekat) and this applies to 2 other tables (PONUDE and TEHNICKE OPREMLJENOSTI), but for some reason any that they double values. If I run it without a where clause at all clause, I get a repetition of values itself up to 4 times. Does anyone have an idea what's wrong with my request?

    Well, if all relationships are to 1-1 (1-0), then try this (the names of table/column, but you get what I mean bad):

    select OBJ.*, OPR.*, TEH.*, PON.* -- I know you can't do this, but you get what I mean.
    from OBJ,OPR,TEH,PON
    where OBJ.object = OPR.object (+)
      and OBJ.object = TEH.object (+)
      and OBJ.object = PON.object (+)
    /
    

    its supposed to be a 1 to 1 relationship, but it is not.

    In this case the remedy is very simple: create a UNIQUE constraint on the column of the OBJECT in OPR, TEH and PON...

  • Any update on the problems with Safari after you have installed the new update?

    Any update from Apple. How long this problem will be resolved?

    What is the problem?

  • for a week and the victory like 7 and mse will be automatically updated and the problem is not repeated on my copy of licened end clean to stall

    I installed clean several times to offer since the victory of 10 factory restore was deleted in July 2016 none of my operating system of windows and MS security essentials error code 0 x 80004004 were able to auto update via windows update.

    I used the stand-alone version and which do not work Ive used all update patches, they do not work ive not done reference also with the cmd no results at this stage, the problem is not on my end, so the problem seems to be in the Microsoft server ends that would be true?  net internet connections work on my end

    Windows 7 update problems? First read this.

    :)

  • Lenovo P780 Kitkat 4.4.2 update: post the problems and changes

    I found the problem in internet and wifi

    on lock mode my internet connection does not and the wifi works not as

    I have on the screen, then after re connect my internet

    so please sugess me all types of setting in mobile

    Please help me on this problem as soon as posible

    Actually works. Your connection turn off it is because the Wlan settings. Try

    ---> Wlan settings---> settings (via the left button)---> advanced---> keep Wlan on during sleep---> always.

    It's so simple like that, there is no problem on the firmware.

  • Select the problem posed by the query?

    Hello

    I use 10g and here is my example query adds nothing. I know there are records in the database. It must be linked with my date conversions.

    SELECT a.gm_cd, a.draw_cd, NVL (b.cpns, 0) cpns, NVL (b.clms, 0) SSAC, NVL (b.amn, 0) amn FROM (SELECT gm_cd, draw_cd, TO_DATE (draw_tm, ' DD/MM/YYYY') draw_tm TO draw WHERE gm_cd = 10105 AND TO_DATE (draw_tm, ' DD/MM/YYYY') = TO_DATE (sysdate-1, ' DD/MM/YYYY')) a, (SELECT SUM (DECODE (a.from_draw, a.to_draw, a.cpns * b.sing_ind 0)) cpns) (, SNSOT SUM (a.clms* b.sing_ind), amn SUM (a.amn* b.sing_ind) OF draw_sales a, ACC_TYPE b WHERE a.tp = b.cd AND a.DT = TO_DATE(sysdate-1, 'DD/MM/YYYY') AND a.gm_cd = 10105) b ORDER BY a.gm_cd, a.draw_cd

    Any ideas?

    Furthermore, draw_tm is a column DATE (05/11/2013 03:59:59) and the DT is also a column DATE (10/05/2013)

    raysefo wrote:
    Hello

    I use 10g and here is my example query adds nothing. I know there are records in the database. It must be linked with my date conversions.

    SELECT a.gm_cd, a.draw_cd, NVL (b.cpns, 0) cpns, NVL (b.clms, 0) SSAC, NVL (b.amn, 0) amn FROM (SELECT gm_cd, draw_cd, TO_DATE (draw_tm, ' DD/MM/YYYY') draw_tm TO draw WHERE gm_cd = 10105 AND TO_DATE (draw_tm, ' DD/MM/YYYY') = TO_DATE (sysdate-1, ' DD/MM/YYYY')) a, (SELECT SUM (DECODE (a.from_draw, a.to_draw, a.cpns * b.sing_ind 0)) cpns) (, SNSOT SUM (a.clms* b.sing_ind), amn SUM (a.amn* b.sing_ind) OF draw_sales a, ACC_TYPE b WHERE a.tp = b.cd AND a.DT = TO_DATE(sysdate-1, 'DD/MM/YYYY') AND a.gm_cd = 10105) b ORDER BY a.gm_cd, a.draw_cd

    Any ideas?

    Furthermore, draw_tm is a column DATE (05/11/2013 03:59:59) and the DT is also a column DATE (10/05/2013)

    If draw_tm is a DATE data type, then you shouldn't do a TO_DATE on it, as you don't need to convert it to a date. If you try to remove any component "hour" of him, then you must use TRUNC (draw_tm).

    Similarly, with sysdate, you must use TRUNC to truncate. Never use TO_DATE datatypes in other data you causes an implicit conversion in varchar2 who depend on your NLS settings and may fail.

  • Select the problem

    Hello
    I have the following table t1 with data such as
    col1
    test
    23
    3
    45
    13
    6
    test2
    9
    89
    67
    23
    test3
    78
    23
    22
    How to make a table with 2 columns same
    col1          col2
    test          test
    23            test
    3              test
    45            test
    13            test
    6              test
    test2        test2
    9             test2
    89            test2
    67            test2
    23            test2
    test3        test3
    78            test3
    23            test3
    22            test3
    The string value of col1 should be the parent.

    Thank you

    Maybe NOT TESTED

    select col1,
           last_value(col2) ignore nulls over (order by the_order nulls last) col2 /* 11g */
    /*     last_value(col2) ignore nulls) over (order by the_order nulls last) col2 -- below 11g */
      from (select col1,
                   case when col1 like 'test%'
                        then col1
                   end col2,
                   row_number() over (order by null) the_order
              from your_table
           )
     order by the_order
    

    Concerning

    Etbin

  • Will I have to reactivate windows 7 after this update of the problems?

    I've been using Microsoft Flight Simulator X Demo for a few weeks, but my material is not good enough to get a reasonable rate.
    I love the program, so I bought a copy of Microsoft Flight Simulator Gold edition.
    Before installing my copy of FSX Gold, I would like to update some of my hardware.

    My current set up is:

    Windows 7 Professional w/SP1 64-bit bought Jan 2012
    ASRock M3A770DE 770 Socket AM3 8 Channel Audio ATX motherboard.
    AMD Athlon II X 3 455 3.3 GHz Socket AM3.
    Memory: Crucial 8GB Kit (4GBx2) DDR3 PC3-12800.
    ATA (boot) hard drive ST3200822A (200G) purchased 2006 Jan.
    Silicon image Sil 3114 SATA Raid controller.
    Card PCI-E SAPPHIRE HD 6450 1 GB DDR3 DVI - VGA - HDMI
    DVD - ROM drive.

    I intend to do the following:
    Keep the original motherboard Asrock M3A770DE, Crucial memory, raid controller and DVD - ROM.
    Upgrade the processor AMD Athlon II X 3 455 with an AMD Phenom II x 6 1100t.
    Update the graphics card Sapphire HD 6450 with an Asus Nvidia GeForce GTX 750 Ti.
    Replace the hard drive ST3200822A with a 250 GB WD Velociraptor, the ST3200822A is eight years and well beyond its life expectancy.

    The old processor and graphics card is going to be scrapped because they are very little value.
    The old ST3200822A will be partitioned and formatted.

    This will give me problems with the reactivation of windows 7?
    I can't afford to buy another copy of Windows 7.

    Thank you very much
    Steven.

    Yes, since you do not migrate the motherboard, you should be good. You will still need to reactivate by telephone but, so keep this in mind:

    How to activate Windows 7 manually (activate by phone)
     
    1) click Start and in the search for box type: slui.exe 4
     
    (2) press the ENTER"" key.
     
    (3) select your "country" in the list.
     
    (4) choose the option "activate phone".
     
    (5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
     
    (6) explain your problem clearly to the support person.
     
    http://support.Microsoft.com/kb/950929/en-us

  • Update of the problems after the installation of July 2016

    I've just updated Lightroom using the update of July 2016.

    I then went to Edit/Preferences to see what setting the GPU, I had and the suspended system.  I rebooted my computer and tried the same thing again.  Hooked again!

    Hi Yar.Dranrab,

    Please follow the suggestions mentioned in this thread problem with preferences and let us know if this helps.

    Kind regards

    Assani

  • New update on the problem of XP Assistive Technologies

    What is assistive technology and how will affect upgrade me? Is it safe to go ahead and upgrade before moving on to a new operating system of Windows XP?

    Hello, assistive technology refers to tools such as screen readers for blind people - for more details, please refer to the bug #1045518.

  • Automatic update because of problems with the USB ports.

    After an automatic update this morning at 03:00 October 15, 2010 for windows vista, all my USB ports on my laptop have stopped working. Please advice all solutions to locate the update caused the problem.

    This must be a different problem from what I had so...

    In any case, I uninstalled all updates on vista (as opposed to other programs, office, outlook, etc.) and then reinstalled again and everything works fine now... go figure: /.

  • Which solves the problem of MDM_Util.exe? I tried installing updated and it persists % $@.

    I am trying to install a Netgear router and when I click the installer, I get the MDM_Util.exe closed unexpectedly.  Please click here for the update solve the problem.  I did all the updates and it still does not work.  More whenever I have him try again, there is an another important update needs to happen - I feel like this could be a virus...

    I am trying to install a Netgear router and when I click the installer, I get the MDM_Util.exe closed unexpectedly.  Please click here for the update solve the problem.

    And did you contact Netgear Support? Is there the Netgear updates available (for example, as the firmware update)?

    CF. http://forum1.netgear.com/showthread.php?t=19370

    CF. http://forum1.netgear.com/showthread.php?t=20347 ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Problem loading the images after update of the plugin

    I had installed the following, and code worked great:
    BlackBerry component Pack 4.5.0.14
    BlackBerry JDE plugin for Eclipse 1.0.0.50
    Eclipse 3.4.1

    I've updated the plugin from 1.0.0.67 and copy the following code no longer works:

    Private static final Bitmap _bitmap is Bitmap.getBitmapResource ("splash.png");.

    My classes are in com.bbbj

    My images are in com.bbbj.img

    As I said, it worked before the upgrade and not after the upgrade. No other changes have been made.

    Now, none of my images are loading.

    Any ideas?

    I have re-installed the update and the problem doesn't happen anymore.

Maybe you are looking for

  • Dialog box "Bookmark all" is HUGE!

    I have the version 40.0.3 of FireFox running on a Dell XPS under Windows 7 Home Premium laptop. When I right click on a tab for "bookmark all tabs" in a window, the dialog box that opens is really long and thin... I want to say, "scroll across the wi

  • How to remove photos from my iPad

    How can I remove a number of photos from my iPad? Synchronization does not give me total control and is very enigmatic.

  • Messages to update Windows Vista 64-bit driver for Qosmio F30 Vista 32 bit

    Hello Today, I noticed that, update Windows Vista displays the bad update for one of the drivers of Qosmio F30. I have Windows Vista 32-bit, but Windows Update post a 64 bit version of the driver. See the screenshot [here: http://imagefilehost.google

  • Validity Sensor (VFS301) does not not portable dm4

    Just bought a Pavilion laptop provided with the scanner of validity Fingerpring dm4. As soon as I bought the laptop, I was quick to install Windows 7 Pro 64-bit because my job requires additional features in Win 7 Pro. The BONE that was preinstalled

  • How to display the size of the file in my computer or Windows Explorer?

    When you open my computer or Windows Explorer, there is an option to display the 'size', but it does not for the record, only the files in the folders. How can I automatically see sizes of the entire folder without going through a right click and see