Patent ID: 7370049

Claim:
A method for detecting conflicts in nested database statements, the method comprising: associating one or more table access data structures with one or more nested statements within a parent statement at compile time, each of the one or more table access data structures having an associated nested statement, identifying one or more tables accessed by the associated nested statement, and indicating one or more access modes for each of the one or more tables accessed by the associated nested statement; maintaining a list of tables data structure for the parent statement at runtime, the list of tables data structure identifying one or more tables accessed by the parent statement or the one or more nested statements and indicating one or more table access scopes and one or more access modes for each of the one or more tables accessed by the parent statement or the one or more nested statements, each table access scope being identified by a value, the value of a table access scope defined for the parent statement being a default value, the value of each table access scope defined after the table access scope for the parent statement is defined being based on the value of a previously defined table access scope; prior to execution of one of the one or more nested statements, comparing the table access data structure associated with the one nested statement to the list of tables data structure to determine whether there is a conflict between the one nested statement and the parent statement, or the one nested statement and a different nested statement, wherein in response to no conflict being detected and at least one of the one or more tables identified in the table access data structure associated with the one nested statement being found in the list of tables data structure, updating the one or more access modes of the at least one table in the list of tables data structure when a table access scope of the one nested statement matches one of the one or more table access scopes indicated in the list of tables data structure for the at least one table; and updating the one or more table access scopes of the at least one table in the list of tables data structure when a table access scope of the one nested statement does not match the one or more table access scopes indicated in the list of tables data structure for the at least one table.