Contraint Issue
Posted: Wed 25 Jun 2008 23:47
Hello,
I've got an issue when running a Select statement there the underlying table has primary key constraints.
For example if I have a primary key on Field1, Field2, and Field3 and I write a select statement that returns Field1 and Field2 it error with constrained to be unique. This due to the fact that Field1 and Field2 can have the same value when select if field3 is not included.
My issue is that I just want to select the data, it is ok for contraint not to apply. Is there anyway to turn it off?
The user can enter sql so I can not create a datatable and set all of the rows to unique = false
Is there anything I can do to turn off the constraints?
oCommand.CommandType = CommandType.Text
oCommand.CommandText = tSQL
oCommand.Connection = GProperties.DBSettings.Connection
_objDataTable = New OracleDataTable
With _objDataTable
.Connection = DBSettings.Connection
.ReturnProviderSpecificTypes = False
.SelectCommand = oCommand
.FetchAll = True
.ReadLobMode = ReadLobMode.DefferedCachedDirect
.CachedUpdates = True
.Active = False
.Fill()
End With
I've got an issue when running a Select statement there the underlying table has primary key constraints.
For example if I have a primary key on Field1, Field2, and Field3 and I write a select statement that returns Field1 and Field2 it error with constrained to be unique. This due to the fact that Field1 and Field2 can have the same value when select if field3 is not included.
My issue is that I just want to select the data, it is ok for contraint not to apply. Is there anyway to turn it off?
The user can enter sql so I can not create a datatable and set all of the rows to unique = false
Is there anything I can do to turn off the constraints?
oCommand.CommandType = CommandType.Text
oCommand.CommandText = tSQL
oCommand.Connection = GProperties.DBSettings.Connection
_objDataTable = New OracleDataTable
With _objDataTable
.Connection = DBSettings.Connection
.ReturnProviderSpecificTypes = False
.SelectCommand = oCommand
.FetchAll = True
.ReadLobMode = ReadLobMode.DefferedCachedDirect
.CachedUpdates = True
.Active = False
.Fill()
End With