コード例 #1
0
        /// <summary>
        /// 
        /// </summary>
        public MonetDbDataReader(MapiHdl queryHandle, MonetDbConnection connection)
        {
            _queryHandle = queryHandle;
            _connHandle = connection.GetConnectionHandle();

            Init();
        }
コード例 #2
0
ファイル: MapiFactory.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// 
 /// </summary>
 public static void DieQueryError(MapiConnection connectionHandle, MapiHdl queryHandle)
 {
     if (queryHandle.Ptr == IntPtr.Zero ||
         connectionHandle.Ptr == IntPtr.Zero ||
         MapiLib.MapiError(connectionHandle).Ptr != IntPtr.Zero)
     {
         throw new MonetDbException(MapiLib.MapiErrorString(connectionHandle));
     }
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 public static void DieQueryError(MapiConnection connectionHandle, MapiHdl queryHandle)
 {
     if (queryHandle.Ptr == IntPtr.Zero ||
         connectionHandle.Ptr == IntPtr.Zero ||
         MapiLib.MapiError(connectionHandle).Ptr != IntPtr.Zero)
     {
         throw new MonetDbException(MapiLib.MapiErrorString(connectionHandle));
     }
 }
コード例 #4
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
        /// <summary>
        /// Return an array of string pointers to the individual fields.
        /// A zero is returned upon encountering end of sequence or error.
        /// This can be analyzed in using mapi\_error().
        /// </summary>
        /// <param name="hdl"></param>
        /// <returns></returns>
        public static string[] MapiFetchFieldArray(MapiHdl hdl)
        {
            var pptr     = CMapiLib.mapi_fetch_field_array(hdl.Ptr);
            var ptr      = Marshal.ReadIntPtr(pptr);
            var exploded = new List <string>();

            do
            {
                exploded.Add(Marshal.PtrToStringAnsi(ptr));
                pptr = new IntPtr((int)pptr + IntPtr.Size);
                ptr  = Marshal.ReadIntPtr(pptr);
            } while (ptr != IntPtr.Zero);
            return(exploded.ToArray());
        }
コード例 #5
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Ship a previously prepared command to the back-end for execution. 
 /// A single answer is pre-fetched to detect any runtime error. 
 /// MOK is returned upon success.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiExecute(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_execute(hdl.Ptr));
 }
コード例 #6
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Write the error message obtained from mserver to a file.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fs"></param>
 /// <returns></returns>
 public static MapiMsg MapiExplainResult(MapiHdl hdl, FileStream fs)
 {
     return new MapiMsg(CMapiLib.mapi_explain_result(hdl.Ptr, fs.SafeFileHandle));
 }
コード例 #7
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Similar to mapi\_execute but replacing the placeholders for the string values provided.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="args"></param>
 /// <returns></returns>
 public static MapiMsg MapiExecuteArray(MapiHdl hdl, string[] args)
 {
     return(new MapiMsg(CMapiLib.mapi_execute_array(hdl.Ptr, args)));
 }
コード例 #8
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Submit a table of results to the library that can then subsequently be accessed
 /// as if it came from the server. columns is the number of columns of the result
 /// set and must be greater than zero. columnnames is a list of pointers to strings
 /// giving the names of the individual columns. Each pointer may be NULL and
 /// columnnames may be NULL if there are no names. tuplecount is the length
 /// (number of rows) of the result set. If tuplecount is less than zero,
 /// the number of rows is determined by a NULL pointer in the list of tuples
 /// pointers. tuples is a list of pointers to row values. Each row value is
 /// a list of pointers to strings giving the individual results. If one of
 /// these pointers is NULL it indicates a NULL/nil value.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="columns"></param>
 /// <param name="columnnames"></param>
 /// <param name="columntypes"></param>
 /// <param name="columnlengths"></param>
 /// <param name="tuplecount"></param>
 /// <param name="tuples"></param>
 /// <returns></returns>
 public static MapiMsg MapiVirtualResult(MapiHdl hdl, int columns, string[] columnnames, string[] columntypes, int[] columnlengths, int tuplecount, string[][] tuples)
 {
     return(new MapiMsg(CMapiLib.mapi_virtual_result(hdl.Ptr, columns, columnnames, columntypes, columnlengths, tuplecount, tuples)));
 }
