Esempio n. 1
0
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");

            switch (columnTag)
            {
            case MetadataSourceColumnTag.CATALOG_NAME:
            {
                out_data = m_Tables[m_Current].Catalog;
                return(false);
            }

            case MetadataSourceColumnTag.SCHEMA_NAME:
            {
                out_data = m_Tables[m_Current].Schema;
                return(false);
            }

            case MetadataSourceColumnTag.TABLE_NAME:
            {
                out_data = m_Tables[m_Current].Table;
                return(false);
            }

            case MetadataSourceColumnTag.TABLE_TYPE:
            {
                out_data = m_Tables[m_Current].TableType;
                return(false);
            }

            case MetadataSourceColumnTag.REMARKS:
            {
                out_data = m_Tables[m_Current].Remarks;
                return(false);
            }

            default:
            {
                throw ExceptionBuilder.CreateException(
                          "Column Metadata Not Found",
                          columnTag.ToString());
            }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");

            switch (columnTag)
            {
            case MetadataSourceColumnTag.SCHEMA_NAME:
            {
                out_data = Driver.B_SCHEMA;
                return(false);
            }

            default:
            {
                throw ExceptionBuilder.CreateException(
                          "Column Not Found",
                          columnTag.ToString());
            }
            }
        }
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");
            switch (columnTag)
            {
                case MetadataSourceColumnTag.DATA_TYPE_NAME:
                {
                    out_data = m_DataTypes[m_Current].TypeName;
                    return false;
                }

                case MetadataSourceColumnTag.DATA_TYPE:
                {
                    out_data = (short)m_DataTypes[m_Current].DataType;
                    return false;
                }

                case MetadataSourceColumnTag.COLUMN_SIZE:
                {
                    out_data = m_DataTypes[m_Current].ColumnSize;
                    return false;
                }

                case MetadataSourceColumnTag.LITERAL_PREFIX:
                {
                    out_data = m_DataTypes[m_Current].LiteralPrefix;
                    return false;
                }

                case MetadataSourceColumnTag.LITERAL_SUFFIX:
                {
                    out_data = m_DataTypes[m_Current].LiteralSuffix;
                    return false;
                }

                case MetadataSourceColumnTag.CREATE_PARAM:
                {
                    out_data = m_DataTypes[m_Current].CreateParams;
                    return false;
                }

                case MetadataSourceColumnTag.NULLABLE:
                {
                    out_data = (short)m_DataTypes[m_Current].Nullable;
                    return false;
                }

                case MetadataSourceColumnTag.CASE_SENSITIVE:
                {
                    out_data = (short)(m_DataTypes[m_Current].CaseSensitive ? 1 : 0);
                    return false;
                }

                case MetadataSourceColumnTag.SEARCHABLE:
                {
                    out_data = (short)m_DataTypes[m_Current].Searchable;
                    return false;
                }

                case MetadataSourceColumnTag.UNSIGNED_ATTRIBUTE:
                {
                    out_data = (short)(m_DataTypes[m_Current].UnsignedAttr ? 1 : 0);
                    return false;
                }

                case MetadataSourceColumnTag.FIXED_PREC_SCALE:
                {
                    out_data = m_DataTypes[m_Current].FixedPrecScale;
                    return false;
                }

                case MetadataSourceColumnTag.AUTO_UNIQUE:
                {
                    out_data = (short)(m_DataTypes[m_Current].AutoUnique ? 1 : 0);
                    return false;
                }
                    
                case MetadataSourceColumnTag.LOCAL_TYPE_NAME:
                {
                    out_data = m_DataTypes[m_Current].TypeName;
                    return false;
                }

                case MetadataSourceColumnTag.MINIMUM_SCALE:
                {
                    out_data = m_DataTypes[m_Current].MinScale;
                    return false;
                }
                    
                case MetadataSourceColumnTag.MAXIMUM_SCALE:
                {
                    out_data = m_DataTypes[m_Current].MaxScale;
                    return false;
                }
                    
                case MetadataSourceColumnTag.SQL_DATA_TYPE:
                {
                    out_data = (short)m_DataTypes[m_Current].SqlDataType;
                    return false;
                }
                    
                case MetadataSourceColumnTag.SQL_DATETIME_SUB:
                {
                    out_data = m_DataTypes[m_Current].SqlDatetimeSub;
                    return false;
                }
                    
                case MetadataSourceColumnTag.NUM_PREC_RADIX:
                {
                    out_data = m_DataTypes[m_Current].NumPrecRadix;
                    return false;
                }

                case MetadataSourceColumnTag.INTERVAL_PRECISION:
                {
                    out_data = m_DataTypes[m_Current].IntervalPrecision;
                    return false;
                }

                case MetadataSourceColumnTag.USER_DATA_TYPE:
                {
                    out_data = Simba.DotNetDSI.Constants.UDT_STANDARD_SQL_TYPE;
                    return false;
                }

                default:
                {
                    throw ExceptionBuilder.CreateException(
                        "Column Not Found",
                        columnTag.ToString());
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");
            switch (columnTag)
            {
            case MetadataSourceColumnTag.CATALOG_NAME:
            {
                out_data = m_Columns[m_Current].m_TableCatalog;
                return(false);
            }

            case MetadataSourceColumnTag.SCHEMA_NAME:
            {
                out_data = m_Columns[m_Current].m_TableSchema;
                return(false);
            }

            case MetadataSourceColumnTag.TABLE_NAME:
            {
                out_data = m_Columns[m_Current].m_TableName;
                return(false);
            }

            case MetadataSourceColumnTag.COLUMN_NAME:
            {
                out_data = m_Columns[m_Current].m_ColumnName;
                return(false);
            }

            case MetadataSourceColumnTag.DATA_TYPE:
            {
                out_data = (short)m_Columns[m_Current].m_DataType;
                return(false);
            }

            case MetadataSourceColumnTag.DATA_TYPE_NAME:
            {
                out_data = TypeUtilities.GetTypeName(m_Columns[m_Current].m_DataType).Substring(4);
                return(false);
            }

            case MetadataSourceColumnTag.COLUMN_SIZE:
            {
                out_data = m_Columns[m_Current].m_ColumnSize;
                return(false);
            }

            case MetadataSourceColumnTag.BUFFER_LENGTH:
            {
                out_data = m_Columns[m_Current].m_BufferLength;
                return(false);
            }

            case MetadataSourceColumnTag.DECIMAL_DIGITS:
            {
                out_data = m_Columns[m_Current].m_DecimalDigits;
                return(false);
            }

            case MetadataSourceColumnTag.NUM_PREC_RADIX:
            {
                SqlType sqlType = m_Columns[m_Current].m_DataType;

                if (TypeUtilities.IsExactNumericType(sqlType) ||
                    TypeUtilities.IsIntegerType(sqlType) ||
                    TypeUtilities.IsApproximateNumericType(sqlType))
                {
                    out_data = (short)10;
                }
                else
                {
                    out_data = null;
                }

                return(false);
            }

            case MetadataSourceColumnTag.NULLABLE:
            {
                out_data = (short)m_Columns[m_Current].m_Nullable;
                return(false);
            }

            case MetadataSourceColumnTag.REMARKS:
            {
                out_data = m_Columns[m_Current].m_Remarks;
                return(false);
            }

            case MetadataSourceColumnTag.COLUMN_DEF:
            {
                out_data = m_Columns[m_Current].m_ColumnDef;
                return(false);
            }

            case MetadataSourceColumnTag.SQL_DATA_TYPE:
            {
                out_data = (short)TypeUtilities.GetVerboseTypeFromConciseType(
                    m_Columns[m_Current].m_DataType);
                return(false);
            }

            case MetadataSourceColumnTag.SQL_DATETIME_SUB:
            {
                short dateTimeSub = TypeUtilities.GetIntervalCodeFromConciseType(
                    m_Columns[m_Current].m_DataType);

                if (0 == dateTimeSub)
                {
                    out_data = null;
                }
                else
                {
                    out_data = dateTimeSub;
                }

                return(false);
            }

            case MetadataSourceColumnTag.CHAR_OCTET_LENGTH:
            {
                if (TypeUtilities.IsCharacterOrBinaryType(m_Columns[m_Current].m_DataType))
                {
                    out_data = m_Columns[m_Current].m_CharOctetLength;
                }
                else
                {
                    out_data = null;
                }

                return(false);
            }

            case MetadataSourceColumnTag.ORDINAL_POSITION:
            {
                out_data = m_Current + 1;
                return(false);
            }

            case MetadataSourceColumnTag.IS_NULLABLE:
            {
                if (Nullability.Nullable == m_Columns[m_Current].m_Nullable)
                {
                    out_data = "YES";
                }
                else
                {
                    out_data = "NO";
                }

                return(false);
            }

            case MetadataSourceColumnTag.USER_DATA_TYPE:
            {
                out_data = Simba.DotNetDSI.Constants.UDT_STANDARD_SQL_TYPE;
                return(false);
            }

            default:
            {
                throw ExceptionBuilder.CreateException(
                          "Column Not Found",
                          columnTag.ToString());
            }
            }
        }
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");

            switch (columnTag)
            {
                case MetadataSourceColumnTag.CATALOG_NAME:
                {
                    out_data = m_Catalogs[m_Current];
                    return false;
                }

                default:
                {
                    throw ExceptionBuilder.CreateException(
                        "Column Not Found",
                        columnTag.ToString());
                }
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");

            switch (columnTag)
            {
                case MetadataSourceColumnTag.CATALOG_NAME:
                {
                    out_data = m_Tables[m_Current].Catalog;
                    return false;
                }

                case MetadataSourceColumnTag.SCHEMA_NAME:
                {
                    out_data = m_Tables[m_Current].Schema;
                    return false;
                }

                case MetadataSourceColumnTag.TABLE_NAME:
                {
                    out_data = m_Tables[m_Current].Table;
                    return false;
                }

                case MetadataSourceColumnTag.TABLE_TYPE:
                {
                    out_data = m_Tables[m_Current].TableType;
                    return false;
                }

                case MetadataSourceColumnTag.REMARKS:
                {
                    out_data = m_Tables[m_Current].Remarks;
                    return false;
                }

                default:
                {
                    throw ExceptionBuilder.CreateException(
                        "Column Metadata Not Found",
                        columnTag.ToString());
                }
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");
            switch (columnTag)
            {
            case MetadataSourceColumnTag.DATA_TYPE_NAME:
            {
                out_data = m_DataTypes[m_Current].TypeName;
                return(false);
            }

            case MetadataSourceColumnTag.DATA_TYPE:
            {
                out_data = (short)m_DataTypes[m_Current].DataType;
                return(false);
            }

            case MetadataSourceColumnTag.COLUMN_SIZE:
            {
                out_data = m_DataTypes[m_Current].ColumnSize;
                return(false);
            }

            case MetadataSourceColumnTag.LITERAL_PREFIX:
            {
                out_data = m_DataTypes[m_Current].LiteralPrefix;
                return(false);
            }

            case MetadataSourceColumnTag.LITERAL_SUFFIX:
            {
                out_data = m_DataTypes[m_Current].LiteralSuffix;
                return(false);
            }

            case MetadataSourceColumnTag.CREATE_PARAM:
            {
                out_data = m_DataTypes[m_Current].CreateParams;
                return(false);
            }

            case MetadataSourceColumnTag.NULLABLE:
            {
                out_data = (short)m_DataTypes[m_Current].Nullable;
                return(false);
            }

            case MetadataSourceColumnTag.CASE_SENSITIVE:
            {
                out_data = (short)(m_DataTypes[m_Current].CaseSensitive ? 1 : 0);
                return(false);
            }

            case MetadataSourceColumnTag.SEARCHABLE:
            {
                out_data = (short)m_DataTypes[m_Current].Searchable;
                return(false);
            }

            case MetadataSourceColumnTag.UNSIGNED_ATTRIBUTE:
            {
                out_data = (short)(m_DataTypes[m_Current].UnsignedAttr ? 1 : 0);
                return(false);
            }

            case MetadataSourceColumnTag.FIXED_PREC_SCALE:
            {
                out_data = m_DataTypes[m_Current].FixedPrecScale;
                return(false);
            }

            case MetadataSourceColumnTag.AUTO_UNIQUE:
            {
                out_data = (short)(m_DataTypes[m_Current].AutoUnique ? 1 : 0);
                return(false);
            }

            case MetadataSourceColumnTag.LOCAL_TYPE_NAME:
            {
                out_data = m_DataTypes[m_Current].TypeName;
                return(false);
            }

            case MetadataSourceColumnTag.MINIMUM_SCALE:
            {
                out_data = m_DataTypes[m_Current].MinScale;
                return(false);
            }

            case MetadataSourceColumnTag.MAXIMUM_SCALE:
            {
                out_data = m_DataTypes[m_Current].MaxScale;
                return(false);
            }

            case MetadataSourceColumnTag.SQL_DATA_TYPE:
            {
                out_data = (short)m_DataTypes[m_Current].SqlDataType;
                return(false);
            }

            case MetadataSourceColumnTag.SQL_DATETIME_SUB:
            {
                out_data = m_DataTypes[m_Current].SqlDatetimeSub;
                return(false);
            }

            case MetadataSourceColumnTag.NUM_PREC_RADIX:
            {
                out_data = m_DataTypes[m_Current].NumPrecRadix;
                return(false);
            }

            case MetadataSourceColumnTag.INTERVAL_PRECISION:
            {
                out_data = m_DataTypes[m_Current].IntervalPrecision;
                return(false);
            }

            case MetadataSourceColumnTag.USER_DATA_TYPE:
            {
                out_data = Simba.DotNetDSI.Constants.UDT_STANDARD_SQL_TYPE;
                return(false);
            }

            default:
            {
                throw ExceptionBuilder.CreateException(
                          "Column Not Found",
                          columnTag.ToString());
            }
            }
        }
        /// <summary>
        /// Fills in out_data with the data for a given column in the current row.
        /// </summary>
        /// <param name="columnTag">The column to retrieve data from.</param>
        /// <param name="offset">The number of bytes in the data to skip before copying.</param>
        /// <param name="maxSize">The maximum number of bytes of data to return.</param>
        /// <param name="out_data">The data to be returned.</param>
        /// <returns>True if there is more data in the column; false otherwise.</returns>
        public bool GetMetadata(
            MetadataSourceColumnTag columnTag,
            long offset,
            long maxSize,
            out object out_data)
        {
            LogUtilities.LogFunctionEntrance(Log, columnTag, offset, maxSize, "out_data");
            switch (columnTag)
            {
                case MetadataSourceColumnTag.CATALOG_NAME:
                {
                    out_data = m_Columns[m_Current].m_TableCatalog;
                    return false;
                }

                case MetadataSourceColumnTag.SCHEMA_NAME:
                {
                    out_data = m_Columns[m_Current].m_TableSchema;
                    return false;
                }

                case MetadataSourceColumnTag.TABLE_NAME:
                {
                    out_data = m_Columns[m_Current].m_TableName;
                    return false;
                }

                case MetadataSourceColumnTag.COLUMN_NAME:
                {
                    out_data = m_Columns[m_Current].m_ColumnName;
                    return false;
                }

                case MetadataSourceColumnTag.DATA_TYPE:
                {
                    out_data = (short)m_Columns[m_Current].m_DataType;
                    return false;
                }

                case MetadataSourceColumnTag.DATA_TYPE_NAME:
                {
                    out_data = TypeUtilities.GetTypeName(m_Columns[m_Current].m_DataType).Substring(4);
                    return false;
                }

                case MetadataSourceColumnTag.COLUMN_SIZE:
                {
                    out_data = m_Columns[m_Current].m_ColumnSize;
                    return false;
                }

                case MetadataSourceColumnTag.BUFFER_LENGTH:
                {
                    out_data = m_Columns[m_Current].m_BufferLength;
                    return false;
                }

                case MetadataSourceColumnTag.DECIMAL_DIGITS:
                {
                    out_data = m_Columns[m_Current].m_DecimalDigits;
                    return false;
                }

                case MetadataSourceColumnTag.NUM_PREC_RADIX:
                {
                    SqlType sqlType = m_Columns[m_Current].m_DataType;

                    if (TypeUtilities.IsExactNumericType(sqlType) ||
                        TypeUtilities.IsIntegerType(sqlType) ||
                        TypeUtilities.IsApproximateNumericType(sqlType))
                    {
                        out_data = (short)10;
                    }
                    else
                    {
                        out_data = null;
                    }

                    return false;
                }

                case MetadataSourceColumnTag.NULLABLE:
                {
                    out_data = (short)m_Columns[m_Current].m_Nullable;
                    return false;
                }

                case MetadataSourceColumnTag.REMARKS:
                {
                    out_data = m_Columns[m_Current].m_Remarks;
                    return false;
                }

                case MetadataSourceColumnTag.COLUMN_DEF:
                {
                    out_data = m_Columns[m_Current].m_ColumnDef;
                    return false;
                }

                case MetadataSourceColumnTag.SQL_DATA_TYPE:
                {
                    out_data = (short)TypeUtilities.GetVerboseTypeFromConciseType(
                        m_Columns[m_Current].m_DataType);
                    return false;
                }

                case MetadataSourceColumnTag.SQL_DATETIME_SUB:
                {
                    short dateTimeSub = TypeUtilities.GetIntervalCodeFromConciseType(
                        m_Columns[m_Current].m_DataType);

                    if (0 == dateTimeSub)
                    {
                        out_data = null;
                    }
                    else
                    {
                        out_data = dateTimeSub;
                    }

                    return false;
                }

                case MetadataSourceColumnTag.CHAR_OCTET_LENGTH:
                {
                    if (TypeUtilities.IsCharacterOrBinaryType(m_Columns[m_Current].m_DataType))
                    {
                        out_data = m_Columns[m_Current].m_CharOctetLength;
                    }
                    else
                    {
                        out_data = null;
                    }

                    return false;
                }

                case MetadataSourceColumnTag.ORDINAL_POSITION:
                {
                    out_data = m_Current + 1;
                    return false;
                }

                case MetadataSourceColumnTag.IS_NULLABLE:
                {
                    if (Nullability.Nullable == m_Columns[m_Current].m_Nullable)
                    {
                        out_data = "YES";
                    }
                    else
                    {
                        out_data = "NO";
                    }

                    return false;
                }

                case MetadataSourceColumnTag.USER_DATA_TYPE:
                {
                    out_data = Simba.DotNetDSI.Constants.UDT_STANDARD_SQL_TYPE;
                    return false;
                }

                default:
                {
                    throw ExceptionBuilder.CreateException(
                        "Column Not Found",
                        columnTag.ToString());
                }
            }
        }