Example #1
0
 protected override string GetFieldLiteralNull(DbType?coerce, int coerced_size)
 {
     /* [dlatikay 20091203] must coerce a NULL to the correct data type i
      * MSSQL, otherwise unions of views would fail when one has e.g.
      * NULL AS Lastname, while another one has [Name] AS Lastname */
     if (coerce.HasValue)
     {
         typedesignator td           = new syntaxfactory((db as ddl).Provider).GenerateTypedesignator;
         string         coerced_type = td.Complete(coerce.Value, coerced_size, false);
         return(String.Format("convert({0},NULL)", coerced_type));
     }
     else
     {
         return("NULL");
     }
 }
Example #2
0
 protected override string GetFieldLiteralNull(DbType?coerce, int coerced_size)
 {
     /* [pkosec>dlatikay 20140911] must coerce a NULL to the correct data type als for oracle
      * previously we were convinced that this was not neccessary. It isn't, but for LOBs....
      * [dlatikay 20150716] found that it is absolutely necessary for VIEWS with UNIONs, for example vwnav02MenuLocation! */
     if (coerce.HasValue)
     {
         if (coerce.Value == DbType.String)
         {
             return("TO_NCLOB(NULL)");
         }
         else
         {
             var    td           = new syntaxfactory((db as ddl).Provider).GenerateTypedesignator;
             string coerced_type = td.Complete(coerce.Value, coerced_size, false);
             return(String.Format("CAST(NULL AS {0})", coerced_type));
         }
     }
     else
     {
         return("NULL");
     }
 }