コード例 #9
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// 
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fnr"></param>
 /// <returns></returns>
 public static string MapiGetType(MapiHdl hdl, int fnr)
 {
     return Marshal.PtrToStringAnsi(CMapiLib.mapi_get_type(hdl.Ptr, fnr));
 }
コード例 #10
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Return a pointer to the last error message from the server.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static string MapiResultError(MapiHdl hdl)
 {
     return Marshal.PtrToStringAnsi(CMapiLib.mapi_result_error(hdl.Ptr));
 }
コード例 #11
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// All rows are cached at the client side first. Subsequent calls to mapi_fetch_row() will take
 /// the row from the cache. The number or rows cached is returned.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiFetchAllRows(MapiHdl hdl)
 {
     return(CMapiLib.mapi_fetch_all_rows(hdl.Ptr));
 }
コード例 #12
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Terminate a query. This routine is used in the rare cases that consumption of the 
 /// tuple stream produced should be prematurely terminated. It is automatically 
 /// called when a new query using the same query handle is shipped to the database 
 /// and when the query handle is closed with mapi_close_handle().
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiFinish(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_finish(hdl.Ptr));
 }
コード例 #13
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Return the number of rows affected by a database update command such as SQL's INSERT/DELETE/UPDATE statements.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiRowsAffected(MapiHdl hdl)
 {
     return(CMapiLib.mapi_rows_affected(hdl.Ptr));
 }
コード例 #14
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Retrieve a row from the server. The text retrieved is kept around in a buffer linked with the
 /// query handle from which selective fields can be extracted. It returns the number of fields
 /// recognized. A zero is returned upon encountering end of sequence or error. This can be
 /// analyzed in using mapi_error().
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static int MapiFetchRow(MapiHdl hdl)
 {
     return(CMapiLib.mapi_fetch_row(hdl.Ptr));
 }
コード例 #15
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 ///
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiGetLastId(MapiHdl hdl)
 {
     return(CMapiLib.mapi_get_last_id(hdl.Ptr));
 }
コード例 #16
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// If possible, return the number of rows in the last select call. A -1 is returned if this information is not available.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiGetRowCount(MapiHdl hdl)
 {
     return(CMapiLib.mapi_get_row_count(hdl.Ptr));
 }
コード例 #17
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Return the number of fields in the current row.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static int MapiGetFieldCount(MapiHdl hdl)
 {
     return(CMapiLib.mapi_get_field_count(hdl.Ptr));
 }
コード例 #18
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Return a pointer a C-string representation of the value returned. 
 /// A zero is returned upon encountering an error or when the database value is NULL; 
 /// this can be analyzed in using mapi\_error().
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fnr"></param>
 /// <returns></returns>
 public static string MapiFetchField(MapiHdl hdl, int fnr)
 {
     return Marshal.PtrToStringAnsi(CMapiLib.mapi_fetch_field(hdl.Ptr, fnr));
 }
コード例 #19
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Read the answer to a query and pass the results verbatim to a stream.
 /// The result is not analyzed or cached.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fs"></param>
 /// <returns></returns>
 public static int MapiQuickResponse(MapiHdl hdl, FileStream fs)
 {
     return(CMapiLib.mapi_quick_response(hdl.Ptr, fs.SafeFileHandle));
 }
コード例 #20
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Reset the row pointer to the first line in the cache. This need not be a tuple. 
 /// This is mostly used in combination with fetching all tuples at once.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiFetchReset(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_fetch_reset(hdl.Ptr));
 }
コード例 #21
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Reset the row pointer to the requested row number. If whence is MAPI_SEEK_SET (0),
 /// rownr is the absolute row number (0 being the first row); if whence is
 /// MAPI_SEEK_CUR (1), rownr is relative to the current row; if whence is
 /// MAPI\_SEEK\_END (2), rownr is relative to the last row.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="rownr"></param>
 /// <param name="whence"></param>
 /// <returns></returns>
 public static MapiMsg MapiSeekRow(MapiHdl hdl, long rownr, int whence)
 {
     return(new MapiMsg(CMapiLib.mapi_seek_row(hdl.Ptr, rownr, whence)));
 }
コード例 #22
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// 
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiGetLastId(MapiHdl hdl)
 {
     return CMapiLib.mapi_get_last_id(hdl.Ptr);
 }
コード例 #23
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Reset the row pointer to the first line in the cache. This need not be a tuple.
 /// This is mostly used in combination with fetching all tuples at once.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiFetchReset(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_fetch_reset(hdl.Ptr)));
 }
