Pascal Craponne wrote:
> SqlMetal replaces invalid characters by underscores ("_"), so maybe 
> DbMetal should do the same.
> If you have a patch, please post it here, we'll commit it.
I've made following patches to have more compatibility with Oracle, they add 
support for some Oracle specific types, for views and for skipping columns 
that can't be represented in C#. It's just a workaround for now, I'm 
thinking how to make it right.


--~--~---------~--~----~------------~-------~--~----~
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 columns with special characters
+    AND column_name not like '%$%'
+    AND column_name not like '%#%'
+    -- 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.Constraints.cs.old	2008-10-30 17:11:53.084376000 +0300
+++ OracleSchemaLoader.Constraints.cs	2008-10-30 11:46:43.599456600 +0300
@@ -112,6 +112,9 @@
 FROM all_cons_columns UCC, all_constraints UC
 WHERE UCC.constraint_name=UC.constraint_name
 AND UCC.table_name=UC.table_name
+-- skip columns with special characters
+AND UCC.column_name not like '%#%'
+AND UCC.column_name not like '%$%'
 AND UCC.TABLE_NAME NOT LIKE '%$%' AND UCC.TABLE_NAME NOT LIKE 'LOGMNR%' AND UCC.TABLE_NAME NOT IN ('HELP','SQLPLUS_PRODUCT_PROFILE')
 AND UC.CONSTRAINT_TYPE!='C'
 and lower(UCC.owner) = :owner";
--- 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

Reply via email to