Exemplo n.º 1
0
        internal DbDataReader GetDataReaderFromStoredProcedure()
        {
            //int totalTupleNumber = con.Stream.RequestMoveCursor(handle, 0, CursorOrigin.CURSOR_SET);
            //Console.WriteLine(totalTupleNumber);
            con.Stream.RequestFetch(handle);
            int tupleCount = con.Stream.ReadInt();

            cursor = new CubridDataReader(this, handle, resultCount, columnInfos, tupleCount);
            return(cursor);
        }
Exemplo n.º 2
0
        internal void ExecuteInternal()
        {
            if (parameters != null && IsAllParameterBound() == false)
            {
                throw new CubridException("All parameters are not bound.");
            }

            CubridStream stream = con.Stream;

            byte[] paramModes = null;
            byte   fetchFlag  = 0;

            if (statementType == CubridStatementype.CallStoredProcedure && parameters != null)
            {
                paramModes = new byte[parameters.Length];
                for (int i = 0; i < parameters.Length; i++)
                {
                    paramModes[i] = (byte)parameters[i].Direction;
                }
            }

            if (statementType == CubridStatementype.Select)
            {
                fetchFlag = 1;
            }

            int totalTupleCount = stream.RequestExecute(handle, ExecutionOption.Normal, parameters,
                                                        paramModes, fetchFlag, con.AutoCommit);

            cache_reusable = stream.ReadByte();
            resultCount    = stream.ReadInt();

            Debug.WriteLine("cache_reusable = {0}" + cache_reusable);
            Debug.WriteLine("resultCount = {0}" + resultCount);

            resultInfos = stream.ReadResultInfo(resultCount);

            if (statementType == CubridStatementype.Select)
            {
                int fetchCode  = stream.ReadInt();
                int tupleCount = stream.ReadInt();
                cursor = new CubridDataReader(this, handle, totalTupleCount, columnInfos, tupleCount);
            }
        }
Exemplo n.º 3
0
        internal bool NextResult()
        {
            CubridStream stream = con.Stream;

            int totalTupleCount = stream.RequestNextResult(handle);

            CubridStatementype commandTypeIs = (CubridStatementype)stream.ReadByte();
            bool isUpdatable  = (stream.ReadByte() == 1) ? true : false;
            int  columnNumber = stream.ReadInt();

            columnInfos = stream.ReadColumnInfo(columnNumber);


            if (commandTypeIs == CubridStatementype.Select)
            {
                cursor = new CubridDataReader(this, handle, totalTupleCount, columnInfos);
            }

            return(true);
        }
Exemplo n.º 4
0
        internal bool NextResult()
        {
            CubridStream stream = con.Stream;

            int totalTupleCount = stream.RequestNextResult(handle);

            CubridStatementype commandTypeIs = (CubridStatementype)stream.ReadByte();
            bool isUpdatable = (stream.ReadByte() == 1) ? true : false;
            int columnNumber = stream.ReadInt();
            columnInfos = stream.ReadColumnInfo(columnNumber);

            if (commandTypeIs == CubridStatementype.Select)
            {
                cursor = new CubridDataReader(this, handle, totalTupleCount, columnInfos);
            }

            return true;
        }
Exemplo n.º 5
0
        internal DbDataReader GetDataReaderFromStoredProcedure()
        {
            //int totalTupleNumber = con.Stream.RequestMoveCursor(handle, 0, CursorOrigin.CURSOR_SET);
            //Console.WriteLine(totalTupleNumber);
            con.Stream.RequestFetch(handle);
            int tupleCount = con.Stream.ReadInt();

            cursor = new CubridDataReader(this, handle, resultCount, columnInfos, tupleCount);
            return cursor;
        }
Exemplo n.º 6
0
        internal void ExecuteInternal()
        {
            if (parameters != null && IsAllParameterBound() == false)
            {
                throw new CubridException("All parameters are not bound.");
            }

            CubridStream stream = con.Stream;
            byte[] paramModes = null;
            byte fetchFlag = 0;

            if (statementType == CubridStatementype.CallStoredProcedure && parameters != null)
            {
                paramModes = new byte[parameters.Length];
                    for (int i = 0; i < parameters.Length; i++)
                    {
                        paramModes[i] = (byte) parameters[i].Direction;
                    }
            }

            if (statementType == CubridStatementype.Select)
            {
                fetchFlag = 1;
            }

            int totalTupleCount = stream.RequestExecute(handle, ExecutionOption.Normal, parameters,
                paramModes, fetchFlag, con.AutoCommit);

            cache_reusable = stream.ReadByte();
            resultCount = stream.ReadInt();

            Debug.WriteLine("cache_reusable = {0}" + cache_reusable);
            Debug.WriteLine("resultCount = {0}" + resultCount);

            resultInfos = stream.ReadResultInfo(resultCount);

            if (statementType == CubridStatementype.Select)
            {
                int fetchCode = stream.ReadInt();
                int tupleCount = stream.ReadInt();
                cursor = new CubridDataReader(this, handle, totalTupleCount, columnInfos, tupleCount);
            }
        }