コード例 #24
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Send the Command to the database server represented by hdl, 
 /// reusing the handle from a previous query. If Command is zero it 
 /// takes the last query string kept around. The command response is 
 /// buffered for consumption, e.g. mapi_fetch_row().
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="command"></param>
 /// <returns></returns>
 public static MapiMsg MapiQueryHandle(MapiHdl hdl, string command)
 {
     return new MapiMsg(CMapiLib.mapi_query_handle(hdl.Ptr, command));
 }
コード例 #25
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Make room in the cache by shuffling percentage tuples out of the cache. 
 /// It is sometimes handy to do so, for example, when your application is stream-based 
 /// and you process each tuple as it arrives and still need a limited look-back. 
 /// This percentage can be set between 0 to 100. Making shuffle= 100% (default) 
 /// leads to paging behavior, while shuffle==1 leads to a sliding window over a 
 /// tuple stream with 1% refreshing.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="percentage"></param>
 /// <returns></returns>
 public static MapiMsg MapiCacheShuffle(MapiHdl hdl, int percentage)
 {
     return new MapiMsg(CMapiLib.mapi_cache_shuffle(hdl.Ptr, percentage));
 }
コード例 #26
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Reset the row pointer to the requested row number. If whence is MAPI_SEEK_SET (0), 
 /// rownr is the absolute row number (0 being the first row); if whence is 
 /// MAPI_SEEK_CUR (1), rownr is relative to the current row; if whence is 
 /// MAPI\_SEEK\_END (2), rownr is relative to the last row.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="rownr"></param>
 /// <param name="whence"></param>
 /// <returns></returns>
 public static MapiMsg MapiSeekRow(MapiHdl hdl, long rownr, int whence)
 {
     return new MapiMsg(CMapiLib.mapi_seek_row(hdl.Ptr, rownr, whence));
 }
コード例 #27
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// 
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiClearParams(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_clear_params(hdl.Ptr));
 }
コード例 #28
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Send the Command to the database server represented by hdl,
 /// reusing the handle from a previous query. If Command is zero it
 /// takes the last query string kept around. The command response is
 /// buffered for consumption, e.g. mapi_fetch_row().
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="command"></param>
 /// <returns></returns>
 public static MapiMsg MapiQueryHandle(MapiHdl hdl, string command)
 {
     return(new MapiMsg(CMapiLib.mapi_query_handle(hdl.Ptr, command)));
 }
コード例 #29
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Terminate a query. This routine is used in the rare cases that consumption of the
 /// tuple stream produced should be prematurely terminated. It is automatically
 /// called when a new query using the same query handle is shipped to the database
 /// and when the query handle is closed with mapi_close_handle().
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiFinish(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_finish(hdl.Ptr)));
 }
コード例 #30
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Clear all field bindings.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiClearBindings(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_clear_bindings(hdl.Ptr));
 }
コード例 #31
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Return a pointer a C-string representation of the value returned.
 /// A zero is returned upon encountering an error or when the database value is NULL;
 /// this can be analyzed in using mapi\_error().
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fnr"></param>
 /// <returns></returns>
 public static string MapiFetchField(MapiHdl hdl, int fnr)
 {
     return(Marshal.PtrToStringAnsi(CMapiLib.mapi_fetch_field(hdl.Ptr, fnr)));
 }
コード例 #32
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Close query handle and free resources 
 /// </summary>
 /// <param name="hdl">Query handle</param>
 /// <returns></returns>
 public static MapiMsg MapiCloseHandle(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_close_handle(hdl.Ptr));
 }
コード例 #33
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Go to the next result set, discarding the rest of the output of the current result set.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiNextResult(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_next_result(hdl.Ptr)));
 }
コード例 #34
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Similar to mapi\_execute but replacing the placeholders for the string values provided.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="args"></param>
 /// <returns></returns>
 public static MapiMsg MapiExecuteArray(MapiHdl hdl, string[] args)
 {
     return new MapiMsg(CMapiLib.mapi_execute_array(hdl.Ptr, args));
 }
コード例 #35
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Return a pointer to the last error message from the server.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static string MapiResultError(MapiHdl hdl)
 {
     return(Marshal.PtrToStringAnsi(CMapiLib.mapi_result_error(hdl.Ptr)));
 }
コード例 #36
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// All rows are cached at the client side first. Subsequent calls to mapi_fetch_row() will take 
 /// the row from the cache. The number or rows cached is returned.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiFetchAllRows(MapiHdl hdl)
 {
     return CMapiLib.mapi_fetch_all_rows(hdl.Ptr);
 }
