Windows Oracle Data Access Components (MOSC)

MOSC Banner

ODP.NET fails to find primary key on views with UNION operator

edited Nov 1, 2013 4:34AM in Windows Oracle Data Access Components (MOSC) 6 commentsAnswered

Colleagues,

Apologies if this issue is already known; I was unable to find anything pertaining to it in my researches.

The ODP.NET OracleDataAdapter.FillSchema() method populates a DataTable object with the schema of an Oracle view or table.  Unfortunately, it fails to transfer the primary keys of some views, particularly those with the UNION operator in their definition.  Given the following table and view based on it, ODP.NET for 11.2 returns a zero-length array of primary key columns for the view when a DataTable is created from it.  I include source code in C# and SQL that demonstrates the problem.  When run on the PRIMARYKEYFAILURE_V view, the code demonstrates that the primary key columns are found in the data dictionary, but

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center