Exemplo n.º 1
0
        private EfzTypeBase GetEfzTypeString(DbTypeString type)
        {
            EfzTypeCharacter res;

            if (type.GetSpecificAttribute("effiproz", "subtype") == "uniqueidentifier")
            {
                return(new EfzTypeUniqueIdentifier());
            }

            if (type.GetSpecificAttribute("effiproz", "subtype") == "varchar2")
            {
                res = new EfzTypeVarChar2();
            }
            else if (type.IsVarLength)
            {
                if (type.IsBinary)
                {
                    res = new EfzTypeVarBinary();
                }
                else
                {
                    res = new EfzTypeVarChar();
                }
            }
            else
            {
                if (type.IsBinary)
                {
                    res = new EfzTypeBinary();
                }
                else
                {
                    res = new EfzTypeChar();
                }
            }
            res.Length = type.Length;
            return(res);
        }
Exemplo n.º 2
0
        private EfzTypeBase MakeSpecificEfzType(string dt, int size, int digits)
        {
            switch (dt)
            {
            case "BOOLEAN":
            case "BIT":
                return(new EfzTypeBoolean());

            case "TINYINT":
                return(new EfzTypeTinyInt());

            case "SMALLINT":
                return(new EfzTypeSmallInt());

            case "INT":
            case "INTEGER":
                return(new EfzTypeInt());

            case "BIGINT":
                return(new EfzTypeBigInt());

            case "CHAR":
            case "NCHAR":
            case "CHARACTER":
            case "VARCHAR_IGNORECASE":
            {
                var res = new EfzTypeChar();
                res.Length = size;
                return(res);
            }

            case "VARCHAR":
            case "NVARCHAR":
            case "CHARACTER VARYING":
            {
                var res = new EfzTypeVarChar();
                res.Length = size;
                return(res);
            }

            case "NVARCHAR2":
            case "VARCHAR2":
            {
                var res = new EfzTypeVarChar2();
                res.Length = size;
                return(res);
            }

            case "BINARY":
            {
                var res = new EfzTypeBinary();
                res.Length = size;
                return(res);
            }

            case "VARBINARY":
            {
                var res = new EfzTypeVarBinary();
                res.Length = size;
                return(res);
            }

            case "DECIMAL":
            case "NUMERIC":
            case "NUMBER":
            {
                var res = new EfzTypeNumber();
                res.Precision = size;
                res.Scale     = digits;
                return(res);
            }

            case "TIMESTAMP":
            case "TIME":
            {
                var res = new EfzTypeTimestamp();
                return(res);
            }

            case "DATETIME":
            case "DATE":
            {
                var res = new EfzTypeDate();
                return(res);
            }

            case "TIMESTAMP WITH TIMEZONE":
            {
                var res = new EfzTypeTimestampTz();
                return(res);
            }

            case "UNIQUEIDENTIFIER":
            {
                var res = new EfzTypeUniqueIdentifier();
                return(res);
            }

            case "DOUBLE":
            {
                var res = new EfzTypeDouble();
                return(res);
            }

            case "CLOB":
            {
                var res = new EfzTypeClob();
                res.MaxBytes = size;
                return(res);
            }

            case "BLOB":
            {
                var res = new EfzTypeBlob();
                res.MaxBytes = size;
                return(res);
            }
            }
            ReportUnknownType(dt);
            return(new EfzTypeGeneric {
                Sql = dt
            });
        }