コード例 #37
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Write the error message obtained from mserver to a file.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fs"></param>
 /// <returns></returns>
 public static MapiMsg MapiExplainResult(MapiHdl hdl, FileStream fs)
 {
     return(new MapiMsg(CMapiLib.mapi_explain_result(hdl.Ptr, fs.SafeFileHandle)));
 }
コード例 #38
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Return an array of string pointers to the individual fields. 
 /// A zero is returned upon encountering end of sequence or error. 
 /// This can be analyzed in using mapi\_error().
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static string[] MapiFetchFieldArray(MapiHdl hdl)
 {
     var pptr = CMapiLib.mapi_fetch_field_array(hdl.Ptr);
     var ptr = Marshal.ReadIntPtr(pptr);
     var exploded = new List<string>();
     do
     {
         exploded.Add(Marshal.PtrToStringAnsi(ptr));
         pptr = new IntPtr((int)pptr + IntPtr.Size);
         ptr = Marshal.ReadIntPtr(pptr);
     } while (ptr != IntPtr.Zero);
     return exploded.ToArray();
 }
コード例 #39
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Bind a string variable with a field in the return table.
 /// Upon a successful subsequent mapi_fetch_row() the indicated field
 /// is stored in the space pointed to by val. Returns an error if
 /// the field identified does not exist.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fldnr"></param>
 /// <param name="val"></param>
 /// <returns></returns>
 public static MapiMsg MapiBind(MapiHdl hdl, int fldnr, string[] val)
 {
     return(new MapiMsg(CMapiLib.mapi_bind(hdl.Ptr, fldnr, val)));
 }
コード例 #40
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Retrieve a row from the server. The text retrieved is kept around in a buffer linked with the 
 /// query handle from which selective fields can be extracted. It returns the number of fields 
 /// recognized. A zero is returned upon encountering end of sequence or error. This can be 
 /// analyzed in using mapi_error().
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static int MapiFetchRow(MapiHdl hdl)
 {
     return CMapiLib.mapi_fetch_row(hdl.Ptr);
 }
コード例 #41
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Clear all field bindings.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiClearBindings(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_clear_bindings(hdl.Ptr)));
 }
コード例 #42
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Return the number of fields in the current row.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static int MapiGetFieldCount(MapiHdl hdl)
 {
     return CMapiLib.mapi_get_field_count(hdl.Ptr);
 }
コード例 #43
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 ///
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiClearParams(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_clear_params(hdl.Ptr)));
 }
コード例 #44
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// If possible, return the number of rows in the last select call. A -1 is returned if this information is not available.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiGetRowCount(MapiHdl hdl)
 {
     return CMapiLib.mapi_get_row_count(hdl.Ptr);
 }
コード例 #45
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Make room in the cache by shuffling percentage tuples out of the cache.
 /// It is sometimes handy to do so, for example, when your application is stream-based
 /// and you process each tuple as it arrives and still need a limited look-back.
 /// This percentage can be set between 0 to 100. Making shuffle= 100% (default)
 /// leads to paging behavior, while shuffle==1 leads to a sliding window over a
 /// tuple stream with 1% refreshing.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="percentage"></param>
 /// <returns></returns>
 public static MapiMsg MapiCacheShuffle(MapiHdl hdl, int percentage)
 {
     return(new MapiMsg(CMapiLib.mapi_cache_shuffle(hdl.Ptr, percentage)));
 }
コード例 #46
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Go to the next result set, discarding the rest of the output of the current result set.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiNextResult(MapiHdl hdl)
 {
     return new MapiMsg(CMapiLib.mapi_next_result(hdl.Ptr));
 }
コード例 #47
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Forcefully shuffle the cache making room for new rows. It ignores the read counter, so rows may be lost.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="percentage"></param>
 /// <returns></returns>
 public static MapiMsg MapiCacheFreeup(MapiHdl hdl, int percentage)
 {
     return(new MapiMsg(CMapiLib.mapi_cache_freeup(hdl.Ptr, percentage)));
 }
コード例 #48
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Read the answer to a query and pass the results verbatim to a stream. 
 /// The result is not analyzed or cached.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fs"></param>
 /// <returns></returns>
 public static int MapiQuickResponse(MapiHdl hdl, FileStream fs)
 {
     return CMapiLib.mapi_quick_response(hdl.Ptr, fs.SafeFileHandle);
 }
