Esempio n. 1
0
        public QNameManager.QName[] GetResultColumnNames()
        {
            if (this.ResultTable == null)
            {
                return(this._leftQueryExpression.GetResultColumnNames());
            }
            HashMappedList <string, ColumnSchema> columnList = ((TableDerived)this.ResultTable).ColumnList;

            QNameManager.QName[] nameArray2 = new QNameManager.QName[columnList.Size()];
            for (int i = 0; i < nameArray2.Length; i++)
            {
                nameArray2[i] = columnList.Get(i).GetName();
            }
            return(nameArray2);
        }
Esempio n. 2
0
 private HashMappedList <string, ColumnSchema> GetUnionColumns()
 {
     if (this._unionCorresponding || (this._leftQueryExpression == null))
     {
         HashMappedList <string, ColumnSchema> columnList = ((TableDerived)this.ResultTable).ColumnList;
         HashMappedList <string, ColumnSchema> list3      = new HashMappedList <string, ColumnSchema>();
         for (int i = 0; i < this.UnionColumnMap.Length; i++)
         {
             ColumnSchema schema = columnList.Get(i);
             list3.Add(schema.GetName().Name, schema);
         }
         return(list3);
     }
     return(this._leftQueryExpression.GetUnionColumns());
 }
Esempio n. 3
0
        public void WriteData(int l, SqlType[] types, object[] data, HashMappedList <string, ColumnSchema> cols, int[] primaryKeys)
        {
            bool flag = (primaryKeys != null) && (primaryKeys.Length > 0);
            int  num  = flag ? primaryKeys.Length : l;

            for (int i = 0; i < num; i++)
            {
                int     index = flag ? primaryKeys[i] : i;
                object  o     = data[index];
                SqlType t     = types[index];
                if (cols != null)
                {
                    ColumnSchema schema = cols.Get(index);
                    this.WriteFieldPrefix();
                    this.WriteString(schema.GetName().StatementName);
                }
                this.WriteData(t, o);
            }
        }
Esempio n. 4
0
 public void CreateSchema()
 {
     lock (this)
     {
         this._sysLobSession = this._database.sessionManager.GetSysLobSession();
         Stream       manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("LibCore.Resources.lob-schema.sql");
         StreamReader reader = null;
         try
         {
             reader = new StreamReader(manifestResourceStream);
         }
         catch (Exception)
         {
         }
         LineGroupReader reader1 = new LineGroupReader(reader, Starters);
         HashMappedList <string, string> asMap = reader1.GetAsMap();
         reader1.Close();
         string sql    = asMap.Get("/*lob_schema_definition*/");
         Result result = this._sysLobSession.CompileStatement(sql, ResultProperties.DefaultPropsValue).Execute(this._sysLobSession);
         if (result.IsError())
         {
             throw result.GetException();
         }
         this._getLob            = this._sysLobSession.CompileStatement("SELECT * FROM SYSTEM_LOBS.LOB_IDS WHERE LOB_ID = ?", ResultProperties.DefaultPropsValue);
         this._getLobPart        = this._sysLobSession.CompileStatement("SELECT * FROM SYSTEM_LOBS.LOBS WHERE LOB_ID = ? AND BLOCK_OFFSET + BLOCK_COUNT > ? AND BLOCK_OFFSET < ? ORDER BY BLOCK_OFFSET", ResultProperties.DefaultPropsValue);
         this._createLob         = this._sysLobSession.CompileStatement("INSERT INTO SYSTEM_LOBS.LOB_IDS VALUES(?, ?, ?, ?)", ResultProperties.DefaultPropsValue);
         this._createLobPartCall = this._sysLobSession.CompileStatement("CALL SYSTEM_LOBS.ALLOC_BLOCKS(?, ?, ?)", ResultProperties.DefaultPropsValue);
         this._divideLobPartCall = this._sysLobSession.CompileStatement("CALL SYSTEM_LOBS.DIVIDE_BLOCK(?, ?)", ResultProperties.DefaultPropsValue);
         this._deleteLobPartCall = this._sysLobSession.CompileStatement("CALL SYSTEM_LOBS.DELETE_BLOCKS(?,?,?,?)", ResultProperties.DefaultPropsValue);
         this._updateLobLength   = this._sysLobSession.CompileStatement("UPDATE SYSTEM_LOBS.LOB_IDS SET LOB_LENGTH = ? WHERE LOB_ID = ?", ResultProperties.DefaultPropsValue);
         this._updateLobUsage    = this._sysLobSession.CompileStatement("UPDATE SYSTEM_LOBS.LOB_IDS SET LOB_USAGE_COUNT = ? WHERE LOB_ID = ?", ResultProperties.DefaultPropsValue);
         this._getNextLobId      = this._sysLobSession.CompileStatement("VALUES NEXT VALUE FOR SYSTEM_LOBS.LOB_ID", ResultProperties.DefaultPropsValue);
         this._deleteUnusedLobs  = this._sysLobSession.CompileStatement("CALL SYSTEM_LOBS.DELETE_UNUSED()", ResultProperties.DefaultPropsValue);
         this._getLobCount       = this._sysLobSession.CompileStatement("SELECT COUNT(*) FROM SYSTEM_LOBS.LOB_IDS", ResultProperties.DefaultPropsValue);
     }
 }