Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / General DB Topics / February 2005

Tip: Looking for answers? Try searching our database.

SELECT in a transaction

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fabrice.gautier@gmail.com - 20 Feb 2005 01:12 GMT
Hi,

Ignorant SQL question:

If I do a SELECT during a transaction, before COMMIT, does the select
sees whatever has been done earlier in the transaction?

Or in other words with something like:

BEGIN
INSERT INTO some_table something
SELECT * FROM some_table
COMMIT
SELECT * FROM some_table

Should the two select have the same results? (Assuming the COMMIT does
fails)

Thank you

--
Lee Fesperman - 20 Feb 2005 02:16 GMT
> Hi,
>
[quoted text clipped - 13 lines]
> Should the two select have the same results? (Assuming the COMMIT does
> fails)

Assuming you meant "the COMMIT *doesn't* fail", the two selects will have the same
results. IOW, the first select will see any prior changes in the transaction.

Signature

Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS  (http://www.firstsql.com)

fabrice.gautier@gmail.com - 20 Feb 2005 02:35 GMT
Yes I meant:  "doesnt fail"

Thanks
Alan - 20 Feb 2005 04:04 GMT
> Hi,
>
[quoted text clipped - 17 lines]
>
> --

Your session should see the same results before and after the commit..
Another user will see the "uninserted" version priot to the commit, and the
same version you see after the commit.
DA Morgan - 20 Feb 2005 22:32 GMT
> Hi,
>
[quoted text clipped - 16 lines]
> Thank you
> --

The answer to your question is entirely dependent upon which database
you are using and the isolation level associated with the transaction.

As you've not bothered to identify the database and isolation level no
accurate answer is possible.
Signature

Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.