コード例 #49
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 ///
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fnr"></param>
 /// <returns></returns>
 public static string MapiGetTable(MapiHdl hdl, int fnr)
 {
     return(Marshal.PtrToStringAnsi(CMapiLib.mapi_get_table(hdl.Ptr, fnr)));
 }
コード例 #50
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Return the number of rows affected by a database update command such as SQL's INSERT/DELETE/UPDATE statements.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static long MapiRowsAffected(MapiHdl hdl)
 {
     return CMapiLib.mapi_rows_affected(hdl.Ptr);
 }
コード例 #51
0
ファイル: MapiFactory.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// 
 /// </summary>
 /// <param name="queryHandle"></param>
 public static void CloseQueryHandle(MapiHdl queryHandle)
 {
     MapiLib.MapiFinish(queryHandle);
     MapiLib.MapiCloseHandle(queryHandle);
 }
コード例 #52
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Submit a table of results to the library that can then subsequently be accessed 
 /// as if it came from the server. columns is the number of columns of the result 
 /// set and must be greater than zero. columnnames is a list of pointers to strings 
 /// giving the names of the individual columns. Each pointer may be NULL and 
 /// columnnames may be NULL if there are no names. tuplecount is the length 
 /// (number of rows) of the result set. If tuplecount is less than zero, 
 /// the number of rows is determined by a NULL pointer in the list of tuples 
 /// pointers. tuples is a list of pointers to row values. Each row value is 
 /// a list of pointers to strings giving the individual results. If one of 
 /// these pointers is NULL it indicates a NULL/nil value.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="columns"></param>
 /// <param name="columnnames"></param>
 /// <param name="columntypes"></param>
 /// <param name="columnlengths"></param>
 /// <param name="tuplecount"></param>
 /// <param name="tuples"></param>
 /// <returns></returns>
 public static MapiMsg MapiVirtualResult(MapiHdl hdl, int columns, string[] columnnames, string[] columntypes, int[] columnlengths, int tuplecount, string[][] tuples)
 {
     return new MapiMsg(CMapiLib.mapi_virtual_result(hdl.Ptr, columns, columnnames, columntypes, columnlengths, tuplecount, tuples));
 }
コード例 #53
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Ship a previously prepared command to the back-end for execution.
 /// A single answer is pre-fetched to detect any runtime error.
 /// MOK is returned upon success.
 /// </summary>
 /// <param name="hdl"></param>
 /// <returns></returns>
 public static MapiMsg MapiExecute(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_execute(hdl.Ptr)));
 }
コード例 #54
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="queryHandle"></param>
 public static void CloseQueryHandle(MapiHdl queryHandle)
 {
     MapiLib.MapiFinish(queryHandle);
     MapiLib.MapiCloseHandle(queryHandle);
 }
コード例 #55
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Bind a string variable with a field in the return table. 
 /// Upon a successful subsequent mapi_fetch_row() the indicated field 
 /// is stored in the space pointed to by val. Returns an error if 
 /// the field identified does not exist.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="fldnr"></param>
 /// <param name="val"></param>
 /// <returns></returns>
 public static MapiMsg MapiBind(MapiHdl hdl, int fldnr, string[] val)
 {
     return new MapiMsg(CMapiLib.mapi_bind(hdl.Ptr, fldnr, val));
 }
コード例 #56
0
ファイル: MapiLib.cs プロジェクト: elyor0529/MonetDB
 /// <summary>
 /// Forcefully shuffle the cache making room for new rows. It ignores the read counter, so rows may be lost.
 /// </summary>
 /// <param name="hdl"></param>
 /// <param name="percentage"></param>
 /// <returns></returns>
 public static MapiMsg MapiCacheFreeup(MapiHdl hdl, int percentage)
 {
     return new MapiMsg(CMapiLib.mapi_cache_freeup(hdl.Ptr, percentage));
 }
コード例 #57
0
ファイル: MapiLib.cs プロジェクト: rajeshpillai/MonetDB
 /// <summary>
 /// Close query handle and free resources
 /// </summary>
 /// <param name="hdl">Query handle</param>
 /// <returns></returns>
 public static MapiMsg MapiCloseHandle(MapiHdl hdl)
 {
     return(new MapiMsg(CMapiLib.mapi_close_handle(hdl.Ptr)));
 }