Ejemplo n.º 1
0
 public ExplainPlanModelInternal(string statementText, string executionPlanKey, OracleObjectIdentifier targetTableIdentifier)
 {
     StatementText    = statementText;
     ExecutionPlanKey = executionPlanKey;
     TargetTableName  = targetTableIdentifier.ToString();
 }
Ejemplo n.º 2
0
		private static string BuildQualifiedColumnLabel(OracleObjectIdentifier columnOwner, string columnName, bool applyFormatting)
		{
			var prefix = String.IsNullOrEmpty(columnOwner.Name) ? null : $"{(applyFormatting ? columnOwner.ToFormattedString() : columnOwner.ToString())}.";
			columnName = columnName.ToSimpleIdentifier();
			if (applyFormatting)
			{
				var formatOption = OracleConfiguration.Configuration.Formatter.FormatOptions.Identifier;
				columnName = OracleStatementFormatter.FormatTerminalValue(columnName, formatOption);
			}

			return $"{prefix}{columnName}";
		}
Ejemplo n.º 3
0
        public static Type MapOracleTypeToNetType(OracleObjectIdentifier typeIdentifier)
        {
            var targetType = typeof(string);

            switch (typeIdentifier.ToString().Trim('"'))
            {
            case "NUMBER":
            case "INTEGER":
            case "DECIMAL":
                targetType = typeof(OracleDecimal);
                break;

            case "DATE":
                targetType = typeof(DateTime?);
                break;

            case "CLOB":
            case "NCLOB":
                targetType = typeof(OracleClob);
                break;

            case "BLOB":
                targetType = typeof(OracleBlob);
                break;

            case "RAW":
            case "LONG RAW":
                targetType = typeof(OracleBinary);
                break;

            case "BFILE":
                targetType = typeof(OracleBFile);
                break;

            case "BINARY_DOUBLE":
            case "DOUBLE PRECISION":
            case "BINARY_FLOAT":
            case "SIGNED BINARY INTEGER(8)":
            case "SIGNED BINARY INTEGER(32)":
            case "UNSIGNED BINARY INTEGER(16)":
            case "UNSIGNED BINARY INTEGER(32)":
                targetType = typeof(decimal?);
                break;

            case "TIMESTAMP":
                targetType = typeof(OracleTimeStamp);
                break;

            case "TIMESTAMP WITH TZ":
                targetType = typeof(OracleTimeStampTZ);
                break;

            case "TIMESTAMP WITH LOCAL TZ":
                targetType = typeof(OracleTimeStampLTZ);
                break;

            case "INTERVAL YEAR TO MONTH":
                targetType = typeof(OracleIntervalYM);
                break;

            case "INTERVAL DAY TO SECOND":
                targetType = typeof(OracleIntervalDS);
                break;

            case "CONTIGUOUS ARRAY":
            case "CANONICAL":
            case "REF":
                targetType = typeof(object);
                break;
            }

            return(targetType);
        }