Hi
I made some patches for better Oracle support
SchemaLoader.TypeMapping.cs.patch adds missing Oracle field types
OracleSchemaLoader.Tables.cs.patch adds selecting from all_views because
all_tab_columns contains columns for both views and tables
OracleSchemaLoader.Columns.cs.patch adds support for interval and timestamp
types and skips nested table columns
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---
--- OracleSchemaLoader.Columns.cs.old 2008-10-30 17:10:45.226738200 +0300
+++ OracleSchemaLoader.Columns.cs 2008-10-30 11:02:06.501181200 +0300
@@ -52,13 +52,23 @@
protected override IList<IDataTableColumn> ReadColumns(IDbConnection connectionString, string databaseName)
{
const string sql = @"
-SELECT owner, table_name, column_name, data_type, data_length, data_precision, data_scale, nullable
+SELECT owner, table_name, column_name,
+ case when data_type like 'TIMESTAMP%' then 'TIMESTAMP'
+ when data_type like 'INTERVAL%' then 'INTERVAL'
+ else data_type
+ end data_type ,
+ data_length, data_precision, data_scale, nullable
FROM all_tab_columns
WHERE table_name NOT LIKE '%$%'
AND table_name NOT LIKE 'LOGMNR%'
AND table_name NOT LIKE 'MVIEW%'
AND table_name NOT IN ('SQLPLUS_PRODUCT_PROFILE','HELP', 'PRODUCT_PRIVS')
- AND lower(owner) = :owner
+ AND owner = upper(:owner)
+ -- skip nested table columns
+ AND data_type_owner is null
ORDER BY table_name, column_id";
return DataCommand.Find<IDataTableColumn>(connectionString, sql, ":owner", databaseName.ToLower(), ReadColumn);
--- OracleSchemaLoader.Tables.cs.old 2008-10-30 17:12:49.379809800 +0300
+++ OracleSchemaLoader.Tables.cs 2008-10-30 09:24:26.279742400 +0300
@@ -41,7 +41,12 @@
WHERE table_name NOT LIKE '%$%'
AND table_name NOT LIKE 'LOGMNR%'
AND table_name NOT IN ('SQLPLUS_PRODUCT_PROFILE','HELP')
-and lower(owner) = :owner";
+and owner = upper(:owner)
+UNION
+SELECT view_name, owner
+FROM all_views
+WHERE owner = upper(:owner)
+";
return DataCommand.Find<IDataName>(connectionString, sql, ":owner", databaseName.ToLower(), ReadDataNameAndSchema);
}
--- SchemaLoader.TypeMapping.cs.old 2008-10-30 11:58:08.191305600 +0300
+++ SchemaLoader.TypeMapping.cs 2008-10-30 12:01:26.936217600 +0300
@@ -98,6 +98,8 @@
case "text":
case "varchar":
case "varchar2":
+ case "clob": // oracle type
+ case "nclob": // oracle type
return typeof(String);
// bool
@@ -140,11 +142,13 @@
case "float":
case "float4":
case "real":
+ case "binary_float": // oracle type
return typeof(Single);
// double
case "double":
case "double precision":
+ case "binary_double": // oracle type
return typeof(Double);
// decimal
@@ -193,6 +197,8 @@
case "oid":
case "sytea":
case "mediumblob":
+ case "raw": // oracle type
+ case "long raw": // oracle type
return typeof(Byte[]);
// PostgreSQL, for example has an uuid type that can be mapped as a Guid