kmcbrearty
asked on
ODP.NET Default Column Values
We are trying to migrate from System.Data.OracleClient to the Managed ODP.NET (4.121.1.20131211) data provider. The main issue that we are having at the moment is we are unable to load the default column values from the database. With System.Data.OracleClient this happened when calling OracleDataAdapter.FillSche ma(). Unfortunately, it doesn't appear that Oracle implemented the logic the same as Microsoft and I can find much information on possible workarounds.
For my purposes I believe that if I manually set the default value on the column that my problem will be solved. I was considering running the following schema query:
My issue is that I am not sure how I can easily take the value that I get from the query and convert it to the value that should be used to set the default column value in all cases. Can anyone help point me in the right direction?
For my purposes I believe that if I manually set the default value on the column that my problem will be solved. I was considering running the following schema query:
SELECT TABLE_NAME, COLUMN_NAME, DATA_DEFAULT
FROM USER_TAB_COLUMNS
WHERE data_default IS NOT NULL AND TABLE_NAME = 'MY_TABLE'
My issue is that I am not sure how I can easily take the value that I get from the query and convert it to the value that should be used to set the default column value in all cases. Can anyone help point me in the right direction?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I included the information on how the problem was actually solved.
You Can Solve Your Problem by calling Stored Procedures this way... "begin yourStoredProce(param);end
NOTE: COMMAND TYPE IS TEXT NOT STORED pROCEDURE
OracleCommand cmd = new OracleCommand("begin U_50004REG_REPORTS.USRUNI1
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
Hope this helps