Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dirty reads...default in views?

Status
Not open for further replies.

noober

IS-IT--Management
Oct 10, 2003
112
US
Does anyone know if when you select from a view its a "dirty read" by default? And if not, is there something that someone could have done to make a select dirty?

Also, is there a parm I can pass in my SQL to make sure a read is not dirty?
 
Hi,

No, Views are are not retrieved with "dirty read" isolation level by default. Views behave just like it's underlying table except in few areas. Concurrency issues still be related to the base or the underlying table itself.

Is there something that someone could have done to make a select dirty?

I do not think so, as there is no tool or command to do such thing is available. Multi-statements are not part of the view definitions. As the following example demonstrates this as:

set isolation to dirty read;
create view v1 (name,no) as select name, no from tx;

Sysviews catalog table registers only the create syntax and ignores any other preceding sql statements.

Is there a parm I can pass in my SQL to make sure a read is not dirty?

Yes. Set the isolation level and execute the select statement like:

set isolation to committed read;
set lock mode to wait;
select ... from view_name where ...

Regards,
Shriyan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top