DB2 Open Quey : Read Uncommitted data

  • I have a simple link server accessing a mainframe DB2 database.

    Select * from OpenQuery(DB2_SAMPLE,'Select * from Test1.Table1')

    My doubt is whether this query will read uncommitted data or only committed data from DB2 ?

  • This will solely rely on the way your DB2 environment and transactions are setup.

    Normally it would only read committed transactions. If you DB2 tables and transactions are setup to not lock the row/page/table it is updating, you may end up with dirty reads, but it all depends.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • Thanks for the reply ..

    Does this mean that we cannot control the behaviour from SQL side .?

    Is there something like with "no lock" hint which can be part of the query ..?

  • Does this mean that we cannot control the behaviour from SQL side .?

    Is there something like with "no lock" hint which can be part of the query ..?

    You can control the way you read from the source (DB2).

    using WITH NO LOCK from SQL will merely read (if any) the data from the source, committed or uncommitted.

    why would you want perform dirty reads anyway?

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • This was removed by the editor as SPAM

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply