Exemplo n.º 1
0
 public override bool addInput(Vid_Object obj, int index)
 {
     if (obj.output_dataType == VidData_Type.DATABASE_COL)
     {
         Vid_DB_Col colnode = (Vid_DB_Col)obj;
         bool       b       = inputs.setInput_atIndex(obj, index);
         return(b);
     }
     return(false);
 }
Exemplo n.º 2
0
    public override string ToString()
    {
        StringBuilder sb = new StringBuilder("ORDER BY ");

        for (int i = 0; i < inputs.getSize(); i++)
        {
            Vid_DB_Col obj = (Vid_DB_Col)inputs.getInput_atIndex(i);
            if (obj != null)
            {
                sb.Append(obj.colName);
                if (isDesc[i])
                {
                    sb.Append(" DESC");
                }
                if (i < inputs.getSize() - 1)
                {
                    sb.Append(", ");
                }
            }
        }
        return(sb.ToString());
    }
Exemplo n.º 3
0
    public override string ToString()
    {
        StringBuilder sb  = new StringBuilder();
        Vid_DB_Col    col = (Vid_DB_Col)inputs.getInput_atIndex(0);

        if (col != null)
        {
            switch (col.type)
            {
            case MySql_colTypes.MYSQL_INT:
                sb.Append(TabTool.TabCount() + col.ToString() + " int ");
                if (notNull)
                {
                    sb.Append("NOT NULL ");
                }
                if (defaultValue)
                {
                    sb.Append("DEFAULT ");
                    if (inputs.getInput_atIndex(1) != null)
                    {
                        sb.Append(inputs.getInput_atIndex(1).ToString());
                    }
                }
                else if (doAutoIncrement)
                {
                    sb.Append("AUTO_INCREMENT ");
                }
                break;

            case MySql_colTypes.MYSQL_FLOAT:
                sb.Append(TabTool.TabCount() + col.ToString() + " float ");
                if (notNull)
                {
                    sb.Append("NOT NULL ");
                }
                if (defaultValue)
                {
                    sb.Append("DEFAULT ");
                    if (inputs.getInput_atIndex(1) != null)
                    {
                        sb.Append(inputs.getInput_atIndex(1).ToString());
                    }
                }
                else if (doAutoIncrement)
                {
                    sb.Append("AUTO_INCREMENT ");
                }
                break;

            case MySql_colTypes.MYSQL_DOUBLE:
                sb.Append(TabTool.TabCount() + col.ToString() + " double ");
                if (notNull)
                {
                    sb.Append("NOT NULL ");
                }
                if (defaultValue)
                {
                    sb.Append("DEFAULT ");
                    if (inputs.getInput_atIndex(1) != null)
                    {
                        sb.Append(inputs.getInput_atIndex(1).ToString());
                    }
                }
                else if (doAutoIncrement)
                {
                    sb.Append("AUTO_INCREMENT ");
                }
                break;

            case MySql_colTypes.MYSQL_VARCHAR:
                sb.Append(TabTool.TabCount() + col.ToString() + " varchar(255) ");
                if (notNull)
                {
                    sb.Append("NOT NULL ");
                }
                if (defaultValue)
                {
                    sb.Append("DEFAULT ");
                }
                break;

            case MySql_colTypes.MYSQL_BLOB:
                sb.Append(TabTool.TabCount() + col.ToString() + " BLOB ");
                break;

            case MySql_colTypes.MYSQL_TIMESTAMP:
                sb.Append(TabTool.TabCount() + col.ToString() + " timestamp ");
                break;
            }
        }
        return(sb.ToString());
    }
Exemplo n.º 4
0
 public void setCol(Vid_DB_Col col)
 {
     this.col = col;
 }