Takusen 0.8 → 0.8.1
raw patch · 17 files changed
+11736/−1031 lines, 17 filesbuild-type:Custom
Files
- Database/Enumerator.lhs +33/−27
- Database/InternalEnumerator.lhs +3/−0
- Database/ODBC/OdbcFunctions.hsc +1021/−945
- Database/ODBC/Test/Enumerator.lhs +4/−0
- Database/ODBC/Test/OdbcFunctions.lhs +115/−49
- Database/PostgreSQL/PGFunctions.lhs +7/−3
- Database/PostgreSQL/Test/Enumerator.lhs +8/−1
- Database/Sqlite/SqliteFunctions.lhs +16/−0
- Database/Test/Enumerator.lhs +16/−3
- Takusen.cabal +3/−3
- c-src/test-libpq/pgdatetest.c +115/−0
- c-src/test-libpq/pgldtest.c +114/−0
- c-src/test-odbc/test.c +157/−0
- doc/html/Database-InternalEnumerator.html +3459/−0
- doc/html/Database-ODBC-Enumerator.html +514/−0
- doc/html/Database-ODBC-OdbcFunctions.html +5628/−0
- doc/html/Foreign-C-UTF8.html +523/−0
Database/Enumerator.lhs view
@@ -79,6 +79,7 @@ > > -- * Sessions and Transactions > DBM -- The data constructor is not exported +> , IE.ISession, IE.ConnectA > , withSession, withContinuedSession > , commit, rollback, beginTransaction > , withTransaction @@ -86,25 +87,32 @@ > , execDDL, execDML, inquire > > -- * Exceptions and handlers -> , DBException(..) +> , IE.DBException(..) > , formatDBException, basicDBExceptionReporter > , reportRethrow, reportRethrowMsg > , catchDB, catchDBError, ignoreDBError, IE.throwDB +> , IE.ColNum, IE.RowNum +> , IE.SqlState, IE.SqlStateClass, IE.SqlStateSubClass > > -- * Preparing and Binding -> , PreparedStmt(..) -- data constructor not exported +> , IE.PreparedStmt -- data constructor not exported > , withPreparedStatement -> , withBoundStatement, IE.bindP +> , withBoundStatement +> , IE.Statement, IE.Command, IE.EnvInquiry +> , IE.PreparationA, IE.IPrepared +> , IE.BindA, IE.DBBind, IE.bindP > > -- * Iteratees and Cursors -> , doQuery +> , IE.IQuery, doQuery, IE.DBType > , IterResult, IterAct > , IE.currentRowNum, NextResultSet(..), RefCursor(..) > , cursorIsEOF, cursorCurrent, cursorNext > , withCursor +> , IE.Position > > -- * Utilities > , ifNull, result, result' + > ) where > import Prelude hiding (catch) @@ -119,7 +127,6 @@ > import Control.Monad.Reader > import Control.Exception.MonadIO > import qualified Database.InternalEnumerator as IE -> import Database.InternalEnumerator (DBException(..)) ----------------------------------------------------------- @@ -138,7 +145,7 @@ | Catch 'Database.InteralEnumerator.DBException's thrown in the 'DBM' monad. -> catchDB :: CaughtMonadIO m => m a -> (DBException -> m a) -> m a +> catchDB :: CaughtMonadIO m => m a -> (IE.DBException -> m a) -> m a > catchDB action handler = gcatch action $ \e -> > maybe (throw e) handler (dynExceptions e >>= fromDynamic) @@ -146,43 +153,43 @@ |This simple handler reports the error to @stdout@ and swallows it i.e. it doesn't propagate. -> basicDBExceptionReporter :: CaughtMonadIO m => DBException -> m () +> basicDBExceptionReporter :: CaughtMonadIO m => IE.DBException -> m () > basicDBExceptionReporter e = liftIO (putStrLn (formatDBException e)) | This handler reports the error and propagates it (usually to force the program to halt). -> reportRethrow :: CaughtMonadIO m => DBException -> m a +> reportRethrow :: CaughtMonadIO m => IE.DBException -> m a > --reportRethrow e = basicDBExceptionReporter e >> IE.throwDB e > reportRethrow e = reportRethrowMsg "" e | Same as reportRethrow, but you can prefix some text to the error (perhaps to indicate which part of your program raised it). -> reportRethrowMsg :: CaughtMonadIO m => String -> DBException -> m a +> reportRethrowMsg :: CaughtMonadIO m => String -> IE.DBException -> m a > reportRethrowMsg m e = liftIO (putStr m) >> basicDBExceptionReporter e >> IE.throwDB e | A show for 'Database.InteralEnumerator.DBException's. -> formatDBException :: DBException -> String -> formatDBException (DBError (ssc, sssc) e m) = +> formatDBException :: IE.DBException -> String +> formatDBException (IE.DBError (ssc, sssc) e m) = > ssc ++ sssc ++ " " ++ (show e) ++ ": " ++ m -> formatDBException (DBFatal (ssc, sssc) e m) = +> formatDBException (IE.DBFatal (ssc, sssc) e m) = > ssc ++ sssc ++ " " ++ (show e) ++ ": " ++ m -> formatDBException (DBUnexpectedNull r c) = +> formatDBException (IE.DBUnexpectedNull r c) = > "Unexpected null in row " ++ (show r) ++ ", column " ++ (show c) ++ "." -> formatDBException (DBNoData) = "Fetch: no more data." +> formatDBException (IE.DBNoData) = "Fetch: no more data." |If you want to trap a specific error number, use this. It passes anything else up. > catchDBError :: (CaughtMonadIO m) => -> Int -> m a -> (DBException -> m a) -> m a +> Int -> m a -> (IE.DBException -> m a) -> m a > catchDBError n action handler = catchDB action > (\dberror -> > case dberror of -> DBError ss e m | e == n -> handler dberror +> IE.DBError ss e m | e == n -> handler dberror > _ | otherwise -> IE.throwDB dberror > ) @@ -330,17 +337,16 @@ -- ** Statements; Prepared statements -------------------------------------------------------------------- -> newtype PreparedStmt mark stmt = PreparedStmt stmt - > executePreparation :: IE.IPrepared stmt sess bstmt bo => -> IE.PreparationA sess stmt -> DBM mark sess (PreparedStmt mark stmt) +> IE.PreparationA sess stmt -> DBM mark sess (IE.PreparedStmt mark stmt) > executePreparation (IE.PreparationA action) = -> DBM( ask >>= \sess -> lift $ action sess >>= return . PreparedStmt) +> DBM( ask >>= \sess -> lift $ action sess >>= return . IE.PreparedStmt) -> data NextResultSet mark stmt = NextResultSet (PreparedStmt mark stmt) +> data NextResultSet mark stmt = NextResultSet (IE.PreparedStmt mark stmt) > data RefCursor a = RefCursor a + The exception handling in withPreparedStatement looks awkward, but there's a good reason... @@ -365,7 +371,7 @@ > => IE.PreparationA sess stmt > -- ^ preparation action to create prepared statement; > -- this action is usually created by @prepareQuery\/Command@ -> -> (PreparedStmt mark stmt -> DBM mark sess a) +> -> (IE.PreparedStmt mark stmt -> DBM mark sess a) > -- ^ DBM action that takes a prepared statement > -> DBM mark sess a > withPreparedStatement pa action = do @@ -380,8 +386,8 @@ Not exported. > destroyStmt :: (IE.ISession sess, IE.IPrepared stmt sess bstmt bo) -> => PreparedStmt mark stmt -> DBM mark sess () -> destroyStmt (PreparedStmt stmt) = DBM( ask >>= \s -> lift $ IE.destroyStmt s stmt ) +> => IE.PreparedStmt mark stmt -> DBM mark sess () +> destroyStmt (IE.PreparedStmt stmt) = DBM( ask >>= \s -> lift $ IE.destroyStmt s stmt) @@ -402,14 +408,14 @@ > withBoundStatement :: > (Typeable a, IE.IPrepared stmt s bstmt bo) -> => PreparedStmt mark stmt +> => IE.PreparedStmt mark stmt > -- ^ prepared statement created by withPreparedStatement > -> [IE.BindA s stmt bo] > -- ^ bind values > -> (bstmt -> DBM mark s a) > -- ^ action to run over bound statement > -> DBM mark s a -> withBoundStatement (PreparedStmt stmt) ba f = +> withBoundStatement (IE.PreparedStmt stmt) ba f = > DBM ( ask >>= \s -> > lift $ IE.bindRun s stmt ba (\b -> runReaderT (unDBM (f b)) s)) @@ -583,7 +589,7 @@ > -> DBM mark s (DBCursor mark (DBM mark s) a) > cursorNext (DBCursor ref) = do > (_, maybeF) <- liftIO $ readIORef ref -> maybe (IE.throwDB DBNoData) ($ True) maybeF +> maybe (IE.throwDB IE.DBNoData) ($ True) maybeF Returns the cursor. The return value is usually ignored.
Database/InternalEnumerator.lhs view
@@ -20,6 +20,7 @@ > ISession(..), ConnectA(..) > , Statement(..), Command(..), EnvInquiry(..) > , PreparationA(..), IPrepared(..) +> , PreparedStmt(..) > , BindA(..), DBBind(..) > , IsolationLevel(..) > , Position @@ -215,6 +216,7 @@ ------------------------------------------------------------------------ Prepared commands and statements +> newtype PreparedStmt mark stmt = PreparedStmt stmt | This type is not visible to the end user (cf. ConnectA). It forms a private `communication channel' between Database.Enumerator and a back end. @@ -241,6 +243,7 @@ > -- (so many result-sets are created+destroyed), and then destroy it, > -- so it has a lifecycle independent of Queries. > destroyStmt :: sess -> stmt -> IO () + | The binding object (bo) below is very abstract, on purpose. It may be |IO a|, it may be String, it may be a function, etc.
Database/ODBC/OdbcFunctions.hsc view
@@ -1,945 +1,1021 @@- -{-# OPTIONS -ffi #-} -{-# OPTIONS -fglasgow-exts #-} -{-# LANGUAGE ForeignFunctionInterface #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} - -#ifdef mingw32_HOST_OS -#include <windows.h> -#endif -#include <sql.h> -#include <sqlext.h> - -#ifdef mingw32_HOST_OS -#let CALLCONV = "stdcall" -#else -#let CALLCONV = "ccall" -#endif - -{- -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcodbc_api_reference.asp -http://www.dbmaker.com.tw/reference/manuals/odbc/odbc_chap_04.html --} - - --- | --- Module : Database.ODBC.OdbcFunctions --- Copyright : (c) 2007 Oleg Kiselyov, Alistair Bayley --- License : BSD-style --- Maintainer : oleg@pobox.com, alistair@abayley.org --- Stability : experimental --- Portability : non-portable --- --- Wrappers for ODBC FFI functions, plus buffer marshaling. - -module Database.ODBC.OdbcFunctions where - -import Control.Exception -import Control.Monad -import Data.Dynamic -import Data.Time -import Database.Util -import Foreign -import Foreign.C -import Foreign.C.UTF8 - -data HandleObj = HandleObj -type Handle = Ptr HandleObj -data EnvObj = EnvObj -type EnvHandle = Ptr EnvObj -data ConnObj = ConnObj -type ConnHandle = Ptr ConnObj -data StmtObj = StmtObj -type StmtHandle = Ptr StmtObj -type WindowHandle = Ptr () -data Buffer = Buffer -type BufferFPtr = ForeignPtr Buffer -type SizeFPtr = ForeignPtr SqlLen - -data BindBuffer = BindBuffer - { bindBufPtr :: BufferFPtr - , bindBufSzPtr :: SizeFPtr - , bindBufSize :: SqlLen - } - -type SqlInteger = #{type SQLINTEGER} -type SqlUInteger = #{type SQLUINTEGER} -type SqlSmallInt = #{type SQLSMALLINT} -type SqlUSmallInt = #{type SQLUSMALLINT} -type SqlLen = #{type SQLLEN} -type SqlULen = #{type SQLULEN} -type SqlReturn = SqlSmallInt -type SqlHandleType = SqlSmallInt -type SqlDataType = SqlSmallInt -type SqlCDataType = SqlSmallInt -type SqlParamDirection = SqlSmallInt - --- Return codes from API calls - -( - sqlRcInvalidHandle : - sqlRcStillExecuting : - sqlRcSuccess : - sqlRcSuccessWithInfo : - sqlRcError : - sqlRcNeedData : - sqlRcNoData : --- []) = [-2,-1,0,1,2,99,100] :: [SqlReturn] - []) = - ( - #{const SQL_INVALID_HANDLE} : - #{const SQL_STILL_EXECUTING} : - #{const SQL_SUCCESS} : - #{const SQL_SUCCESS_WITH_INFO} : - #{const SQL_ERROR} : - #{const SQL_NEED_DATA} : - #{const SQL_NO_DATA} : - []) :: [SqlReturn] - -showReturnCode rc - | rc == #{const SQL_INVALID_HANDLE} = "SQL_INVALID_HANDLE" - | rc == #{const SQL_STILL_EXECUTING} = "SQL_STILL_EXECUTING" - | rc == #{const SQL_SUCCESS} = "SQL_SUCCESS" - | rc == #{const SQL_SUCCESS_WITH_INFO} = "SQL_SUCCESS_WITH_INFO" - | rc == #{const SQL_ERROR} = "SQL_ERROR" - | rc == #{const SQL_NEED_DATA} = "SQL_NEED_DATA" - | rc == #{const SQL_NO_DATA} = "SQL_NO_DATA" - | otherwise = "UNKNOWN_RETURN_CODE" - --- There are only four handle types in ODBC. - -( - sqlHTypeEnv : - sqlHTypeConn : - sqlHTypeStmt : - sqlHTypeDesc : --- []) = [1..4] :: [SqlHandleType] - []) = - ( - #{const SQL_HANDLE_ENV} : - #{const SQL_HANDLE_DBC} : - #{const SQL_HANDLE_STMT} : - #{const SQL_HANDLE_DESC} : - []) :: [SqlHandleType] - -sqlDriverNoPrompt :: SqlUSmallInt -sqlDriverNoPrompt = #{const SQL_DRIVER_NOPROMPT} - -sqlNullTermedString :: SqlInteger -sqlNullTermedString = #{const SQL_NTS} - -sqlNullData :: SqlLen -sqlNullData = #{const SQL_NULL_DATA} - -sqlTransCommit :: SqlSmallInt -sqlTransCommit = #{const SQL_COMMIT} - -sqlTransRollback :: SqlSmallInt -sqlTransRollback = #{const SQL_ROLLBACK} - -sqlAutoCommitOn, sqlAutoCommitOff :: SqlInteger -sqlAutoCommitOn = #{const SQL_AUTOCOMMIT_ON} -sqlAutoCommitOff = #{const SQL_AUTOCOMMIT_OFF} - --- These are attribute types, which are passed as the second parameter --- to sqlSetEnvAttr. - -( - sqlAttrOdbcVersion : - sqlAttrAutoCommit : - sqlAttrTxnIsolation : - []) = - ( - #{const SQL_ATTR_ODBC_VERSION} : - #{const SQL_ATTR_AUTOCOMMIT} : - #{const SQL_ATTR_TXN_ISOLATION} : - []) :: [SqlInteger] - --- These are attribute values, which are passed as the third parameter --- to sqlSetEnvAttr. Obviously that must accompany the relevant --- attribute type. - -( - sqlOvOdbc3 : - sqlTxnCapable : - sqlDefaultTxnIsolation : - sqlTxnIsolationOption : - sqlTxnReadUncommitted : - sqlTxnReadCommitted : - sqlTxnRepeatableRead : - sqlTxnSerializable : - []) = - ( - #{const SQL_OV_ODBC3} : -- 3 (UL) - #{const SQL_TXN_CAPABLE} : -- 46 - #{const SQL_DEFAULT_TXN_ISOLATION} : -- 26 - #{const SQL_TXN_ISOLATION_OPTION} : -- 72 - #{const SQL_TXN_READ_UNCOMMITTED} : -- 1 - #{const SQL_TXN_READ_COMMITTED} : -- 2 - #{const SQL_TXN_REPEATABLE_READ} : -- 4 - #{const SQL_TXN_SERIALIZABLE} : -- 8 - []) :: [SqlInteger] - - --- ODBC SQL data types -( - sqlDTypeString : - sqlDTypeInt : - sqlDTypeBinary : - sqlDTypeDouble : - sqlDTypeDate : - sqlDTypeTime : - sqlDTypeTimestamp : - sqlDTypeCursor : - []) = - ( - #{const SQL_CHAR} : -- 1 - #{const SQL_INTEGER} : -- 4 - #{const SQL_BINARY} : -- -2 - #{const SQL_DOUBLE} : -- 8 - #{const SQL_TYPE_DATE} : -- 9 - #{const SQL_TYPE_TIME} : -- 10 - #{const SQL_TYPE_TIMESTAMP} : -- 11 - #{const SQL_CURSOR_TYPE} : -- 6 - []) :: [SqlDataType] - --- host language (C) data types - -( - sqlCTypeString : - sqlCTypeInt : - sqlCTypeBinary : - sqlCTypeDouble : - sqlCTypeDate : - sqlCTypeTime : - sqlCTypeTimestamp : - []) = - ( - #{const SQL_C_CHAR} : - #{const SQL_C_LONG} : - #{const SQL_C_BINARY} : - #{const SQL_C_DOUBLE} : - #{const SQL_C_TYPE_DATE} : - #{const SQL_C_TYPE_TIME} : - #{const SQL_C_TYPE_TIMESTAMP} : - []) :: [SqlCDataType] - -{- -#define SQL_C_BINARY SQL_BINARY -#define SQL_C_BIT SQL_BIT -#define SQL_C_BOOKMARK SQL_C_ULONG -#define SQL_C_CHAR SQL_CHAR -#define SQL_C_DATE SQL_DATE -#define SQL_C_DEFAULT 99 -#define SQL_C_DOUBLE SQL_DOUBLE -#define SQL_C_FLOAT SQL_REAL -#define SQL_C_LONG SQL_INTEGER -#define SQL_C_SHORT SQL_SMALLINT -#define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) -#define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) -#define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) -#define SQL_C_TIME SQL_TIME -#define SQL_C_TIMESTAMP SQL_TIMESTAMP -#define SQL_C_TINYINT SQL_TINYINT -#define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) -#define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) -#define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) --} - -( - sqlParamInput : - sqlParamInputOutput : - sqlParamOutput : - sqlParamDefault : - sqlParamUnknown : - [] ) = - ( - #{const SQL_PARAM_INPUT} : - #{const SQL_PARAM_INPUT_OUTPUT} : - #{const SQL_PARAM_OUTPUT} : - #{const SQL_PARAM_TYPE_DEFAULT} : - #{const SQL_PARAM_TYPE_UNKNOWN} : - [] ) :: [SqlParamDirection] - - -data OdbcException = OdbcException Int String String [OdbcException] - deriving (Typeable) - -instance Show OdbcException where - show (OdbcException i st s _) = "OdbcException " - ++ (show i) ++ " " ++ st ++ " " ++ s - -catchOdbc :: IO a -> (OdbcException -> IO a) -> IO a -catchOdbc = catchDyn - -throwOdbc :: OdbcException -> a -throwOdbc = throwDyn - --- define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) -sqlSucceeded rc = rc == sqlRcSuccess || rc == sqlRcSuccessWithInfo - -type MyCString = CString -type MyCStringLen = CStringLen -myPeekCStringLen p = peekUTF8StringLen p -myWithCString s = withUTF8String s -myWithCStringLen s = withUTF8StringLen s ---myPeekCStringLen p = peekCStringLen p ---myWithCString s = withCString s ---myWithCStringLen s = withCStringLen s - -getDiagRec :: SqlReturn -> SqlHandleType -> Handle -> SqlSmallInt -> IO [OdbcException] -getDiagRec retcode htype handle row = - allocaBytes 6 $ \cstrState -> do - alloca $ \errorNumPtr -> do - allocaBytes 1025 $ \cstrMsg -> do - alloca $ \msgLenPtr -> do - rc <- sqlGetDiagRec htype handle row cstrState errorNumPtr cstrMsg 1024 msgLenPtr - --putStrLn ("getDiagRec: rc=" ++ show rc) - case () of - _ | rc == sqlRcSuccess -> do - errnum <- peek errorNumPtr - state <- myPeekCStringLen (cstrState, 5) - msglen <- peek msgLenPtr - --putStrLn ("getDiagRec: msglen=" ++ show msglen) - msg <- myPeekCStringLen (cstrMsg, fromIntegral msglen) - --putStrLn ("getDiagRec: msg=" ++ msg) - more <- getDiagRec retcode htype handle (row+1) - return ((OdbcException (fromIntegral errnum) state msg []) : more) - | rc == sqlRcNoData -> return [] - | otherwise -> return [OdbcException (fromIntegral rc) "01000" (showReturnCode retcode) []] - -checkError :: SqlReturn -> SqlHandleType -> Handle -> IO () -checkError rc htype handle = - when (rc /= sqlRcSuccess && rc /= sqlRcSuccessWithInfo) - (do - exs <- getDiagRec rc htype handle 1 - if null exs - then throwOdbc (OdbcException (fromIntegral rc) "01000" - ("No error messages for return code " ++ show rc ++ " (" ++ showReturnCode rc ++ ")") []) - else do - let (OdbcException i st s _) = head exs - throwOdbc (OdbcException i st s (tail exs)) - ) - -allocHdl :: (Storable a) => Handle -> SqlHandleType -> IO a -allocHdl h htype = do - alloca $ \hptr -> do - rc <- sqlAllocHandle htype h (castPtr hptr) - checkError rc htype h - peek hptr - -allocEnv :: IO EnvHandle -allocEnv = allocHdl nullPtr sqlHTypeEnv - -allocConn :: EnvHandle -> IO ConnHandle -allocConn env = allocHdl (castPtr env) sqlHTypeConn - -allocStmt :: ConnHandle -> IO StmtHandle -allocStmt conn = allocHdl (castPtr conn) sqlHTypeStmt - -freeHelper :: SqlHandleType -> Handle -> IO () -freeHelper htype h = do - rc <- sqlFreeHandle htype h - checkError rc htype h - -freeEnv :: EnvHandle -> IO () -freeEnv env = freeHelper sqlHTypeEnv (castPtr env) - -freeConn :: ConnHandle -> IO () -freeConn conn = freeHelper sqlHTypeConn (castPtr conn) - -freeStmt :: StmtHandle -> IO () -freeStmt stmt = freeHelper sqlHTypeStmt (castPtr stmt) - -int2Ptr :: SqlInteger -> Ptr () -int2Ptr i = plusPtr nullPtr (fromIntegral i) - -setOdbcVer :: EnvHandle -> IO () -setOdbcVer env = do - rc <- sqlSetEnvAttr env sqlAttrOdbcVersion (int2Ptr sqlOvOdbc3) 0 - checkError rc sqlHTypeEnv (castPtr env) - -connect :: ConnHandle -> String -> IO String -connect conn connstr = do - myWithCStringLen connstr $ \(cstr, clen) -> do - allocaBytes 1000 $ \outConnStr -> do - alloca $ \ptrOutLen -> do - rc <- sqlDriverConnect conn nullPtr cstr (fromIntegral clen) - outConnStr 1000 ptrOutLen sqlDriverNoPrompt - checkError rc sqlHTypeConn (castPtr conn) - outLen <- peek ptrOutLen - myPeekCStringLen (outConnStr, fromIntegral outLen) - -disconnect :: ConnHandle -> IO () -disconnect conn = do - rc <- sqlDisconnect conn - checkError rc sqlHTypeConn (castPtr conn) - - -prepareStmt :: StmtHandle -> String -> IO () -prepareStmt stmt sqltext = do - myWithCString sqltext $ \cstr -> do - rc <- sqlPrepare stmt cstr sqlNullTermedString - checkError rc sqlHTypeStmt (castPtr stmt) - -executeStmt :: StmtHandle -> IO () -executeStmt stmt = do - rc <- sqlExecute stmt - checkError rc sqlHTypeStmt (castPtr stmt) - -closeCursor :: StmtHandle -> IO () -closeCursor stmt = do - rc <- sqlCloseCursor stmt - checkError rc sqlHTypeStmt (castPtr stmt) - -rowCount :: StmtHandle -> IO Int -rowCount stmt = do - alloca $ \rcptr -> do - rc <- sqlRowCount stmt rcptr - checkError rc sqlHTypeStmt (castPtr stmt) - liftM fromIntegral (peek rcptr) - --- | Return 'True' if there are more rows, 'False' if end-of-data. -fetch :: StmtHandle -> IO Bool -fetch stmt = do - rc <- sqlFetch stmt - when (rc /= sqlRcNoData) - (checkError rc sqlHTypeStmt (castPtr stmt)) - return (rc /= sqlRcNoData) - -moreResults :: StmtHandle -> IO Bool -moreResults stmt = do - rc <- sqlMoreResults stmt - when (rc /= sqlRcNoData) - (checkError rc sqlHTypeStmt (castPtr stmt)) - return (rc /= sqlRcNoData) - - -commit :: ConnHandle -> IO () -commit conn = do - rc <- sqlEndTran sqlHTypeConn (castPtr conn) sqlTransCommit - checkError rc sqlHTypeConn (castPtr conn) - -rollback :: ConnHandle -> IO () -rollback conn = do - rc <- sqlEndTran sqlHTypeConn (castPtr conn) sqlTransRollback - checkError rc sqlHTypeConn (castPtr conn) - -setAutoCommitOn :: ConnHandle -> IO () -setAutoCommitOn conn = do - rc <- sqlSetConnectAttr conn sqlAttrAutoCommit (int2Ptr sqlAutoCommitOn) 0 - checkError rc sqlHTypeConn (castPtr conn) - -setAutoCommitOff :: ConnHandle -> IO () -setAutoCommitOff conn = do - rc <- sqlSetConnectAttr conn sqlAttrAutoCommit (int2Ptr sqlAutoCommitOff) 0 - checkError rc sqlHTypeConn (castPtr conn) - -setTxnIsolation :: ConnHandle -> SqlInteger -> IO () -setTxnIsolation conn level = do - rc <- sqlSetConnectAttr conn sqlAttrTxnIsolation (int2Ptr level) 0 - checkError rc sqlHTypeConn (castPtr conn) - - ---------------------------------------------------------------------- --- Get column values with SQLGetData - -getMaybeFromBuffer :: Storable a => Ptr SqlLen -> Ptr a -> (Ptr a -> SqlLen -> IO b) -> IO (Maybe b) -getMaybeFromBuffer szptr bptr action = do - len <- peek szptr - if len < 0 then return Nothing - else action bptr len >>= return . Just - -getDataStorable :: Storable a => StmtHandle -> Int -> SqlDataType -> Int -> (a -> b) -> IO (Maybe b) -getDataStorable stmt pos sqltype buffersize convert = do - allocaBytes buffersize $ \bptr -> do - alloca $ \szptr -> do - rc <- sqlGetData stmt (fromIntegral pos) sqltype (castPtr bptr) 0 szptr - checkError rc sqlHTypeStmt (castPtr stmt) - getMaybeFromBuffer szptr bptr (\buffer len -> peek buffer >>= return . convert ) - -getDataUtcTime :: StmtHandle -> Int -> IO (Maybe UTCTime) -getDataUtcTime stmt pos = do - allocaBytes #{size TIMESTAMP_STRUCT} $ \bptr -> do - alloca $ \szptr -> do - rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeTimestamp (castPtr bptr) 50 szptr - checkError rc sqlHTypeStmt (castPtr stmt) - getMaybeFromBuffer szptr bptr (\buffer len -> readUtcTimeFromMemory buffer >>= return ) - -getDataCStringLen :: StmtHandle -> Int -> IO (Maybe CStringLen) -getDataCStringLen stmt pos = do - alloca $ \szptr -> do - allocaBytes 16 $ \dummyptr -> do - -- Call GetData with 0-sized buffer to get size information. - rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeString (castPtr dummyptr) 0 szptr - when (rc /= sqlRcSuccessWithInfo) - (checkError rc sqlHTypeStmt (castPtr stmt)) - bufSize <- peek szptr - let bufSize' = 1 + if bufSize < 0 then 0 else bufSize - -- Use size information to allocate perfectly-sized buffer. - allocaBytes (fromIntegral bufSize') $ \bptr -> do - rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeString (castPtr bptr) 100000 szptr - checkError rc sqlHTypeStmt (castPtr stmt) - len <- peek szptr - if len < 0 then return Nothing - else return (Just (castPtr bptr, fromIntegral len)) - -getDataUTF8String :: StmtHandle -> Int -> IO (Maybe String) -getDataUTF8String stmt pos = do - mbcstrlen <- getDataCStringLen stmt pos - case mbcstrlen of - Nothing -> return Nothing - Just cstrlen -> peekUTF8StringLen cstrlen >>= return . Just - -getDataCString :: StmtHandle -> Int -> IO (Maybe String) -getDataCString stmt pos = do - mbcstrlen <- getDataCStringLen stmt pos - case mbcstrlen of - Nothing -> return Nothing - Just cstrlen -> peekCStringLen cstrlen >>= return . Just - -{- from sqltypes.h. Struct size depends on size of SmallInt etc, -but is 16 bytes on a 32-bit platform. 32 bytes on 64-bit? -typedef struct tagTIMESTAMP_STRUCT { - SQLSMALLINT year; - SQLUSMALLINT month; - SQLUSMALLINT day; - SQLUSMALLINT hour; - SQLUSMALLINT minute; - SQLUSMALLINT second; - SQLUINTEGER fraction; -} TIMESTAMP_STRUCT; --} - -peekSmallInt :: Ptr a -> Int -> IO SqlSmallInt -peekSmallInt buffer offset = peekByteOff buffer offset -peekUSmallInt :: Ptr a -> Int -> IO SqlUSmallInt -peekUSmallInt buffer offset = peekByteOff buffer offset -peekUInteger :: Ptr a -> Int -> IO SqlUInteger -peekUInteger buffer offset = peekByteOff buffer offset - --- We have to give the Ptr a concrete type, to keep the type-checker --- happy, but it can be anything. It has to be a Storable type, though. - -readUtcTimeFromMemory :: Ptr Word8 -> IO UTCTime -readUtcTimeFromMemory buffer = do - year <- peekSmallInt buffer #{offset TIMESTAMP_STRUCT, year} - month <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, month} - day <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, day} - hour <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, hour} - minute <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, minute} - second <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, second} - -- Fraction ranges from 0 - 999,999,999, - frac <- peekUInteger buffer #{offset TIMESTAMP_STRUCT, fraction} - let secs :: Double; secs = fromIntegral second + (fromIntegral frac / 1000000000.0) - return (mkUTCTime (fromIntegral year) month day hour minute second) - ---------------------------------------------------------------------- --- Return-set column binding. --- Apparently this is faster than SQLGetData for larger result-sets, --- because the output buffers do not need to be rebound with --- every call. --- Dunno how much difference this'll make in practice. Suck 'n' see. - -bindColumnBuffer :: StmtHandle -> Int -> SqlDataType -> SqlLen -> IO BindBuffer -bindColumnBuffer stmt pos dtype size = do - buffer <- createEmptyBuffer (fromIntegral size) - withForeignPtr (bindBufPtr buffer) $ \bptr -> do - withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do - rc <- sqlBindCol stmt (fromIntegral pos) dtype bptr size szptr - checkError rc sqlHTypeStmt (castPtr stmt) - return buffer - -createEmptyBuffer :: SqlLen -> IO BindBuffer -createEmptyBuffer size = do - szfptr <- mallocForeignPtr - bfptr <- mallocForeignPtrBytes (fromIntegral size) - return (BindBuffer bfptr szfptr size) - - -testForNull :: BindBuffer -> (Ptr Buffer -> SqlLen -> IO a) -> IO (Maybe a) -testForNull buffer action = do - withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do - len <- peek szptr - -- sqlNullData = -1, so anthing less than zero could - -- be treated as null. - if len < 0 then return Nothing - else withForeignPtr (bindBufPtr buffer) $ \bptr -> - action bptr len >>= return . Just - -getStorableFromBuffer :: Storable a => BindBuffer -> IO (Maybe a) -getStorableFromBuffer buffer = - testForNull buffer (\bptr _ -> peek (castPtr bptr)) - -getCAStringFromBuffer :: BindBuffer -> IO (Maybe String) -getCAStringFromBuffer buffer = - testForNull buffer (\ptr len -> peekCAStringLen (castPtr ptr, fromIntegral len)) - -getCWStringFromBuffer :: BindBuffer -> IO (Maybe String) -getCWStringFromBuffer buffer = - testForNull buffer (\ptr len -> peekCWStringLen (castPtr ptr, fromIntegral len)) - -getUTF8StringFromBuffer :: BindBuffer -> IO (Maybe String) -getUTF8StringFromBuffer buffer = - testForNull buffer (\ptr len -> peekUTF8StringLen (castPtr ptr, fromIntegral len)) - -getUtcTimeFromBuffer :: BindBuffer -> IO (Maybe UTCTime) -getUtcTimeFromBuffer bindbuffer = do - testForNull bindbuffer $ \buffer _ -> do - readUtcTimeFromMemory (castPtr buffer) - - ---------------------------------------------------------------------- --- Parameter binding - -createBufferForStorable :: Storable a => Maybe a -> IO BindBuffer -createBufferForStorable Nothing = - let zero :: Int; zero = 0; in createBufferHelper zero (-1) -createBufferForStorable (Just val) = createBufferHelper val (fromIntegral (sizeOf val)) - -createBufferHelper :: Storable a => a -> SqlLen -> IO BindBuffer -createBufferHelper val size = do - szfptr <- mallocForeignPtr - withForeignPtr szfptr (\szptr -> poke szptr size) - bfptr <- mallocForeignPtr - withForeignPtr bfptr (\bptr -> poke bptr val) - return (BindBuffer (castForeignPtr bfptr) szfptr (fromIntegral size)) - -wrapSizedBuffer :: Ptr a -> SqlLen -> IO BindBuffer -wrapSizedBuffer valptr size = do - szfptr <- mallocForeignPtr - withForeignPtr szfptr (\szptr -> poke szptr size) - bfptr <- newForeignPtr finalizerFree valptr - return (BindBuffer (castForeignPtr bfptr) szfptr (fromIntegral size)) - -bindParam :: - StmtHandle - -> Int - -> SqlParamDirection - -> SqlCDataType - -> SqlDataType - -> SqlULen - -> SqlSmallInt - -> BindBuffer - -> IO () -bindParam stmt pos direction ctype sqltype precision scale buffer = - withForeignPtr (bindBufPtr buffer) $ \bptr -> do - withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do - size <- peek szptr - rc <- sqlBindParameter stmt (fromIntegral pos) direction ctype sqltype precision scale bptr size szptr - checkError rc sqlHTypeStmt (castPtr stmt) - --- sqlParamInput -bindNull :: StmtHandle -> Int -> SqlParamDirection -> SqlCDataType -> SqlDataType -> IO BindBuffer -bindNull stmt pos direction ctype dtype = do - let val :: Maybe Int; val = Nothing - buffer <- createBufferForStorable val - bindParam stmt pos direction ctype dtype 0 0 buffer - return buffer - -bindParamCStringLen :: StmtHandle -> Int -> SqlParamDirection -> Maybe CStringLen -> IO BindBuffer -bindParamCStringLen stmt pos direction Nothing = - bindNull stmt pos direction sqlCTypeString sqlDTypeString -bindParamCStringLen stmt pos direction (Just (cstr, clen)) = do - buffer <- wrapSizedBuffer cstr (fromIntegral clen) - bindParam stmt pos direction sqlCTypeString sqlDTypeString (fromIntegral clen) 0 buffer - return buffer - -bindEncodedString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> (String -> ((Ptr a, Int) -> IO BindBuffer) -> IO BindBuffer) -> IO BindBuffer -bindEncodedString stmt pos direction Nothing withEncoder = - bindNull stmt pos direction sqlCTypeString sqlDTypeString -bindEncodedString stmt pos direction (Just s) withEncoder = - withEncoder s (\(cs, cl) -> bindParamCStringLen stmt pos direction (Just (castPtr cs, cl))) - -bindParamUTF8String :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer -bindParamUTF8String stmt pos direction val = - bindEncodedString stmt pos direction val withUTF8StringLen - -bindParamCAString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer -bindParamCAString stmt pos direction val = - bindEncodedString stmt pos direction val withCAStringLen - -bindParamCWString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer -bindParamCWString stmt pos direction val = - bindEncodedString stmt pos direction val withCWStringLen - -pokeSmallInt :: Ptr a -> Int -> SqlSmallInt -> IO () -pokeSmallInt buffer offset val = pokeByteOff buffer offset val -pokeUSmallInt :: Ptr a -> Int -> SqlUSmallInt -> IO () -pokeUSmallInt buffer offset val = pokeByteOff buffer offset val -pokeUInteger :: Ptr a -> Int -> SqlUInteger -> IO () -pokeUInteger buffer offset val = pokeByteOff buffer offset val - -writeUTCTimeToMemory :: Ptr Word8 -> UTCTime -> IO () -writeUTCTimeToMemory buffer utc = do - let - (LocalTime ltday time) = utcToLocalTime (hoursToTimeZone 0) utc - (TimeOfDay hour minute second) = time - (year, month, day) = toGregorian ltday - pokeSmallInt buffer #{offset TIMESTAMP_STRUCT, year} (fromIntegral year) - pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, month} (fromIntegral month) - pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, day} (fromIntegral day) - pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, hour} (fromIntegral hour) - pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, minute} (fromIntegral minute) - -- what do we do with fraction? What sort of fraction is it? - -- apparently can range from 0 - 999,999,999, - -- but MS SQL Server only handles milliseconds (0 - 999) i.e. precision 3 - let (secs, frac) = properFraction second - let fraction :: SqlUInteger; fraction = round (frac * 1000000000.0) - pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, second} secs - pokeUInteger buffer #{offset TIMESTAMP_STRUCT, fraction} fraction - --- writeUTCTimeToMemory and makeUtcTimeBuffer don't work with MS SQL Server; --- it always returns 22008 "Datetime field overflow". --- They work with PostgreSQL and Oracle ODBC drivers. --- So I'll leave the code here, in case anyone is desperate --- to marshal via TIMESTAMP_STRUCT, rather than strings. - -makeUtcTimeBuffer :: UTCTime -> IO BindBuffer -makeUtcTimeBuffer utc = do - mem <- mallocBytes #{size TIMESTAMP_STRUCT} - writeUTCTimeToMemory (castPtr mem) utc - wrapSizedBuffer mem #{size TIMESTAMP_STRUCT} - -makeUtcTimeStringBuffer :: UTCTime -> IO BindBuffer -makeUtcTimeStringBuffer utc = do - mem <- mallocBytes 40 - let s = utcTimeToOdbcDatetime utc - withCStringLen s $ \(cstr, clen) -> do - copyBytes mem cstr (fromIntegral clen) - pokeByteOff mem (fromIntegral clen) (0 :: Word8) - wrapSizedBuffer mem (fromIntegral clen) - -bindParamUtcTime :: StmtHandle -> Int -> SqlParamDirection -> Maybe UTCTime -> IO BindBuffer -bindParamUtcTime stmt pos direction Nothing = do - bindNull stmt pos direction sqlCTypeTimestamp sqlDTypeTimestamp -bindParamUtcTime stmt pos direction (Just utc) = do - -- For TimeStamp: - -- Size/Length should be 16 bytes. - -- Precision should be 8 (or 16?). - -- Scale is the number of digits in the fraction component (SQL Server only allows 0-3). - -- We're not using the TIMESTAMP_STRUCT to marshal any more. - --buffer <- makeUtcTimeBuffer utc - --bindParam stmt pos direction sqlCTypeTimestamp sqlDTypeTimestamp #{size TIMESTAMP_STRUCT} 0 buffer - -- - -- We have to pass in a String, rather than a TIMESTAMP_STRUCT, - -- and let the ODBC driver do the conversion. - -- I cannot get TIMESTAMP_STRUCT to work with MS SQL Server; - -- it always returns 22008 "Datetime field overflow". - buffer <- makeUtcTimeStringBuffer utc - withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do - size <- peek szptr - -- 23 is the largest precision value allowed by MS SQL Server. - -- That gives us "yyyy-mm-dd hh:mm:ss.fff" - bindParam stmt pos direction sqlCTypeString sqlDTypeTimestamp 23 0 buffer - return buffer - - ---------------------------------------------------------------------- --- Binding with class... - -sizeOfMaybe :: forall a. Storable a => Maybe a -> Int -sizeOfMaybe _ = sizeOf ( undefined :: a ) --- H98 stylee... ---sizeOfMaybe v@Nothing = sizeOfMaybe (asTypeOf (Just undefined) v) ---sizeOfMaybe (Just v) = sizeOf v - -newtype OutParam a = OutParam a -newtype InOutParam a = InOutParam a - -{- -Separate out the type different types of binding: parameter and column. - -Both types use the same BindBuffer, but bind parameters -can send and receive values from the buffer, whereas -column binds only receive values. -This distinction will be handled by having a set of -instances for OdbcBindBuffer that are of the form (Maybe a), -where a is one of the normal database types e.g. Int, Double, -String, UTCTime. -The instances for OdbcBindParam will include the (Maybe a) set, -and also (OutParam (Maybe a)), and (InOutParam (Maybe a)), -to indicate Out and In/Out paramaters. - -When we do a column buffer bind, we require a dummy value -of the column data type, so that we know which instance to use. --} - -class OdbcBindBuffer a where - bindColBuffer - :: StmtHandle -- ^ stmt handle - -> Int -- ^ column position (1-indexed) - -> Int -- ^ size of result buffer (ignored when it can be inferred from type of a) - -> a -- ^ dummy value of the appropriate type (just to ensure we get the right class instance) - -> IO BindBuffer -- ^ returns a 'BindBuffer' object - getFromBuffer :: BindBuffer -> IO a - getData :: StmtHandle -> Int -> IO a - -instance OdbcBindBuffer (Maybe Int) where - bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeInt (fromIntegral (sizeOfMaybe val)) - getFromBuffer buffer = getStorableFromBuffer buffer - getData stmt pos = getDataStorable stmt pos sqlDTypeInt (sizeOf cint) convert - where convert :: CInt -> Int; convert = fromIntegral - cint :: CInt; cint = 0 - -instance OdbcBindBuffer (Maybe Double) where - bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeDouble (fromIntegral (sizeOfMaybe val)) - getFromBuffer buffer = getStorableFromBuffer buffer - getData stmt pos = getDataStorable stmt pos sqlDTypeDouble (sizeOf cdbl) convert - where convert :: CDouble -> Double; convert = realToFrac - cdbl :: CDouble; cdbl = 0 - -instance OdbcBindBuffer (Maybe String) where - bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeString (fromIntegral size) - getFromBuffer buffer = getUTF8StringFromBuffer buffer - getData stmt pos = getDataUTF8String stmt pos - -instance OdbcBindBuffer (Maybe UTCTime) where - bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeTimestamp #{size TIMESTAMP_STRUCT} - getFromBuffer buffer = getUtcTimeFromBuffer buffer - getData stmt pos = getDataUtcTime stmt pos - - -class OdbcBindParam a where - bindParamBuffer - :: StmtHandle -- ^ stmt handle - -> Int -- ^ parameter position (1-indexed) - -> a -- ^ value to write to buffer - -> IO BindBuffer -- ^ returns a 'BindBuffer' object - -instance OdbcBindParam (Maybe Int) where - bindParamBuffer stmt pos val = do - buffer <- createBufferForStorable val - bindParam stmt pos sqlParamInput sqlCTypeInt sqlDTypeInt 30 0 buffer - return buffer - -instance OdbcBindParam (Maybe Double) where - bindParamBuffer stmt pos val = do - buffer <- createBufferForStorable val - bindParam stmt pos sqlParamInput sqlCTypeDouble sqlDTypeDouble 50 50 buffer - return buffer - -instance OdbcBindParam (Maybe String) where - bindParamBuffer stmt pos val = bindParamUTF8String stmt pos sqlParamInput val - -instance OdbcBindParam (Maybe UTCTime) where - bindParamBuffer stmt pos val = bindParamUtcTime stmt pos sqlParamInput val - - ---------------------------------------------------------------------- --- FFI - --- From sql.h: --- SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); -foreign import #{CALLCONV} unsafe "sql.h SQLAllocHandle" sqlAllocHandle :: - SqlHandleType -> Handle -> Ptr Handle -> IO SqlReturn - --- SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT,SQLHANDLE); -foreign import #{CALLCONV} unsafe "sql.h SQLFreeHandle" sqlFreeHandle :: - SqlSmallInt -> Handle -> IO SqlReturn - --- SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); -foreign import #{CALLCONV} unsafe "sql.h SQLGetDiagRec" sqlGetDiagRec :: - SqlHandleType -- ^ enum: which handle type is the next parameter? - -> Handle -- ^ generic handle ptr - -> SqlSmallInt -- ^ row (or message) number - -> MyCString -- ^ OUT: state - -> Ptr SqlInteger -- ^ OUT: error number - -> MyCString -- ^ OUT: error message - -> SqlSmallInt -- ^ IN: message buffer size - -> Ptr SqlSmallInt -- ^ OUT: message length - -> IO SqlReturn - --- SQLRETURN SQL_API SQLDriverConnect(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); -foreign import #{CALLCONV} unsafe "sql.h SQLDriverConnect" sqlDriverConnect :: - ConnHandle - -> WindowHandle -- ^ just pass nullPtr - -> MyCString -- ^ connection string - -> SqlSmallInt -- ^ connection string size - -> MyCString -- ^ OUT: buffer for normalised connection string - -> SqlSmallInt -- ^ buffer size - -> Ptr SqlSmallInt -- ^ OUT: length of returned string - -> SqlUSmallInt -- ^ enum: should driver prompt user for missing info? - -> IO SqlReturn - --- SQLRETURN SQL_API SQLDisconnect(SQLHDBC); -foreign import #{CALLCONV} unsafe "sql.h SQLDisconnect" sqlDisconnect :: - ConnHandle -> IO SqlReturn - --- SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER); -foreign import #{CALLCONV} unsafe "sql.h SQLSetEnvAttr" sqlSetEnvAttr :: - EnvHandle -- ^ Env Handle - -> SqlInteger -- ^ Attribute (enumeration) - -> Ptr () -- ^ value (cast to void*) - -> SqlInteger -- ^ ? - set to 0 - -> IO SqlReturn - --- SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); -foreign import #{CALLCONV} unsafe "sql.h SQLSetConnectAttr" sqlSetConnectAttr :: - ConnHandle -- ^ Connection Handle - -> SqlInteger -- ^ Attribute (enumeration) - -> Ptr () -- ^ value (cast to void*) - -> SqlInteger -- ^ ? - set to 0 - -> IO SqlReturn - --- SQLRETURN SQL_API SQLPrepare(SQLHSTMT,SQLCHAR*,SQLINTEGER); -foreign import #{CALLCONV} unsafe "sql.h SQLPrepare" sqlPrepare :: - StmtHandle -> MyCString -> SqlInteger -> IO SqlReturn - --- SQLRETURN SQL_API SQLExecute(SQLHSTMT); -foreign import #{CALLCONV} unsafe "sql.h SQLExecute" sqlExecute :: - StmtHandle -> IO SqlReturn - --- SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT); -foreign import #{CALLCONV} unsafe "sql.h SQLCloseCursor" sqlCloseCursor :: - StmtHandle -> IO SqlReturn - --- SQLRETURN SQL_API SQLRowCount(SQLHSTMT,SQLLEN*); -foreign import #{CALLCONV} unsafe "sql.h SQLRowCount" sqlRowCount :: - StmtHandle -> Ptr SqlLen -> IO SqlReturn - --- SQLRETURN SQL_API SQLGetData(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); -foreign import #{CALLCONV} unsafe "sql.h SQLGetData" sqlGetData :: - StmtHandle - -> SqlUSmallInt -- ^ column position, 1-indexed - -> SqlDataType -- ^ SQL data type: string, int, long, date, etc - -> Ptr Buffer -- ^ output buffer - -> SqlLen -- ^ output buffer size - -> Ptr SqlLen -- ^ output data size, or -1 (SQL_NULL_DATA) for null - -> IO SqlReturn - --- SQLRETURN SQL_API SQLBindCol(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); -foreign import #{CALLCONV} unsafe "sql.h SQLBindCol" sqlBindCol :: - StmtHandle - -> SqlUSmallInt -- ^ column position, 1-indexed - -> SqlDataType -- ^ SQL data type: string, int, long, date, etc - -> Ptr Buffer -- ^ output buffer - -> SqlLen -- ^ output buffer size - -> Ptr SqlLen -- ^ output data size, or -1 (SQL_NULL_DATA) for null - -> IO SqlReturn - --- SQLRETURN SQL_API SQLFetch(SQLHSTMT); -foreign import #{CALLCONV} unsafe "sql.h SQLFetch" sqlFetch :: - StmtHandle -> IO SqlReturn - --- SQLRETURN SQL_API SQLBindParameter(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); -foreign import #{CALLCONV} unsafe "sql.h SQLBindParameter" sqlBindParameter :: - StmtHandle - -> SqlUSmallInt -- ^ position, 1-indexed - -> SqlParamDirection -- ^ direction: IN, OUT - -> SqlCDataType -- ^ C data type: char, int, long, float, etc - -> SqlDataType -- ^ SQL data type: string, int, long, date, etc - -> SqlULen -- ^ col size (precision) - -> SqlSmallInt -- ^ decimal digits (scale) - -> Ptr Buffer -- ^ input+output buffer - -> SqlLen -- ^ buffer size - -> Ptr SqlLen -- ^ input+output data size, or -1 (SQL_NULL_DATA) for null - -> IO SqlReturn - --- SQLRETURN SQL_API SQLMoreResults(SQLHSTMT); -foreign import #{CALLCONV} unsafe "sql.h SQLMoreResults" sqlMoreResults :: - StmtHandle -> IO SqlReturn - --- SQLRETURN SQL_API SQLEndTran(SQLSMALLINT,SQLHANDLE,SQLSMALLINT); -foreign import #{CALLCONV} unsafe "sql.h SQLEndTran" sqlEndTran :: - SqlSmallInt -> Handle -> SqlSmallInt -> IO SqlReturn ++{-# OPTIONS -ffi #-}+{-# OPTIONS -fglasgow-exts #-}+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}++#ifdef mingw32_HOST_OS+#include <windows.h>+#endif+#include <sql.h>+#include <sqlext.h>++#ifdef mingw32_HOST_OS+#let CALLCONV = "stdcall"+#else+#let CALLCONV = "ccall"+#endif++{-+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcodbc_api_reference.asp+http://www.dbmaker.com.tw/reference/manuals/odbc/odbc_chap_04.html+-}+++-- |+-- Module : Database.ODBC.OdbcFunctions+-- Copyright : (c) 2007 Oleg Kiselyov, Alistair Bayley+-- License : BSD-style+-- Maintainer : oleg@pobox.com, alistair@abayley.org+-- Stability : experimental+-- Portability : non-portable+-- +-- Wrappers for ODBC FFI functions, plus buffer marshaling.++module Database.ODBC.OdbcFunctions where++import Control.Exception+import Control.Monad+import Data.Dynamic+import Data.Time+import Database.Util+import Foreign+import Foreign.C+import Foreign.C.UTF8++data HandleObj = HandleObj+type Handle = Ptr HandleObj+data EnvObj = EnvObj+type EnvHandle = Ptr EnvObj+data ConnObj = ConnObj+type ConnHandle = Ptr ConnObj+data StmtObj = StmtObj+type StmtHandle = Ptr StmtObj+type WindowHandle = Ptr ()+data Buffer = Buffer+type BufferFPtr = ForeignPtr Buffer+type SizeFPtr = ForeignPtr SqlLen++data BindBuffer = BindBuffer+ { bindBufPtr :: BufferFPtr+ , bindBufSzPtr :: SizeFPtr+ , bindBufSize :: SqlLen+ }++type SqlInteger = #{type SQLINTEGER}+type SqlUInteger = #{type SQLUINTEGER}+type SqlSmallInt = #{type SQLSMALLINT}+type SqlUSmallInt = #{type SQLUSMALLINT}+type SqlLen = #{type SQLLEN}+type SqlULen = #{type SQLULEN}+type SqlReturn = SqlSmallInt+type SqlHandleType = SqlSmallInt+type SqlDataType = SqlSmallInt+type SqlCDataType = SqlSmallInt+type SqlParamDirection = SqlSmallInt++-- Return codes from API calls++(+ sqlRcInvalidHandle :+ sqlRcStillExecuting :+ sqlRcSuccess :+ sqlRcSuccessWithInfo :+ sqlRcError :+ sqlRcNeedData :+ sqlRcNoData :+-- []) = [-2,-1,0,1,2,99,100] :: [SqlReturn]+ []) =+ (+ #{const SQL_INVALID_HANDLE} :+ #{const SQL_STILL_EXECUTING} :+ #{const SQL_SUCCESS} :+ #{const SQL_SUCCESS_WITH_INFO} :+ #{const SQL_ERROR} :+ #{const SQL_NEED_DATA} :+ #{const SQL_NO_DATA} :+ []) :: [SqlReturn]++showReturnCode rc+ | rc == #{const SQL_INVALID_HANDLE} = "SQL_INVALID_HANDLE"+ | rc == #{const SQL_STILL_EXECUTING} = "SQL_STILL_EXECUTING"+ | rc == #{const SQL_SUCCESS} = "SQL_SUCCESS"+ | rc == #{const SQL_SUCCESS_WITH_INFO} = "SQL_SUCCESS_WITH_INFO"+ | rc == #{const SQL_ERROR} = "SQL_ERROR"+ | rc == #{const SQL_NEED_DATA} = "SQL_NEED_DATA"+ | rc == #{const SQL_NO_DATA} = "SQL_NO_DATA"+ | otherwise = "UNKNOWN_RETURN_CODE"++-- There are only four handle types in ODBC.++(+ sqlHTypeEnv :+ sqlHTypeConn :+ sqlHTypeStmt :+ sqlHTypeDesc :+-- []) = [1..4] :: [SqlHandleType]+ []) =+ (+ #{const SQL_HANDLE_ENV} :+ #{const SQL_HANDLE_DBC} :+ #{const SQL_HANDLE_STMT} :+ #{const SQL_HANDLE_DESC} :+ []) :: [SqlHandleType]++sqlDriverNoPrompt :: SqlUSmallInt+sqlDriverNoPrompt = #{const SQL_DRIVER_NOPROMPT}++sqlNullTermedString :: SqlInteger+sqlNullTermedString = #{const SQL_NTS}++sqlNullData :: SqlLen+sqlNullData = #{const SQL_NULL_DATA}++sqlTransCommit :: SqlSmallInt+sqlTransCommit = #{const SQL_COMMIT}++sqlTransRollback :: SqlSmallInt+sqlTransRollback = #{const SQL_ROLLBACK}++sqlAutoCommitOn, sqlAutoCommitOff :: SqlInteger+sqlAutoCommitOn = #{const SQL_AUTOCOMMIT_ON}+sqlAutoCommitOff = #{const SQL_AUTOCOMMIT_OFF}++-- These are attribute types, which are passed as the second parameter+-- to sqlSetEnvAttr.++(+ sqlAttrOdbcVersion :+ sqlAttrAutoCommit :+ sqlAttrTxnIsolation :+ []) =+ (+ #{const SQL_ATTR_ODBC_VERSION} :+ #{const SQL_ATTR_AUTOCOMMIT} :+ #{const SQL_ATTR_TXN_ISOLATION} :+ []) :: [SqlInteger]++-- These are attribute values, which are passed as the third parameter+-- to sqlSetEnvAttr. Obviously that must accompany the relevant+-- attribute type.++(+ sqlOvOdbc3 :+ sqlTxnCapable :+ sqlDefaultTxnIsolation :+ sqlTxnIsolationOption :+ sqlTxnReadUncommitted :+ sqlTxnReadCommitted :+ sqlTxnRepeatableRead :+ sqlTxnSerializable :+ []) =+ (+ #{const SQL_OV_ODBC3} : -- 3 (UL)+ #{const SQL_TXN_CAPABLE} : -- 46+ #{const SQL_DEFAULT_TXN_ISOLATION} : -- 26+ #{const SQL_TXN_ISOLATION_OPTION} : -- 72+ #{const SQL_TXN_READ_UNCOMMITTED} : -- 1+ #{const SQL_TXN_READ_COMMITTED} : -- 2+ #{const SQL_TXN_REPEATABLE_READ} : -- 4+ #{const SQL_TXN_SERIALIZABLE} : -- 8+ []) :: [SqlInteger]+++-- ODBC SQL data types+(+ sqlDTypeString :+ sqlDTypeInt :+ sqlDTypeBinary :+ sqlDTypeDouble :+ sqlDTypeDate :+ sqlDTypeTime :+ sqlDTypeTimestamp :+ sqlDTypeCursor :+ []) =+ (+ #{const SQL_CHAR} : -- 1+ #{const SQL_INTEGER} : -- 4+ #{const SQL_BINARY} : -- -2+ #{const SQL_DOUBLE} : -- 8+ #{const SQL_TYPE_DATE} : -- 9+ #{const SQL_TYPE_TIME} : -- 10+ #{const SQL_TYPE_TIMESTAMP} : -- 11+ #{const SQL_CURSOR_TYPE} : -- 6+ []) :: [SqlDataType]++-- host language (C) data types++(+ sqlCTypeString :+ sqlCTypeInt :+ sqlCTypeBinary :+ sqlCTypeDouble :+ sqlCTypeDate :+ sqlCTypeTime :+ sqlCTypeTimestamp :+ []) =+ (+ #{const SQL_C_CHAR} :+ #{const SQL_C_LONG} :+ #{const SQL_C_BINARY} :+ #{const SQL_C_DOUBLE} :+ #{const SQL_C_TYPE_DATE} :+ #{const SQL_C_TYPE_TIME} :+ #{const SQL_C_TYPE_TIMESTAMP} :+ []) :: [SqlCDataType]++{-+#define SQL_C_BINARY SQL_BINARY+#define SQL_C_BIT SQL_BIT+#define SQL_C_BOOKMARK SQL_C_ULONG+#define SQL_C_CHAR SQL_CHAR+#define SQL_C_DATE SQL_DATE+#define SQL_C_DEFAULT 99+#define SQL_C_DOUBLE SQL_DOUBLE+#define SQL_C_FLOAT SQL_REAL+#define SQL_C_LONG SQL_INTEGER+#define SQL_C_SHORT SQL_SMALLINT+#define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET)+#define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET)+#define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET)+#define SQL_C_TIME SQL_TIME+#define SQL_C_TIMESTAMP SQL_TIMESTAMP+#define SQL_C_TINYINT SQL_TINYINT+#define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET)+#define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET)+#define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET)+-}++(+ sqlParamInput :+ sqlParamInputOutput :+ sqlParamOutput :+ sqlParamDefault :+ sqlParamUnknown :+ [] ) =+ (+ #{const SQL_PARAM_INPUT} :+ #{const SQL_PARAM_INPUT_OUTPUT} :+ #{const SQL_PARAM_OUTPUT} :+ #{const SQL_PARAM_TYPE_DEFAULT} :+ #{const SQL_PARAM_TYPE_UNKNOWN} :+ [] ) :: [SqlParamDirection]+++data OdbcException = OdbcException Int String String [OdbcException]+ deriving (Typeable)++instance Show OdbcException where+ show (OdbcException i st s more) = "OdbcException "+ ++ (show i) ++ " " ++ st ++ " " ++ s -- ++ (concat (map showOdbcExMsg more))++-- showOdbcExMsg (OdbcException i st s more) = s++catchOdbc :: IO a -> (OdbcException -> IO a) -> IO a+catchOdbc = catchDyn++throwOdbc :: OdbcException -> a+throwOdbc = throwDyn++-- define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)+sqlSucceeded rc = rc == sqlRcSuccess || rc == sqlRcSuccessWithInfo++type MyCString = CString+type MyCStringLen = CStringLen+myPeekCStringLen p = peekUTF8StringLen p+myWithCString s = withUTF8String s+myWithCStringLen s = withUTF8StringLen s+--myPeekCStringLen p = peekCStringLen p+--myWithCString s = withCString s+--myWithCStringLen s = withCStringLen s++getDiagRec :: SqlReturn -> SqlHandleType -> Handle -> SqlSmallInt -> IO [OdbcException]+getDiagRec retcode htype handle row =+ allocaBytes 6 $ \cstrState -> do+ alloca $ \errorNumPtr -> do+ allocaBytes 1025 $ \cstrMsg -> do+ alloca $ \msgLenPtr -> do+ rc <- sqlGetDiagRec htype handle row cstrState errorNumPtr cstrMsg 1024 msgLenPtr+ --putStrLn ("getDiagRec: rc=" ++ show rc)+ case () of+ _ | rc == sqlRcSuccess -> do+ errnum <- peek errorNumPtr+ state <- myPeekCStringLen (cstrState, 5)+ msglen <- peek msgLenPtr+ --putStrLn ("getDiagRec: msglen=" ++ show msglen)+ msg <- myPeekCStringLen (cstrMsg, fromIntegral msglen)+ --putStrLn ("getDiagRec: msg=" ++ msg)+ more <- getDiagRec retcode htype handle (row+1)+ return ((OdbcException (fromIntegral errnum) state msg []) : more)+ | rc == sqlRcNoData -> return []+ | otherwise -> return [OdbcException (fromIntegral rc) "01000" (showReturnCode retcode) []]++checkError :: SqlReturn -> SqlHandleType -> Handle -> IO ()+checkError rc htype handle =+ when (rc /= sqlRcSuccess && rc /= sqlRcSuccessWithInfo)+ (do+ exs <- getDiagRec rc htype handle 1+ if null exs+ then throwOdbc (OdbcException (fromIntegral rc) "01000"+ ("No error messages for return code " ++ show rc ++ " (" ++ showReturnCode rc ++ ")") [])+ else do+ let (OdbcException i st s _) = head exs+ throwOdbc (OdbcException i st s (tail exs))+ )++allocHdl :: (Storable a) => Handle -> SqlHandleType -> IO a+allocHdl h htype = do+ alloca $ \hptr -> do+ rc <- sqlAllocHandle htype h (castPtr hptr)+ checkError rc htype h+ peek hptr++allocEnv :: IO EnvHandle+allocEnv = allocHdl nullPtr sqlHTypeEnv++allocConn :: EnvHandle -> IO ConnHandle+allocConn env = allocHdl (castPtr env) sqlHTypeConn++allocStmt :: ConnHandle -> IO StmtHandle+allocStmt conn = allocHdl (castPtr conn) sqlHTypeStmt++freeHelper :: SqlHandleType -> Handle -> IO ()+freeHelper htype h = do+ rc <- sqlFreeHandle htype h+ checkError rc htype h++freeEnv :: EnvHandle -> IO ()+freeEnv env = freeHelper sqlHTypeEnv (castPtr env)++freeConn :: ConnHandle -> IO ()+freeConn conn = freeHelper sqlHTypeConn (castPtr conn)++freeStmt :: StmtHandle -> IO ()+freeStmt stmt = freeHelper sqlHTypeStmt (castPtr stmt)++int2Ptr :: SqlInteger -> Ptr ()+int2Ptr i = plusPtr nullPtr (fromIntegral i)++setOdbcVer :: EnvHandle -> IO ()+setOdbcVer env = do+ rc <- sqlSetEnvAttr env sqlAttrOdbcVersion (int2Ptr sqlOvOdbc3) 0+ checkError rc sqlHTypeEnv (castPtr env)++connect :: ConnHandle -> String -> IO String+connect conn connstr = do+ myWithCStringLen connstr $ \(cstr, clen) -> do+ allocaBytes 1000 $ \outConnStr -> do+ alloca $ \ptrOutLen -> do+ rc <- sqlDriverConnect conn nullPtr cstr (fromIntegral clen)+ outConnStr 1000 ptrOutLen sqlDriverNoPrompt+ checkError rc sqlHTypeConn (castPtr conn)+ outLen <- peek ptrOutLen+ myPeekCStringLen (outConnStr, fromIntegral outLen)++disconnect :: ConnHandle -> IO ()+disconnect conn = do+ rc <- sqlDisconnect conn+ checkError rc sqlHTypeConn (castPtr conn)+++prepareStmt :: StmtHandle -> String -> IO ()+prepareStmt stmt sqltext = do+ myWithCString sqltext $ \cstr -> do+ rc <- sqlPrepare stmt cstr sqlNullTermedString+ checkError rc sqlHTypeStmt (castPtr stmt)++executeStmt :: StmtHandle -> IO ()+executeStmt stmt = do+ rc <- sqlExecute stmt+ checkError rc sqlHTypeStmt (castPtr stmt)++closeCursor :: StmtHandle -> IO ()+closeCursor stmt = do+ rc <- sqlCloseCursor stmt+ checkError rc sqlHTypeStmt (castPtr stmt)++rowCount :: StmtHandle -> IO Int+rowCount stmt = do+ alloca $ \rcptr -> do+ rc <- sqlRowCount stmt rcptr+ checkError rc sqlHTypeStmt (castPtr stmt)+ liftM fromIntegral (peek rcptr)++-- | Return 'True' if there are more rows, 'False' if end-of-data.+fetch :: StmtHandle -> IO Bool+fetch stmt = do+ rc <- sqlFetch stmt+ when (rc /= sqlRcNoData)+ (checkError rc sqlHTypeStmt (castPtr stmt))+ return (rc /= sqlRcNoData)++moreResults :: StmtHandle -> IO Bool+moreResults stmt = do+ rc <- sqlMoreResults stmt+ when (rc /= sqlRcNoData)+ (checkError rc sqlHTypeStmt (castPtr stmt))+ return (rc /= sqlRcNoData)+++commit :: ConnHandle -> IO ()+commit conn = do+ rc <- sqlEndTran sqlHTypeConn (castPtr conn) sqlTransCommit+ checkError rc sqlHTypeConn (castPtr conn)++rollback :: ConnHandle -> IO ()+rollback conn = do+ rc <- sqlEndTran sqlHTypeConn (castPtr conn) sqlTransRollback+ checkError rc sqlHTypeConn (castPtr conn)++setAutoCommitOn :: ConnHandle -> IO ()+setAutoCommitOn conn = do+ rc <- sqlSetConnectAttr conn sqlAttrAutoCommit (int2Ptr sqlAutoCommitOn) 0+ checkError rc sqlHTypeConn (castPtr conn)++setAutoCommitOff :: ConnHandle -> IO ()+setAutoCommitOff conn = do+ rc <- sqlSetConnectAttr conn sqlAttrAutoCommit (int2Ptr sqlAutoCommitOff) 0+ checkError rc sqlHTypeConn (castPtr conn)++setTxnIsolation :: ConnHandle -> SqlInteger -> IO ()+setTxnIsolation conn level = do+ rc <- sqlSetConnectAttr conn sqlAttrTxnIsolation (int2Ptr level) 0+ checkError rc sqlHTypeConn (castPtr conn)+++---------------------------------------------------------------------+-- Get column values with SQLGetData.+-- These functions will probably not be used much,+-- but we'll keep them in because the ODBC API has them+-- (i.e. for completeness).+-- The OdbcBindBuffer class has a getData function which uses these,+-- if you'd rather.++getMaybeFromBuffer :: Storable a => Ptr SqlLen -> Ptr a -> (Ptr a -> SqlLen -> IO b) -> IO (Maybe b)+getMaybeFromBuffer szptr bptr action = do+ len <- peek szptr+ if len < 0 then return Nothing+ else action bptr len >>= return . Just++getDataStorable :: Storable a => StmtHandle -> Int -> SqlDataType -> Int -> (a -> b) -> IO (Maybe b)+getDataStorable stmt pos sqltype buffersize convert = do+ allocaBytes buffersize $ \bptr -> do+ alloca $ \szptr -> do+ rc <- sqlGetData stmt (fromIntegral pos) sqltype (castPtr bptr) 0 szptr+ checkError rc sqlHTypeStmt (castPtr stmt)+ getMaybeFromBuffer szptr bptr (\buffer len -> peek buffer >>= return . convert )++getDataUtcTime :: StmtHandle -> Int -> IO (Maybe UTCTime)+getDataUtcTime stmt pos = do+ allocaBytes #{size TIMESTAMP_STRUCT} $ \bptr -> do+ alloca $ \szptr -> do+ rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeTimestamp (castPtr bptr) 50 szptr+ checkError rc sqlHTypeStmt (castPtr stmt)+ getMaybeFromBuffer szptr bptr (\buffer len -> readUtcTimeFromMemory buffer >>= return )++getDataCStringLen :: StmtHandle -> Int -> IO (Maybe CStringLen)+getDataCStringLen stmt pos = do+ alloca $ \szptr -> do+ allocaBytes 16 $ \dummyptr -> do+ -- Call GetData with 0-sized buffer to get size information.+ rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeString (castPtr dummyptr) 0 szptr+ when (rc /= sqlRcSuccessWithInfo)+ (checkError rc sqlHTypeStmt (castPtr stmt))+ bufSize <- peek szptr+ let bufSize' = 1 + if bufSize < 0 then 0 else bufSize+ -- Use size information to allocate perfectly-sized buffer.+ allocaBytes (fromIntegral bufSize') $ \bptr -> do+ rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeString (castPtr bptr) bufSize' szptr+ checkError rc sqlHTypeStmt (castPtr stmt)+ len <- peek szptr+ if len < 0 then return Nothing+ else return (Just (castPtr bptr, fromIntegral len))++getDataUTF8String :: StmtHandle -> Int -> IO (Maybe String)+getDataUTF8String stmt pos = do+ mbcstrlen <- getDataCStringLen stmt pos+ case mbcstrlen of+ Nothing -> return Nothing+ Just cstrlen -> peekUTF8StringLen cstrlen >>= return . Just++getDataCString :: StmtHandle -> Int -> IO (Maybe String)+getDataCString stmt pos = do+ mbcstrlen <- getDataCStringLen stmt pos+ case mbcstrlen of+ Nothing -> return Nothing+ Just cstrlen -> peekCStringLen cstrlen >>= return . Just++{- from sqltypes.h. Struct size depends on size of SmallInt etc,+but is 16 bytes on a 32-bit platform. 32 bytes on 64-bit?+typedef struct tagTIMESTAMP_STRUCT {+ SQLSMALLINT year;+ SQLUSMALLINT month;+ SQLUSMALLINT day;+ SQLUSMALLINT hour;+ SQLUSMALLINT minute;+ SQLUSMALLINT second;+ SQLUINTEGER fraction;+} TIMESTAMP_STRUCT;+-}++peekSmallInt :: Ptr a -> Int -> IO SqlSmallInt+peekSmallInt buffer offset = peekByteOff buffer offset+peekUSmallInt :: Ptr a -> Int -> IO SqlUSmallInt+peekUSmallInt buffer offset = peekByteOff buffer offset+peekUInteger :: Ptr a -> Int -> IO SqlUInteger+peekUInteger buffer offset = peekByteOff buffer offset++-- We have to give the Ptr a concrete type, to keep the type-checker+-- happy, but it can be anything. It has to be a Storable type, though.++readUtcTimeFromMemory :: Ptr Word8 -> IO UTCTime+readUtcTimeFromMemory buffer = do+ year <- peekSmallInt buffer #{offset TIMESTAMP_STRUCT, year}+ month <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, month}+ day <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, day}+ hour <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, hour}+ minute <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, minute}+ second <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, second}+ -- Fraction ranges from 0 - 999,999,999,+ frac <- peekUInteger buffer #{offset TIMESTAMP_STRUCT, fraction}+ let secs :: Double; secs = fromIntegral second + (fromIntegral frac / 1000000000.0)+ return (mkUTCTime (fromIntegral year) month day hour minute second)++---------------------------------------------------------------------+-- Return-set column binding.+-- Apparently this is faster than SQLGetData for larger result-sets,+-- because the output buffers do not need to be rebound with+-- every call.+-- Dunno how much difference this'll make in practice. Suck 'n' see.++bindColumnBuffer :: StmtHandle -> Int -> SqlDataType -> SqlLen -> IO BindBuffer+bindColumnBuffer stmt pos dtype size = do+ alloca $ \colPtr -> do+ rc <- sqlNumResultCols stmt colPtr+ checkError rc sqlHTypeStmt (castPtr stmt)+ nc <- peek colPtr+ if (fromIntegral nc) < pos || pos < 1+ then throwOdbc (OdbcException (-1) "01000"+ ("Attempted fetch from invalid column number " ++ show pos) [])+ else do+ buffer <- createEmptyBuffer (fromIntegral size)+ withForeignPtr (bindBufPtr buffer) $ \bptr -> do+ withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do+ rc <- sqlBindCol stmt (fromIntegral pos) dtype bptr size szptr+ checkError rc sqlHTypeStmt (castPtr stmt)+ return buffer++createEmptyBuffer :: SqlLen -> IO BindBuffer+createEmptyBuffer size = do+ szfptr <- mallocForeignPtr+ bfptr <- mallocForeignPtrBytes (fromIntegral size)+ return (BindBuffer bfptr szfptr size)+++testForNull :: BindBuffer -> (Ptr Buffer -> SqlLen -> IO a) -> IO (Maybe a)+testForNull buffer action = do+ withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do+ len <- peek szptr+ -- sqlNullData = -1, so anthing less than zero could+ -- be treated as null.+ if len < 0 then return Nothing+ else withForeignPtr (bindBufPtr buffer) $ \bptr ->+ action bptr len >>= return . Just++getStorableFromBuffer :: Storable a => BindBuffer -> IO (Maybe a)+getStorableFromBuffer buffer =+ testForNull buffer (\bptr _ -> peek (castPtr bptr))++getCAStringFromBuffer :: BindBuffer -> IO (Maybe String)+getCAStringFromBuffer buffer =+ testForNull buffer (\ptr len -> peekCAStringLen (castPtr ptr, fromIntegral len))++getCWStringFromBuffer :: BindBuffer -> IO (Maybe String)+getCWStringFromBuffer buffer =+ testForNull buffer (\ptr len -> peekCWStringLen (castPtr ptr, fromIntegral len))++getUTF8StringFromBuffer :: BindBuffer -> IO (Maybe String)+getUTF8StringFromBuffer buffer =+ testForNull buffer (\ptr len -> peekUTF8StringLen (castPtr ptr, fromIntegral len))++getUtcTimeFromBuffer :: BindBuffer -> IO (Maybe UTCTime)+getUtcTimeFromBuffer bindbuffer = do+ testForNull bindbuffer $ \buffer _ -> do+ readUtcTimeFromMemory (castPtr buffer)+++---------------------------------------------------------------------+-- Parameter binding++createBufferForStorable :: Storable a => Maybe a -> IO BindBuffer+createBufferForStorable Nothing =+ let zero :: Int; zero = 0; in createBufferHelper zero (-1)+createBufferForStorable (Just val) = createBufferHelper val (fromIntegral (sizeOf val))++createBufferHelper :: Storable a => a -> SqlLen -> IO BindBuffer+createBufferHelper val size = do+ szfptr <- mallocForeignPtr+ withForeignPtr szfptr (\szptr -> poke szptr size)+ bfptr <- mallocForeignPtr+ withForeignPtr bfptr (\bptr -> poke bptr val)+ return (BindBuffer (castForeignPtr bfptr) szfptr (fromIntegral size))++wrapSizedBuffer :: Ptr a -> SqlLen -> IO BindBuffer+wrapSizedBuffer valptr size = do+ szfptr <- mallocForeignPtr+ withForeignPtr szfptr (\szptr -> poke szptr size)+ bfptr <- newForeignPtr finalizerFree valptr+ return (BindBuffer (castForeignPtr bfptr) szfptr (fromIntegral size))++bindParam ::+ StmtHandle+ -> Int+ -> SqlParamDirection+ -> SqlCDataType+ -> SqlDataType+ -> SqlULen+ -> SqlSmallInt+ -> BindBuffer+ -> IO ()+bindParam stmt pos direction ctype sqltype precision scale buffer =+ withForeignPtr (bindBufPtr buffer) $ \bptr -> do+ withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do+ size <- peek szptr+ rc <- sqlBindParameter stmt (fromIntegral pos) direction ctype sqltype precision scale bptr size szptr+ checkError rc sqlHTypeStmt (castPtr stmt)++bindNull :: StmtHandle -> Int -> SqlParamDirection -> SqlCDataType -> SqlDataType -> IO BindBuffer+bindNull stmt pos direction ctype dtype = do+ let val :: Maybe Int; val = Nothing+ buffer <- createBufferForStorable val+ bindParam stmt pos direction ctype dtype 0 0 buffer+ return buffer++bindParamCStringLen :: StmtHandle -> Int -> SqlParamDirection -> Maybe CStringLen -> IO BindBuffer+bindParamCStringLen stmt pos direction Nothing =+ bindNull stmt pos direction sqlCTypeString sqlDTypeString+bindParamCStringLen stmt pos direction (Just (cstr, clen)) = do+ buffer <- wrapSizedBuffer cstr (fromIntegral clen)+ bindParam stmt pos direction sqlCTypeString sqlDTypeString (fromIntegral clen) 0 buffer+ return buffer++bindEncodedString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> (String -> ((Ptr a, Int) -> IO BindBuffer) -> IO BindBuffer) -> IO BindBuffer+bindEncodedString stmt pos direction Nothing withEncoder =+ bindNull stmt pos direction sqlCTypeString sqlDTypeString+bindEncodedString stmt pos direction (Just s) withEncoder =+ withEncoder s (\(cs, cl) -> bindParamCStringLen stmt pos direction (Just (castPtr cs, cl)))++bindParamUTF8String :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer+bindParamUTF8String stmt pos direction val =+ bindEncodedString stmt pos direction val withUTF8StringLen++bindParamCAString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer+bindParamCAString stmt pos direction val =+ bindEncodedString stmt pos direction val withCAStringLen++bindParamCWString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer+bindParamCWString stmt pos direction val =+ bindEncodedString stmt pos direction val withCWStringLen++pokeSmallInt :: Ptr a -> Int -> SqlSmallInt -> IO ()+pokeSmallInt buffer offset val = pokeByteOff buffer offset val+pokeUSmallInt :: Ptr a -> Int -> SqlUSmallInt -> IO ()+pokeUSmallInt buffer offset val = pokeByteOff buffer offset val+pokeUInteger :: Ptr a -> Int -> SqlUInteger -> IO ()+pokeUInteger buffer offset val = pokeByteOff buffer offset val++writeUTCTimeToMemory :: Ptr Word8 -> UTCTime -> IO ()+writeUTCTimeToMemory buffer utc = do+ let+ (LocalTime ltday time) = utcToLocalTime (hoursToTimeZone 0) utc+ (TimeOfDay hour minute second) = time+ (year, month, day) = toGregorian ltday+ pokeSmallInt buffer #{offset TIMESTAMP_STRUCT, year} (fromIntegral year)+ pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, month} (fromIntegral month)+ pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, day} (fromIntegral day)+ pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, hour} (fromIntegral hour)+ pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, minute} (fromIntegral minute)+ -- what do we do with fraction? What sort of fraction is it?+ -- apparently can range from 0 - 999,999,999,+ -- but MS SQL Server only handles milliseconds (0 - 999) i.e. precision 3+ let (secs, frac) = properFraction second+ let fraction :: SqlUInteger; fraction = round (frac * 1000000000.0)+ pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, second} secs+ pokeUInteger buffer #{offset TIMESTAMP_STRUCT, fraction} fraction++-- writeUTCTimeToMemory and makeUtcTimeBuffer don't work with MS SQL Server;+-- it always returns 22008 "Datetime field overflow".+-- They work with PostgreSQL and Oracle ODBC drivers.+-- So I'll leave the code here, in case anyone is desperate+-- to marshal via TIMESTAMP_STRUCT, rather than strings.++xmakeUtcTimeBuffer :: UTCTime -> IO BindBuffer+xmakeUtcTimeBuffer utc = do+ mem <- mallocBytes #{size TIMESTAMP_STRUCT}+ writeUTCTimeToMemory (castPtr mem) utc+ wrapSizedBuffer mem #{size TIMESTAMP_STRUCT}++-- FIXME why don't we use createBufferHelper here?+-- Is it because we want to give the size of the value,+-- instead of the total buffer size?+makeUtcTimeStringBuffer :: UTCTime -> IO BindBuffer+makeUtcTimeStringBuffer utc = do+ mem <- mallocBytes 50+ let s = utcTimeToOdbcDatetime utc+ withCStringLen s $ \(cstr, clen) -> do+ copyBytes mem cstr (fromIntegral clen)+ pokeByteOff mem (fromIntegral clen) (0 :: Word8)+ wrapSizedBuffer mem (fromIntegral clen)++bindParamUtcTime :: StmtHandle -> Int -> SqlParamDirection -> Maybe UTCTime -> IO BindBuffer+bindParamUtcTime stmt pos direction Nothing = do+ bindNull stmt pos direction sqlCTypeTimestamp sqlDTypeTimestamp+bindParamUtcTime stmt pos direction (Just utc) = do+ -- For TimeStamp:+ -- Size/Length should be 16 bytes.+ -- Precision should be 8 (or 16?).+ -- Scale is the number of digits in the fraction component (SQL Server only allows 0-3).+ -- We're not using the TIMESTAMP_STRUCT to marshal any more.+ --buffer <- makeUtcTimeBuffer utc+ --bindParam stmt pos direction sqlCTypeTimestamp sqlDTypeTimestamp #{size TIMESTAMP_STRUCT} 0 buffer+ --+ -- We have to pass in a String, rather than a TIMESTAMP_STRUCT,+ -- and let the ODBC driver do the conversion.+ -- I cannot get TIMESTAMP_STRUCT to work with MS SQL Server;+ -- it always returns 22008 "Datetime field overflow".+ buffer <- makeUtcTimeStringBuffer utc+ withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do+ size <- peek szptr+ -- 23 is the largest precision value allowed by MS SQL Server.+ -- That gives us "yyyy-mm-dd hh:mm:ss.fff"+ bindParam stmt pos direction sqlCTypeString sqlDTypeTimestamp 23 0 buffer+ return buffer+++---------------------------------------------------------------------+-- Binding with class...++sizeOfMaybe :: forall a. Storable a => Maybe a -> Int+sizeOfMaybe _ = sizeOf ( undefined :: a )+-- H98 stylee...+--sizeOfMaybe v@Nothing = sizeOfMaybe (asTypeOf (Just undefined) v)+--sizeOfMaybe (Just v) = sizeOf v++newtype OutParam a = OutParam a+newtype InOutParam a = InOutParam a++{-+Separate out the type different types of binding: parameter and column.++Both types use the same BindBuffer, but bind parameters+can send and receive values from the buffer, whereas+column binds only receive values.++So we have class OdbcBindBuffer for result set column binds+(data coming out only), and class OdbcBindParam for bind+patrameters that can be both input and output.++We'll have instances for OdbcBindBuffer that are of the form (Maybe a),+where a is one of the normal database types e.g. Int, Double,+String, UTCTime.++The instances for OdbcBindParam will include the (Maybe a) set,+and also (OutParam (Maybe a)), and (InOutParam (Maybe a)),+to indicate Out and In/Out paramaters.++When we do a column buffer bind, we require a dummy value+of the column data type, so that we know which instance to use.+-}++class OdbcBindBuffer a where+ bindColBuffer+ :: StmtHandle -- ^ stmt handle+ -> Int -- ^ column position (1-indexed)+ -> Int -- ^ size of result buffer (ignored when it can be inferred from type of a)+ -> a -- ^ dummy value of the appropriate type (just to ensure we get the right class instance)+ -> IO BindBuffer -- ^ returns a 'BindBuffer' object+ getFromBuffer :: BindBuffer -> IO a+ getData :: StmtHandle -> Int -> IO a++instance OdbcBindBuffer (Maybe Int) where+ bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeInt (fromIntegral (sizeOfMaybe val))+ getFromBuffer buffer = getStorableFromBuffer buffer+ getData stmt pos = getDataStorable stmt pos sqlDTypeInt (sizeOf cint) convert+ where convert :: CInt -> Int; convert = fromIntegral+ cint :: CInt; cint = 0++instance OdbcBindBuffer (Maybe Double) where+ bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeDouble (fromIntegral (sizeOfMaybe val))+ getFromBuffer buffer = getStorableFromBuffer buffer+ getData stmt pos = getDataStorable stmt pos sqlDTypeDouble (sizeOf cdbl) convert+ where convert :: CDouble -> Double; convert = realToFrac+ cdbl :: CDouble; cdbl = 0++instance OdbcBindBuffer (Maybe String) where+ bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeString (fromIntegral size)+ getFromBuffer buffer = getUTF8StringFromBuffer buffer+ getData stmt pos = getDataUTF8String stmt pos++instance OdbcBindBuffer (Maybe UTCTime) where+ --bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeTimestamp #{size TIMESTAMP_STRUCT}+ bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeTimestamp 50+ getFromBuffer buffer = getUtcTimeFromBuffer buffer+ getData stmt pos = getDataUtcTime stmt pos+++class OdbcBindParam a where+ bindParamBuffer+ :: StmtHandle -- ^ stmt handle+ -> Int -- ^ parameter position (1-indexed)+ -> a -- ^ value to write to buffer+ -> IO BindBuffer -- ^ returns a 'BindBuffer' object++bindParamStorable stmt pos val dir ctype dtype precn scale = do+ buffer <- createBufferForStorable val+ bindParam stmt pos dir ctype dtype precn scale buffer+ return buffer++instance OdbcBindParam (Maybe Int) where+ bindParamBuffer stmt pos val =+ bindParamStorable stmt pos val sqlParamInput sqlCTypeInt sqlDTypeInt 30 0++instance OdbcBindParam (OutParam (Maybe Int)) where+ bindParamBuffer stmt pos (OutParam val) =+ bindParamStorable stmt pos val sqlParamOutput sqlCTypeInt sqlDTypeInt 30 0++instance OdbcBindParam (InOutParam (Maybe Int)) where+ bindParamBuffer stmt pos (InOutParam val) =+ bindParamStorable stmt pos val sqlParamInputOutput sqlCTypeInt sqlDTypeInt 30 0++instance OdbcBindParam (Maybe Double) where+ bindParamBuffer stmt pos val =+ bindParamStorable stmt pos val sqlParamInput sqlCTypeDouble sqlDTypeDouble 50 50++instance OdbcBindParam (OutParam (Maybe Double)) where+ bindParamBuffer stmt pos (OutParam val) =+ bindParamStorable stmt pos val sqlParamOutput sqlCTypeDouble sqlDTypeDouble 50 50++instance OdbcBindParam (InOutParam (Maybe Double)) where+ bindParamBuffer stmt pos (InOutParam val) =+ bindParamStorable stmt pos val sqlParamInputOutput sqlCTypeDouble sqlDTypeDouble 50 50++instance OdbcBindParam (Maybe String) where+ bindParamBuffer stmt pos val =+ bindParamUTF8String stmt pos sqlParamInput val++instance OdbcBindParam (OutParam (Maybe String)) where+ bindParamBuffer stmt pos (OutParam val) =+ bindParamUTF8String stmt pos sqlParamOutput val++instance OdbcBindParam (InOutParam (Maybe String)) where+ bindParamBuffer stmt pos (InOutParam val) =+ bindParamUTF8String stmt pos sqlParamInputOutput val++instance OdbcBindParam (Maybe UTCTime) where+ bindParamBuffer stmt pos val =+ bindParamUtcTime stmt pos sqlParamInput val++instance OdbcBindParam (OutParam (Maybe UTCTime)) where+ bindParamBuffer stmt pos (OutParam val) =+ bindParamUtcTime stmt pos sqlParamOutput val++instance OdbcBindParam (InOutParam (Maybe UTCTime)) where+ bindParamBuffer stmt pos (InOutParam val) =+ bindParamUtcTime stmt pos sqlParamInputOutput val+++---------------------------------------------------------------------+-- FFI++-- From sql.h:+-- SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);+foreign import #{CALLCONV} unsafe "sql.h SQLAllocHandle" sqlAllocHandle ::+ SqlHandleType -> Handle -> Ptr Handle -> IO SqlReturn++-- SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT,SQLHANDLE);+foreign import #{CALLCONV} unsafe "sql.h SQLFreeHandle" sqlFreeHandle ::+ SqlSmallInt -> Handle -> IO SqlReturn++-- SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); +foreign import #{CALLCONV} unsafe "sql.h SQLGetDiagRec" sqlGetDiagRec ::+ SqlHandleType -- ^ enum: which handle type is the next parameter?+ -> Handle -- ^ generic handle ptr+ -> SqlSmallInt -- ^ row (or message) number+ -> MyCString -- ^ OUT: state+ -> Ptr SqlInteger -- ^ OUT: error number+ -> MyCString -- ^ OUT: error message+ -> SqlSmallInt -- ^ IN: message buffer size+ -> Ptr SqlSmallInt -- ^ OUT: message length+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLDriverConnect(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);+foreign import #{CALLCONV} unsafe "sql.h SQLDriverConnect" sqlDriverConnect ::+ ConnHandle+ -> WindowHandle -- ^ just pass nullPtr+ -> MyCString -- ^ connection string+ -> SqlSmallInt -- ^ connection string size+ -> MyCString -- ^ OUT: buffer for normalised connection string+ -> SqlSmallInt -- ^ buffer size+ -> Ptr SqlSmallInt -- ^ OUT: length of returned string+ -> SqlUSmallInt -- ^ enum: should driver prompt user for missing info?+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLDisconnect(SQLHDBC);+foreign import #{CALLCONV} unsafe "sql.h SQLDisconnect" sqlDisconnect ::+ ConnHandle -> IO SqlReturn++-- SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER);+foreign import #{CALLCONV} unsafe "sql.h SQLSetEnvAttr" sqlSetEnvAttr ::+ EnvHandle -- ^ Env Handle+ -> SqlInteger -- ^ Attribute (enumeration)+ -> Ptr () -- ^ value (cast to void*)+ -> SqlInteger -- ^ ? - set to 0+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);+foreign import #{CALLCONV} unsafe "sql.h SQLSetConnectAttr" sqlSetConnectAttr ::+ ConnHandle -- ^ Connection Handle+ -> SqlInteger -- ^ Attribute (enumeration)+ -> Ptr () -- ^ value (cast to void*)+ -> SqlInteger -- ^ ? - set to 0+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLPrepare(SQLHSTMT,SQLCHAR*,SQLINTEGER);+foreign import #{CALLCONV} unsafe "sql.h SQLPrepare" sqlPrepare ::+ StmtHandle -> MyCString -> SqlInteger -> IO SqlReturn++-- SQLRETURN SQL_API SQLBindParameter(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);+foreign import #{CALLCONV} unsafe "sql.h SQLBindParameter" sqlBindParameter ::+ StmtHandle+ -> SqlUSmallInt -- ^ position, 1-indexed+ -> SqlParamDirection -- ^ direction: IN, OUT+ -> SqlCDataType -- ^ C data type: char, int, long, float, etc+ -> SqlDataType -- ^ SQL data type: string, int, long, date, etc+ -> SqlULen -- ^ col size (precision)+ -> SqlSmallInt -- ^ decimal digits (scale)+ -> Ptr Buffer -- ^ input+output buffer+ -> SqlLen -- ^ buffer size+ -> Ptr SqlLen -- ^ input+output data size, or -1 (SQL_NULL_DATA) for null+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLExecute(SQLHSTMT);+foreign import #{CALLCONV} unsafe "sql.h SQLExecute" sqlExecute ::+ StmtHandle -> IO SqlReturn++-- SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT,SQLSMALLINT*);+foreign import #{CALLCONV} unsafe "sql.h SQLNumResultCols" sqlNumResultCols ::+ StmtHandle -> Ptr SqlSmallInt -> IO SqlReturn++-- SQLRETURN SQL_API SQLRowCount(SQLHSTMT,SQLLEN*);+foreign import #{CALLCONV} unsafe "sql.h SQLRowCount" sqlRowCount ::+ StmtHandle -> Ptr SqlLen -> IO SqlReturn++-- SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);+foreign import #{CALLCONV} unsafe "sql.h SQLDescribeCol" sqlDescribeCol ::+ StmtHandle+ -> SqlUSmallInt -- ^ position, 1-indexed+ -> MyCString -- ^ buffer for column name+ -> SqlSmallInt -- ^ size of column name buffer+ -> Ptr SqlSmallInt -- ^ size of column name output string+ -> Ptr SqlDataType -- ^ SQL data type: string, int, long, date, etc+ -> Ptr SqlULen -- ^ col size (precision)+ -> Ptr SqlSmallInt -- ^ decimal digits (scale)+ -> Ptr SqlSmallInt -- ^ nullable: SQL_NO_NULLS, SQL_NULLABLE, or SQL_NULLABLE_UNKNOWN+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLBindCol(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);+foreign import #{CALLCONV} unsafe "sql.h SQLBindCol" sqlBindCol ::+ StmtHandle+ -> SqlUSmallInt -- ^ column position, 1-indexed+ -> SqlDataType -- ^ SQL data type: string, int, long, date, etc+ -> Ptr Buffer -- ^ output buffer+ -> SqlLen -- ^ output buffer size+ -> Ptr SqlLen -- ^ output data size, or -1 (SQL_NULL_DATA) for null+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLFetch(SQLHSTMT);+foreign import #{CALLCONV} unsafe "sql.h SQLFetch" sqlFetch ::+ StmtHandle -> IO SqlReturn++-- SQLRETURN SQL_API SQLGetData(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);+foreign import #{CALLCONV} unsafe "sql.h SQLGetData" sqlGetData ::+ StmtHandle+ -> SqlUSmallInt -- ^ column position, 1-indexed+ -> SqlDataType -- ^ SQL data type: string, int, long, date, etc+ -> Ptr Buffer -- ^ output buffer+ -> SqlLen -- ^ output buffer size+ -> Ptr SqlLen -- ^ output data size, or -1 (SQL_NULL_DATA) for null+ -> IO SqlReturn++-- SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT); +foreign import #{CALLCONV} unsafe "sql.h SQLCloseCursor" sqlCloseCursor ::+ StmtHandle -> IO SqlReturn++-- SQLRETURN SQL_API SQLMoreResults(SQLHSTMT);+foreign import #{CALLCONV} unsafe "sql.h SQLMoreResults" sqlMoreResults ::+ StmtHandle -> IO SqlReturn++-- There's no beginTrans - transactions are started implicitly.+-- SQLRETURN SQL_API SQLEndTran(SQLSMALLINT,SQLHANDLE,SQLSMALLINT);+foreign import #{CALLCONV} unsafe "sql.h SQLEndTran" sqlEndTran ::+ SqlSmallInt -> Handle -> SqlSmallInt -> IO SqlReturn
Database/ODBC/Test/Enumerator.lhs view
@@ -142,7 +142,10 @@ > exceptionRollback _ = actionExceptionRollback sqlInsertTest4 sqlExceptionRollback +> iterateeMatchesResultSet _ = actionIterateeMatchesResultSet +> (prefetch 0 sqlIterateeMatchesResultSet [bindP (1::Int), bindP (2.2::Double), bindP "row 1", bindP (3::Int)]) + > testList :: DBLiteralValue a => [a -> DBM mark Session ()] > testList = > [ selectNoRows, selectTerminatesEarly, selectFloatsAndInts @@ -152,4 +155,5 @@ > , selectBindDate, selectBindBoundaryDates, selectRebindStmt > , boundStmtDML, boundStmtDML2 > , polymorphicFetchTest, polymorphicFetchTestNull, exceptionRollback +> , iterateeMatchesResultSet > ]
Database/ODBC/Test/OdbcFunctions.lhs view
@@ -96,6 +96,18 @@ > executeStmt stmt > freeStmt stmt + +> testIsolationLevel conn = do +> -- For PostgreSQL this fails with: +> -- 206 HY009 Illegal parameter value for SQL_TXN_ISOLATION +> --setTxnIsolation conn sqlTxnReadUncommitted +> setTxnIsolation conn sqlTxnReadCommitted -- This is OK +> -- For PostgreSQL this fails with: +> -- 206 HY009 Illegal parameter value for SQL_TXN_ISOLATION +> --setTxnIsolation conn sqlTxnRepeatableRead +> setTxnIsolation conn sqlTxnSerializable -- This is OK + + > testFetchString conn = do > stmt <- allocStmt conn > let string1 = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] @@ -162,7 +174,7 @@ > executeStmt stmt > --buffer <- bindColBuffer stmt 1 sqlDTypeDouble 16 > more <- fetch stmt -> --s <- getDoubleFromBuffer buffer +> --s <- getFromBuffer buffer > s <- getData stmt 1 > let expect :: Double; expect = 123.456789 > assertEqual "testFetchDouble" (Just expect) s @@ -175,15 +187,24 @@ > flip finally (freeStmt stmt) ( do > -- There is no common SQL standard for datetime literal text. > -- Well, there is (timestamp), but MS SQL Server doesn't support it. Pah. -> prepareStmt stmt "select cast ('1916-10-01 02:25:21' as timestamp) from tdual" -> --prepareStmt stmt "select cast ('1916-10-01 02:25:21' as datetime) from tdual" +> -- And Oracle seems to also require a sane NLS setting e.g. +> -- alter session set NLS_TIMESTAMP_FORMAT = 'yyyy-mm-dd hh24:mi:ss' +> --prepareStmt stmt "alter session set NLS_TIMESTAMP_FORMAT = 'yyyy-mm-dd hh24:mi:ss'" +> --executeStmt stmt +> -- +> prepareStmt stmt "select cast ('1916-10-01 02:25:21' as timestamp), cast ('2005-10-01 00:00:00' as timestamp) from tdual" +> --prepareStmt stmt "select cast ('1916-10-01 02:25:21' as datetime), cast ('2005-10-01 00:00:00' as datetime) from tdual" +> --prepareStmt stmt "select cast ('1916-10-01 02:25:21' as timestamp) from tdual" > executeStmt stmt -> let expect :: UTCTime; expect = mkUTCTime 1916 10 1 2 25 21 -> buffer <- bindColBuffer stmt 1 0 (Just expect) +> let expect1 = mkUTCTime 1916 10 1 2 25 21 +> let expect2 = mkUTCTime 2005 10 1 0 0 0 +> buffer1 <- bindColBuffer stmt 1 0 (Just expect1) +> buffer2 <- bindColBuffer stmt 2 0 (Just expect2) > more <- fetch stmt -> t <- getUtcTimeFromBuffer buffer -> --t <- getDataUtcTime stmt 1 -> assertEqual "testFetchDatetime" (Just expect) t +> t1 <- getFromBuffer buffer1 +> t2 <- getFromBuffer buffer2 +> assertEqual "testFetchDatetime1" (Just expect1) t1 +> assertEqual "testFetchDatetime2" (Just expect2) t2 > more <- fetch stmt > assertBool "testFetchDatetime: EOD" (not more) > ) @@ -206,42 +227,29 @@ > testBindString conn = do > stmt <- allocStmt conn > prepareStmt stmt "select ? from tdual" -> let expect = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> let expect = "abcdefghijklmnopqrstuvwxyz" > bindParamBuffer stmt 1 (Just expect) > executeStmt stmt > buffer <- bindColBuffer stmt 1 1000 (Just expect) > more <- fetch stmt > s <- getUTF8StringFromBuffer buffer -> assertEqual "testBindString (PostgreSQL fails this one)" (Just expect) s +> assertEqual "testBindString" (Just expect) s > more <- fetch stmt > assertBool "testBindString: EOD" (not more) > freeStmt stmt -> printBufferContents buffer = do -> withForeignPtr (bindBufPtr buffer) $ \bptr -> do -> withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do -> sz <- peek szptr -> putStrLn ("printBufferContents: sz = " ++ show sz) -> l <- peekArray (fromIntegral sz) (castPtr bptr) -> let toHex :: Word8 -> String; toHex i = showHex i "" -> let h :: [String]; h = map toHex l -> putStrLn (concat (intersperse " " h)) - -> testUTF8 conn = do +> testBindStringUTF8 conn = do > stmt <- allocStmt conn -> prepareStmt stmt "drop table t_utf8" -> ignoreError (executeStmt stmt) -> prepareStmt stmt "create table t_utf8(s varchar(50))" -> executeStmt stmt +> prepareStmt stmt "select ? from tdual" > let expect = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] -> prepareStmt stmt ("insert into t_utf8 values ( '" ++ expect ++ "' )") -> executeStmt stmt -> prepareStmt stmt "select s from t_utf8" +> bindParamBuffer stmt 1 (Just expect) > executeStmt stmt -> buffer <- bindColBuffer stmt 1 100 (Just expect) +> buffer <- bindColBuffer stmt 1 1000 (Just expect) > more <- fetch stmt > s <- getUTF8StringFromBuffer buffer -> assertEqual "testUTF8" (Just expect) s +> assertEqual "testBindStringUTF8 (PostgreSQL fails this one)" (Just expect) s +> more <- fetch stmt +> assertBool "testBindStringUTF8: EOD" (not more) > freeStmt stmt > testBindUTCTime conn = do @@ -260,24 +268,59 @@ > ) +There seems to be a bug with the PostgreSQL ODBC driver, +where, if there is more than one datetime column in the output, +the first column gets the current date (time 00:00:00). + > testBindUTCTimeBoundary conn = do > stmt <- allocStmt conn -> prepareStmt stmt "select ?, ? from tdual" +> prepareStmt stmt "select ?, ?, ?, ? from tdual" > -- 1753 seems to be about the earliest year MS SQL Server supports. -> let expect1 :: UTCTime; expect1 = mkUTCTime 1753 1 1 0 0 0 +> --let expect1 = mkUTCTime 1753 1 1 0 0 0 +> --let expect1 = mkUTCTime 2007 3 11 0 0 0 +> let expect1 = mkUTCTime 2000 10 1 2 25 21 +> --let expect2 = mkUTCTime 2100 10 1 2 25 21 +> let expect2 = "hello2" +> let expect3 = "hello3" +> let expect4 = 444444 :: Int > let input1 = expect1 -> let expect2 :: UTCTime; expect2 = mkUTCTime 9999 10 1 2 25 21 > let input2 = expect2 -> bindParamBuffer stmt 1 (Just input1) -> bindParamBuffer stmt 2 (Just input2) +> let input3 = expect3 +> let input4 = expect4 +> putStrLn "testBindUTCTimeBoundary: data going in:" +> inbuf1 <- bindParamBuffer stmt 1 (Just input1) +> inbuf2 <- bindParamBuffer stmt 2 (Just input2) +> inbuf3 <- bindParamBuffer stmt 3 (Just input3) +> inbuf4 <- bindParamBuffer stmt 4 (Just input4) +> printBufferContents inbuf1 +> printBufferContents inbuf2 +> printBufferContents inbuf3 +> printBufferContents inbuf4 +> putStrLn "------------------------" > executeStmt stmt -> buffer1 <- bindColBuffer stmt 1 32 (Just expect1) -> buffer2 <- bindColBuffer stmt 2 32 (Just expect1) +> buffer1 <- bindColBuffer stmt 1 0 (Just expect1) +> buffer2 <- bindColBuffer stmt 2 0 (Just expect2) +> buffer3 <- bindColBuffer stmt 3 0 (Just expect3) +> buffer4 <- bindColBuffer stmt 4 0 (Just expect4) > more <- fetch stmt -> t1 <- getUtcTimeFromBuffer buffer1 -> t2 <- getUtcTimeFromBuffer buffer2 +> putStrLn "testBindUTCTimeBoundary: data coming out:" +> printBufferContents buffer1 +> printBufferContents buffer2 +> printBufferContents buffer3 +> printBufferContents buffer4 +> putStrLn "testBindUTCTimeBoundary: get1" +> t1 <- getFromBuffer buffer1 +> putStrLn "testBindUTCTimeBoundary: get2" +> t2 <- getFromBuffer buffer2 +> putStrLn "testBindUTCTimeBoundary: get3" +> t3 <- getFromBuffer buffer3 +> putStrLn "testBindUTCTimeBoundary: get4" +> t4 <- getFromBuffer buffer4 +> let x = t1 == Just expect1 > assertEqual "testBindUTCTimeBoundary1" (Just expect1) t1 -> assertEqual "testBindUTCTimeBoundary2" (Just expect2) t2 +> assertEqual "testBindUTCTimeBoundary2 (PostgreSQL fails this one)" (Just expect2) t2 +> assertEqual "testBindUTCTimeBoundary3" (Just expect3) t3 +> assertEqual "testBindUTCTimeBoundary4" (Just expect4) t4 > more <- fetch stmt > assertBool "testBindUTCTimeBoundary: EOD" (not more) > freeStmt stmt @@ -309,17 +352,39 @@ > freeStmt stmt -> testIsolationLevel conn = do -> -- For PostgreSQL this fails with: -> -- 206 HY009 Illegal parameter value for SQL_TXN_ISOLATION -> --setTxnIsolation conn sqlTxnReadUncommitted -> setTxnIsolation conn sqlTxnReadCommitted -- This is OK -> -- For PostgreSQL this fails with: -> -- 206 HY009 Illegal parameter value for SQL_TXN_ISOLATION -> --setTxnIsolation conn sqlTxnRepeatableRead -> setTxnIsolation conn sqlTxnSerializable -- This is OK +> testUTF8 conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "drop table t_utf8" +> ignoreError (executeStmt stmt) +> prepareStmt stmt "create table t_utf8(s varchar(50))" +> executeStmt stmt +> let expect = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> prepareStmt stmt ("insert into t_utf8 values ( '" ++ expect ++ "' )") +> executeStmt stmt +> prepareStmt stmt "select s from t_utf8" +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 100 (Just expect) +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testUTF8" (Just expect) s +> freeStmt stmt +> printBufferContents buffer = do +> withForeignPtr (bindBufPtr buffer) $ \bptr -> do +> withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do +> sz <- peek szptr +> putStrLn ("printBufferContents: sz = " ++ show sz) +> l <- peekArray (fromIntegral sz) (castPtr bptr) +> let +> toHex :: Word8 -> String; +> toHex i = (if i < 16 then "0" else "") ++ showHex i "" +> --let h :: [String]; h = map toHex l +> putStrLn (concat (intersperse " " (map toHex l))) +> let toChar :: Word8 -> String; toChar i = if i > 31 && i < 127 then [chr (fromIntegral i)] else " " +> putStrLn (concat (intersperse " " (map toChar l))) + + > testlist = > testCreateStmt : > testIsolationLevel : @@ -331,6 +396,7 @@ > testFetchDatetime : > testBindInt : > testBindString : +> testBindStringUTF8 : > testBindUTCTime : > testBindUTCTimeBoundary : > testUTF8 :
Database/PostgreSQL/PGFunctions.lhs view
@@ -641,10 +641,14 @@ > colValPtr :: ResultSetHandle -> Int -> Int -> IO (Ptr Word8) > colValPtr rs row col = do -> n <- fPQntuples rs -> if (fromIntegral n) < row || row < 1 +> nr <- fPQntuples rs +> nc <- fPQnfields rs +> if (fromIntegral nr) < row || row < 1 > then throwPG (-1) ("Attempted fetch from invalid row number " ++ show row) -> else fPQgetvalue rs (toCInt (row-1)) (toCInt (col-1)) >>= return . castPtr +> else +> if (fromIntegral nc) < col || col < 1 +> then throwPG (-1) ("Attempted fetch from invalid column number " ++ show col) +> else fPQgetvalue rs (toCInt (row-1)) (toCInt (col-1)) >>= return . castPtr > colVal :: PGType a => ResultSetHandle -> Int -> Int -> IO a > colVal rs row col = colValPtr rs row col >>= pgPeek
Database/PostgreSQL/Test/Enumerator.lhs view
@@ -228,7 +228,14 @@ > ("select count(*)::int4 from " ++ testTable) +Ensure we get an exception if the result-set columns +don't match the output buffers (at present we only +check that there aren't too many buffers +i.e. not enough columns). +> iterateeMatchesResultSet _ = actionIterateeMatchesResultSet +> (prefetch 0 sqlIterateeMatchesResultSet [bindP (1::Int), bindP (2.2::Double), bindP "row 1", bindP (3::Int)]) + > selectUTF8Text _ = do > let iter (s::String) (_::String) = result s > -- GREEK SMALL LETTER PHI : CF86 UTF8, 03C6 UTF16, 966 decimal @@ -343,5 +350,5 @@ > , boundStmtDML, boundStmtDML2 > , polymorphicFetchTest, polymorphicFetchTestNull, exceptionRollback > , selectMultiResultSet, selectNestedMultiResultSet -> , generateErrorMessageTest, selectUTF8Text +> , generateErrorMessageTest, selectUTF8Text, iterateeMatchesResultSet > ]
Database/Sqlite/SqliteFunctions.lhs view
@@ -1,3 +1,4 @@+ > {-# OPTIONS -ffi -fglasgow-exts #-} | @@ -77,6 +78,9 @@ > foreign import ccall "sqlite.h sqlite3_exec" sqliteExec > :: DBHandle -> UTF8CString -> SqliteCallback a -> Ptr a -> Ptr CString -> IO CInt +> foreign import ccall "sqlite.h sqlite3_column_count" sqliteColumnCount +> :: StmtHandle -> IO CInt + > foreign import ccall "sqlite.h sqlite3_step" sqliteStep > :: StmtHandle -> IO CInt @@ -250,27 +254,38 @@ > rc <- sqliteReset stmt > testForError db rc () +> checkColumnRange :: StmtHandle -> Int -> IO () +> checkColumnRange stmt col = do +> nc <- sqliteColumnCount stmt +> if (fromIntegral nc < col) || col < 1 +> then throwSqlite (SqliteException (-1) ("Attempted fetch from invalid column number " ++ show col)) +> else return () + |Column numbers are zero-indexed, so subtract one from given index (we present a one-indexed interface). > colValInt :: StmtHandle -> Int -> IO Int > colValInt stmt colnum = do +> checkColumnRange stmt colnum > cint <- sqliteColumnInt stmt (fromIntegral (colnum - 1)) > return (fromIntegral cint) > colValInt64 :: StmtHandle -> Int -> IO Int64 > colValInt64 stmt colnum = do +> checkColumnRange stmt colnum > cllong <- sqliteColumnInt64 stmt (fromIntegral (colnum - 1)) > return (fromIntegral cllong) > colValDouble :: StmtHandle -> Int -> IO Double > colValDouble stmt colnum = do +> checkColumnRange stmt colnum > cdbl <- sqliteColumnDouble stmt (fromIntegral (colnum - 1)) > return (realToFrac cdbl) > colValString :: StmtHandle -> Int -> IO (Maybe String) > colValString stmt colnum = do +> checkColumnRange stmt colnum > cstrptr <- sqliteColumnText stmt (fromIntegral (colnum - 1)) > if cstrptr == nullPtr > then return Nothing @@ -280,6 +295,7 @@ > colValBlob :: StmtHandle -> Int -> IO (ForeignPtr Blob) > colValBlob stmt colnum = do +> checkColumnRange stmt colnum > let ccolnum = fromIntegral (colnum - 1) > bytes <- sqliteColumnBytes stmt ccolnum > src <- sqliteColumnBlob stmt ccolnum
Database/Test/Enumerator.lhs view
@@ -397,13 +397,15 @@ > actionBoundStmtDML stmt = do > withPreparedStatement stmt $ \pstmt -> do > -- do it twice, to check that prepared stmt can be reused. +> -- Note that with bound statements, the query (or command) +> -- already been executed, so it's too late to begin the transaction. +> beginTransaction Serialisable > withBoundStatement pstmt [bindP (100::Int), bindP "100"] $ \bstmt -> do -> beginTransaction Serialisable > count <- execDML bstmt > rollback > assertEqual sqlBoundStmtDML 1 count +> beginTransaction Serialisable > withBoundStatement pstmt [bindP (100::Int), bindP "100"] $ \bstmt -> do -> beginTransaction Serialisable > count <- execDML bstmt > rollback > assertEqual sqlBoundStmtDML 1 count @@ -451,7 +453,18 @@ > gcatch ( > withTransaction Serialisable $ do > execDML insertStmt -> assertFailure "selectExhaustCursor" +> assertFailure "actionExceptionRollback" > ) (\e -> return () ) > count <- doQuery selectStmt iterExceptionRollback [] > assertEqual sqlExceptionRollback [3] count + +> sqlIterateeMatchesResultSet = "select ?,?,? from tdual" +> --iterMatchesResultSet :: (Monad m) => Int -> Double -> String -> IterAct m [(Int, Double, String)] +> --iterMatchesResultSet i d s acc = result $ (i, d, s):acc +> iterMatchesResultSet :: (Monad m) => Int -> Double -> String -> String -> IterAct m [(Int, Double, String, String)] +> iterMatchesResultSet i d s s2 acc = result $ (i, d, s, s2):acc +> actionIterateeMatchesResultSet stmt = do +> catchDB ( do +> actual <- doQuery stmt iterMatchesResultSet [] +> assertFailure "actionIterateeMatchesResultSet" +> ) (\e -> return () )
Takusen.cabal view
@@ -1,5 +1,5 @@ Name: Takusen -Version: 0.8 +Version: 0.8.1 License: BSD3 License-file: LICENSE Author: Alistair Bayley, Oleg Kiselyov @@ -10,7 +10,7 @@ Package-url: http://darcs.haskell.org/takusen Category: Database Build-Depends: base, mtl, time, old-time -Build-type: Simple +Build-type: Custom Synopsis: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC. Description: Takusen is a DBMS access library. Like HSQL, we support @@ -30,7 +30,6 @@ Currently we fully support ODBC, Oracle, Sqlite, and PostgreSQL. Exposed-modules: Database.Enumerator - , Database.InternalEnumerator , Database.Util , Database.ODBC.Enumerator , Database.ODBC.OdbcFunctions @@ -45,6 +44,7 @@ , Control.Exception.MonadIO , Foreign.C.UTF8 Other-modules: + Database.InternalEnumerator -- We don't expose the Test modules; the only reason to do so would be so Haddock -- can use them (to stop the warnings "could not find link destination for:"), -- and for that they'd have to be in Exposed-modules.
+ c-src/test-libpq/pgdatetest.c view
@@ -0,0 +1,115 @@+#include <stdio.h> +#include <stdlib.h> +/* for ntohl/htonl +#include <winsock.h> +#include <sys/types.h> +*/ +#include "libpq-fe.h" + + +static void exit_nicely(PGconn *conn) +{ + PQfinish(conn); + exit(1); +} + + +void check_sql(PGconn *conn, PGresult *res, ExecStatusType expected) +{ + if (PQresultStatus(res) != expected) + { + fprintf(stderr, "SQL failed: %s", PQerrorMessage(conn)); + PQclear(res); + exit_nicely(conn); + } +} + +void check_cmd(PGconn *conn, PGresult *res) +{ + check_sql(conn, res, PGRES_COMMAND_OK); +} + +void check_qry(PGconn *conn, PGresult *res) +{ + check_sql(conn, res, PGRES_TUPLES_OK); +} + +void revbytes2(int n, char *pfrom, char *pto) +{ + if (n == 0) return; + *pto = *pfrom; + revbytes2(--n, ++pfrom, --pto); +} + +void revbytes(int n, void *pfrom, void *pto) +{ + revbytes2(n, (char*)pfrom, ((char*)pto)+n-1); +} + + +void printColOne(PGresult *res) +{ + double t, *tptr; + tptr = (double *) PQgetvalue(res, 0, 0); + revbytes(8, tptr, &t); + /* t = ntohl(*tptr); -- this doesn't work!? must be me... */ + printf("%f\n", t); +} + + +int main(int argc, char **argv) +{ + const char *conninfo; + PGconn *conn; + PGresult *res; + double t, *tptr; + + /* + * If the user supplies a parameter on the command line, use it as the + * conninfo string; otherwise default to setting dbname=postgres and using + * environment variables or defaults for all other connection parameters. + */ + if (argc > 1) + conninfo = argv[1]; + else + conninfo = "user = postgres"; + + /* Make a connection to the database */ + conn = PQconnectdb(conninfo); + + /* Check to see that the backend connection was successfully made */ + if (PQstatus(conn) != CONNECTION_OK) + { + fprintf(stderr, "Connection to database failed: %s", PQerrorMessage(conn)); + exit_nicely(conn); + } + + res = PQexecParams(conn, "select timestamp with time zone '1916-10-01 02:25:20'" + , 0, NULL, NULL, NULL, NULL, 1 ); + check_qry(conn, res); + printColOne(res); + PQclear(res); + + res = PQexecParams(conn, "select timestamp without time zone '1916-10-01 02:25:20'" + , 0, NULL, NULL, NULL, NULL, 1 ); + check_qry(conn, res); + printColOne(res); + PQclear(res); + + res = PQexecParams(conn, "select timestamp with time zone '1916-10-01 02:25:21'" + , 0, NULL, NULL, NULL, NULL, 1 ); + check_qry(conn, res); + printColOne(res); + PQclear(res); + + res = PQexecParams(conn, "select timestamp without time zone '1916-10-01 02:25:21'" + , 0, NULL, NULL, NULL, NULL, 1 ); + check_qry(conn, res); + printColOne(res); + PQclear(res); + + /* close the connection to the database and cleanup */ + PQfinish(conn); + + return 0; +}
+ c-src/test-libpq/pgldtest.c view
@@ -0,0 +1,114 @@+#include <stdio.h> +#include <stdlib.h> +#include "libpq-fe.h" + +static void exit_nicely(PGconn *conn) +{ + PQfinish(conn); + exit(1); +} + +void check_error(PGconn *conn, PGresult *res, ExecStatusType rc, char *msg) +{ + if (PQresultStatus(res) != rc) + { + /* fprintf(stderr, msg, PQerrorMessage(conn)); */ + fprintf(stderr, "%s: %s\n", msg, PQerrorMessage(conn)); + PQclear(res); + exit_nicely(conn); + } +} + +int main(int argc, char **argv) +{ + const char *conninfo; + PGconn *conn; + PGresult *res; + int nFields; + int i, + j; + Oid paramTypes[10]; + + /* + * If the user supplies a parameter on the command line, use it as the + * conninfo string; otherwise default to setting dbname=postgres and using + * environment variables or defaults for all other connection parameters. + */ + if (argc > 1) + conninfo = argv[1]; + else + conninfo = "dbname = postgres"; + + /* Make a connection to the database */ + conn = PQconnectdb(conninfo); + + /* Check to see that the backend connection was successfully made */ + if (PQstatus(conn) != CONNECTION_OK) + { + fprintf(stderr, "Connection to database failed: %s" + , PQerrorMessage(conn)); + exit_nicely(conn); + } + + /* my test case... */ + res = PQprepare(conn, "x" + , "DECLARE myportal CURSOR FOR select * from pg_database" + , 0, paramTypes); + check_error(conn, res, PGRES_COMMAND_OK, "Prepare failed"); + + /* + * Our test case here involves using a cursor, for which we must be inside + * a transaction block. We could do the whole thing with a single + * PQexec() of "select * from pg_database", but that's too trivial to make + * a good example. + */ + + /* Start a transaction block */ + res = PQexec(conn, "BEGIN"); + check_error(conn, res, PGRES_COMMAND_OK, "BEGIN command failed"); + + /* + * Should PQclear PGresult whenever it is no longer needed to avoid memory + * leaks + */ + PQclear(res); + + /* + * Fetch rows from pg_database, the system catalog of databases + */ + res = PQexec(conn, "DECLARE myportal CURSOR FOR select * from pg_database"); + check_error(conn, res, PGRES_COMMAND_OK, "DECLARE CURSOR failed"); + PQclear(res); + + res = PQexec(conn, "FETCH ALL in myportal"); + check_error(conn, res, PGRES_TUPLES_OK, "FETCH ALL failed"); + + /* first, print out the attribute names */ + nFields = PQnfields(res); + for (i = 0; i < nFields; i++) + printf("%-15s", PQfname(res, i)); + printf("\n\n"); + + /* next, print out the rows */ + for (i = 0; i < PQntuples(res); i++) + { + for (j = 0; j < nFields; j++) + printf("%-15s", PQgetvalue(res, i, j)); + printf("\n"); + } + + PQclear(res); + + /* close the portal ... we don't bother to check for errors ... */ + res = PQexec(conn, "CLOSE myportal"); + PQclear(res); + + /* end the transaction */ + res = PQexec(conn, "END"); + PQclear(res); + + /* close the connection to the database and cleanup */ + PQfinish(conn); + + return 0; +}
+ c-src/test-odbc/test.c view
@@ -0,0 +1,157 @@++#include <stdio.h>+#include <windows.h>+#include <sql.h>+#include <sqlext.h>+++SQLRETURN rc;++void printDiagRecs(SQLHANDLE h, SQLSMALLINT htype, SQLSMALLINT msgSeq)+{+ char strState[6];+ char strMsg[1025];+ SQLINTEGER errNum;+ SQLSMALLINT msgLen;+ SQLRETURN rc2;+ rc2 = SQLGetDiagRec(htype, h, msgSeq, strState, &errNum, strMsg, 1024, &msgLen);+ if (SQL_SUCCESS != rc2)+ {+ strState[7] = '\0';+ strMsg[msgLen+1] = '\0';+ printf("%d %s %s\n", errNum, strState, strMsg);+ printDiagRecs(h, htype, msgSeq+1);+ }+}++void checkRc()+{+ printf("rc = %d\n", rc);+ if (! SQL_SUCCEEDED(rc))+ {+ exit(1);+ }+}++void checkError(SQLRETURN rc, SQLHANDLE h, SQLSMALLINT htype)+{+ printf("checkError: rc = %d\n", rc);+ if (! SQL_SUCCEEDED(rc))+ {+ printDiagRecs(h, htype, 0);+ exit(1);+ }+}+++SQLHANDLE allocHdl(SQLHANDLE parent, SQLSMALLINT htype)+{+ SQLHANDLE ptr;+ rc = SQLAllocHandle(htype, parent, &ptr);+ checkError(rc, parent, htype);+ return ptr;+}++SQLHENV allocEnv() { return allocHdl(NULL, SQL_HANDLE_ENV); }+SQLHDBC allocConn(SQLHENV env) { return allocHdl(env, SQL_HANDLE_DBC); }+SQLHSTMT allocStmt(SQLHDBC conn) { return allocHdl(conn, SQL_HANDLE_STMT); }+++void setOdbcVer(SQLHENV env)+{+ rc = SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC3, 0);+ checkError(rc, env, SQL_HANDLE_ENV);+}+++void odbc_connect(SQLHDBC conn, char* connstr)+{+ char outStr[1000];+ SQLSMALLINT outSz;+ rc = SQLDriverConnect(conn, NULL, connstr, strlen(connstr), outStr, 1000, &outSz, SQL_DRIVER_NOPROMPT);+ checkError(rc, conn, SQL_HANDLE_DBC);+}+++void odbc_disconnect(SQLHDBC conn)+{+ rc = SQLDisconnect(conn);+ checkError(rc, conn, SQL_HANDLE_DBC);+}+++void freeHdl(SQLSMALLINT htype, SQLHANDLE h)+{+ rc = SQLFreeHandle(htype, h);+ checkError(rc, h, htype);+}++void freeEnv(SQLHENV env) { freeHdl(SQL_HANDLE_ENV, env); }+void freeConn(SQLHDBC conn) { freeHdl(SQL_HANDLE_DBC, conn); }+void freeStmt(SQLHSTMT stmt) { freeHdl(SQL_HANDLE_STMT, stmt); }+++void prepareStmt(SQLHSTMT stmt, char* sqltext)+{+ rc = SQLPrepare(stmt, sqltext, SQL_NTS);+ checkError(rc, stmt, SQL_HANDLE_STMT);+}++void bindParamDatetime(SQLHSTMT stmt, SQLUSMALLINT pos, char* val)+{+ SQLLEN inputSz;+ rc = SQLBindParameter(stmt, pos, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_TYPE_TIMESTAMP, 23, 0, val, strlen(val), &inputSz);+ checkError(rc, stmt, SQL_HANDLE_STMT);+}++void executeStmt(SQLHSTMT stmt)+{+ rc = SQLExecute(stmt);+ checkError(rc, stmt, SQL_HANDLE_STMT);+}++void bindCol ()+{+}++SQLHDBC createConn(char *connstr)+{+ SQLHENV env;+ SQLHDBC conn;+ SQLHSTMT stmt;+ printf("allocEnv\n");+ env = allocEnv();+ printf("setOdbcVer\n");+ setOdbcVer(env);+ printf("allocConn\n");+ conn = allocConn(env);+ printf("odbc_connect\n");+ odbc_connect(conn, "DSN=postgres");+ printf("allocStmt\n");+ stmt = allocStmt(conn);+ printf("prepareStmt\n");+ prepareStmt(stmt, "select ?, ?, ?, ?");+ printf("bind param 1\n");+ bindParamDatetime(stmt, 1, "1753-01-01 00:00:00");+ /*+ printf("bind param 2\n");+ bindParamString(stmt, 2, "hello2");+ printf("bind param 3\n");+ bindParamInt(stmt, 3, 4444);+ */+ printf("executeStmt\n");+ executeStmt(stmt);+ printf("freeStmt\n");+ freeStmt(stmt);+ printf("disconnect\n");+ odbc_disconnect(conn);+ printf("freeConn\n");+ freeConn(conn);+ printf("freeEnv\n");+ freeEnv(env);+}++int main(int argc, char** argv)+{+ createConn("DSN=postgres");+}
+ doc/html/Database-InternalEnumerator.html view
@@ -0,0 +1,3459 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.InternalEnumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>Takusen-0.8: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC.</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.InternalEnumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="#1" +>Session object. +</A +></DT +><DT +><A HREF="#2" +>Exceptions and handlers +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>This is the interface between the middle Enumerator layer and the + low-level, Database-specific layer. This file is not exported to the end user. +</P +><P +>Only the programmer for a new back-end needs to consult this file. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AISession" +>ISession</A +> sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3Adisconnect" +>disconnect</A +> :: sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbeginTransaction" +>beginTransaction</A +> :: sess -> <A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acommit" +>commit</A +> :: sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arollback" +>rollback</A +> :: sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3AConnectA" +>ConnectA</A +> sess = <A HREF="#v%3AConnectA" +>ConnectA</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> sess)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AStatement" +>Statement</A +> stmt sess q | stmt sess -> q <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeQuery" +>makeQuery</A +> :: sess -> stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> q</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3ACommand" +>Command</A +> stmt sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecuteCommand" +>executeCommand</A +> :: sess -> stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AEnvInquiry" +>EnvInquiry</A +> inquirykey sess result | inquirykey sess -> result <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3Ainquire" +>inquire</A +> :: inquirykey -> sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> result</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3APreparationA" +>PreparationA</A +> sess stmt = <A HREF="#v%3APreparationA" +>PreparationA</A +> (sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> stmt)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AIPrepared" +>IPrepared</A +> stmt sess bound_stmt bo | stmt -> bound_stmt, stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindRun" +>bindRun</A +> :: sess -> stmt -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo] -> (bound_stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdestroyStmt" +>destroyStmt</A +> :: sess -> stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3ABindA" +>BindA</A +> sess stmt bo = <A HREF="#v%3ABindA" +>BindA</A +> (sess -> stmt -> bo)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3ADBBind" +>DBBind</A +> a sess stmt bo | stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindP" +>bindP</A +> :: a -> <A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AIsolationLevel" +>IsolationLevel</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3AReadUncommitted" +>ReadUncommitted</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AReadCommitted" +>ReadCommitted</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ARepeatableRead" +>RepeatableRead</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ASerialisable" +>Serialisable</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ASerializable" +>Serializable</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3APosition" +>Position</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AIQuery" +>IQuery</A +> q sess b | q -> sess, q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AfetchOneRow" +>fetchOneRow</A +> :: q -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcurrentRowNum" +>currentRowNum</A +> :: q -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfreeBuffer" +>freeBuffer</A +> :: q -> b -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdestroyQuery" +>destroyQuery</A +> :: q -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3ADBType" +>DBType</A +> a q b | q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AallocBufferFor" +>allocBufferFor</A +> :: a -> q -> <A HREF="Database-InternalEnumerator.html#t%3APosition" +>Position</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> b</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfetchCol" +>fetchCol</A +> :: q -> b -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowIfDBNull" +>throwIfDBNull</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Control-Monad.html#t%3AMonad" +>Monad</A +> m => m (<A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +>, <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +>) -> m (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) -> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADBException" +>DBException</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ADBError" +>DBError</A +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBFatal" +>DBFatal</A +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBUnexpectedNull" +>DBUnexpectedNull</A +> <A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +> <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBNoData" +>DBNoData</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowDB" +>throwDB</A +> :: <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +> -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AColNum" +>ColNum</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ARowNum" +>RowNum</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlState" +>SqlState</A +> = (<A HREF="Database-InternalEnumerator.html#t%3ASqlStateClass" +>SqlStateClass</A +>, <A HREF="Database-InternalEnumerator.html#t%3ASqlStateSubClass" +>SqlStateSubClass</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlStateClass" +>SqlStateClass</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlStateSubClass" +>SqlStateSubClass</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="1" +>Session object. +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3AISession" +></A +><B +>ISession</B +> sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>The <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> class describes a database session to a particular + DBMS. Oracle has its own Session object, SQLite has its own + session object (which maintains the connection handle to the database + engine and other related stuff). Session objects for different databases + normally have different types -- yet they all belong to the class ISession + so we can do generic operations like <TT +>commit</TT +>, <TT +>execDDL</TT +>, etc. + in a database-independent manner. +</P +><P +>Session objects per se are created by database connection/login functions. +</P +><P +>The class <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> is thus an interface between low-level (and + database-specific) code and the Enumerator, database-independent + code. + The <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> class is NOT visible to the end user -- neither the class, + nor any of its methods. +</P +><P +>The <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> class describes the mapping from connection object to + the session object. The connection object is created by the end user + (and this is how the end user tells which particular back end he wants). + The session object is not accessible by the end user in any way. + Even the type of the session object should be hidden! +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3Adisconnect" +></A +><B +>disconnect</B +> :: sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbeginTransaction" +></A +><B +>beginTransaction</B +> :: sess -> <A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acommit" +></A +><B +>commit</B +> :: sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Arollback" +></A +><B +>rollback</B +> :: sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ISession')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:ISession" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3AConnectA" +></A +><B +>ConnectA</B +> sess</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A wrapper around the action to open the database. That wrapper is not + exported to the end user. The only reason for the wrapper is to + guarantee that the only thing to do with the result of + <TT +><A HREF="Database-Enumerator-Sqlite.html#v%3Aconnect" +>connect</A +></TT +> function is to pass it out + directly to <TT +><A HREF="Database-Enumerator.html#v%3AwithSession" +>withSession</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AConnectA" +></A +><B +>ConnectA</B +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> sess)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ConnectA')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:ConnectA" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +>??? sess => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> (<A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AStatement" +></A +><B +>Statement</B +> stmt sess q | stmt sess -> q <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><TT +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +></TT +> defines the API for query objects i.e. + which types can be queries. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeQuery" +></A +><B +>makeQuery</B +> :: sess -> stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> q</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Statement')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Statement" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> StmtBind <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> StmtBind <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3ACommand" +></A +><B +>Command</B +> stmt sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><TT +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +></TT +> is not a query: command deletes or updates rows, creates/drops + tables, or changes database state. + <TT +><A HREF="Database-InternalEnumerator.html#v%3AexecuteCommand" +>executeCommand</A +></TT +> returns the number of affected rows (or 0 if DDL i.e. not DML). +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AexecuteCommand" +></A +><B +>executeCommand</B +> :: sess -> stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Command')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Command" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> CommandBind <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> CommandBind <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryStringTuned <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> StmtBind <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> StmtBind <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AEnvInquiry" +></A +><B +>EnvInquiry</B +> inquirykey sess result | inquirykey sess -> result <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3Ainquire" +></A +><B +>inquire</B +> :: inquirykey -> sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> result</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:EnvInquiry')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:EnvInquiry" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AEnvInquiry" +>EnvInquiry</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ALastInsertRowid" +>LastInsertRowid</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3APreparationA" +></A +><B +>PreparationA</B +> sess stmt</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>This type is not visible to the end user (cf. ConnectA). It forms a private + `communication channel' between Database.Enumerator and a back end. +</P +><P +>Why don't we make a user-visible class with a <TT +>prepare</TT +> method? + Because it means to standardize the preparation method signature + across all databases. Some databases need more parameters, some + fewer. There may be several statement preparation functions within one + database. So, instead of standardizing the signature of the + preparation function, we standardize on the _result_ of that + function. To be more precise, we standardize on the properties of the + result: whatever it is, the eventual prepared statement should be + suitable to be passed to <TT +><A HREF="Database-InternalEnumerator.html#v%3AbindRun" +>bindRun</A +></TT +>. +</P +></TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APreparationA" +></A +><B +>PreparationA</B +> (sess -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> stmt)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AIPrepared" +></A +><B +>IPrepared</B +> stmt sess bound_stmt bo | stmt -> bound_stmt, stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AbindRun" +></A +><B +>bindRun</B +> :: sess -> stmt -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo] -> (bound_stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdestroyStmt" +></A +><B +>destroyStmt</B +> :: sess -> stmt -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IPrepared')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IPrepared" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3ABindA" +></A +><B +>BindA</B +> sess stmt bo</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>The binding object (bo) below is very abstract, on purpose. + It may be |IO a|, it may be String, it may be a function, etc. + The binding object can hold the result of marshalling, + or bo can hold the current counter, etc. + Different databases do things very differently: + compare PostgreSQL and the Stub (which models Oracle). +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ABindA" +></A +><B +>BindA</B +> (sess -> stmt -> bo)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3ADBBind" +></A +><B +>DBBind</B +> a sess stmt bo | stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>The class DBBind is not used by the end-user. + It is used to tie up low-level database access and the enumerator. + A database-specific library must provide a set of instances for DBBind. + The latter are the dual of DBType. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AbindP" +></A +><B +>bindP</B +> :: a -> <A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo</TD +></TR +><TR +><TD CLASS="doc" +>This is really just a wrapper that lets us write lists of + heterogenous bind values e.g. <TT +>[bindP "string", bindP (0::Int), ...]</TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBBind')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBBind" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/old-time-1.0.0.0/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/old-time-1.0.0.0/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3AFloat" +>Float</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt64" +>Int64</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt64" +>Int64</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AIsolationLevel" +></A +><B +>IsolationLevel</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AReadUncommitted" +></A +><B +>ReadUncommitted</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AReadCommitted" +></A +><B +>ReadCommitted</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ARepeatableRead" +></A +><B +>RepeatableRead</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ASerialisable" +></A +><B +>Serialisable</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ASerializable" +></A +><B +>Serializable</B +></TD +><TD CLASS="rdoc" +>for alternative spellers +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IsolationLevel')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IsolationLevel" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3APosition" +></A +><B +>Position</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AIQuery" +></A +><B +>IQuery</B +> q sess b | q -> sess, q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>The class IQuery describes the class of query objects. Each + database (that is, each Session object) has its own Query object. + We may assume that a Query object includes (at least, conceptually) + a (pointer to) a Session object, so a Query object determines the + Session object. + A back-end provides an instance (or instances) of IQuery. + The end user never seens the IQuery class (let alone its methods). +</P +><P +>Can a session have several types of query objects? + Let's assume that it can: but a statement plus the session uniquely + determine the query, +</P +><P +>Note that we explicitly use IO monad because we will have to explicitly + do FFI. +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AfetchOneRow" +></A +><B +>fetchOneRow</B +> :: q -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcurrentRowNum" +></A +><B +>currentRowNum</B +> :: q -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfreeBuffer" +></A +><B +>freeBuffer</B +> :: q -> b -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdestroyQuery" +></A +><B +>destroyQuery</B +> :: q -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IQuery')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IQuery" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3ADBType" +></A +><B +>DBType</B +> a q b | q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>A 'buffer' means a column buffer: a data structure that points to a + block of memory allocated for the values of one particular + column. Since a query normally fetches a row of several columns, we + typically deal with a list of column buffers. Although the column data + are typed (e.g., Integer, CalendarDate, etc), column buffers hide that + type. Think of the column buffer as Dynamics. The class DBType below + describes marshalling functions, to fetch a typed value out of the + 'untyped' columnBuffer. +</P +><P +>Different DBMS's (that is, different session objects) have, in + general, columnBuffers of different types: the type of Column Buffer + is specific to a database. + So, ISession (m) uniquely determines the buffer type (b)?? + Or, actually, a query uniquely determines the buffer. +</P +><P +>The class DBType is not used by the end-user. + It is used to tie up low-level database access and the enumerator. + A database-specific library must provide a set of instances for DBType. +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AallocBufferFor" +></A +><B +>allocBufferFor</B +> :: a -> q -> <A HREF="Database-InternalEnumerator.html#t%3APosition" +>Position</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfetchCol" +></A +><B +>fetchCol</B +> :: q -> b -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBType')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBType" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/old-time-1.0.0.0/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/old-time-1.0.0.0/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/old-time-1.0.0.0/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/old-time-1.0.0.0/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3AFloat" +>Float</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt64" +>Int64</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt64" +>Int64</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowIfDBNull" +></A +><B +>throwIfDBNull</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Control-Monad.html#t%3AMonad" +>Monad</A +> m => m (<A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +>, <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +>) -> m (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) -> m a</TD +></TR +><TR +><TD CLASS="doc" +>Used by instances of DBType to throw an exception + when a null (Nothing) is returned. + Will work for any type, as you pass the fetch action in the fetcher arg. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="2" +>Exceptions and handlers +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADBException" +></A +><B +>DBException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ADBError" +></A +><B +>DBError</B +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>DBMS error message. +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBFatal" +></A +><B +>DBFatal</B +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBUnexpectedNull" +></A +><B +>DBUnexpectedNull</B +> <A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +> <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +></TD +><TD CLASS="rdoc" +>the iteratee function used for queries accepts both nullable (Maybe) and + non-nullable types. If the query itself returns a null in a column where a + non-nullable type was specified, we can't handle it, so DBUnexpectedNull is thrown. +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBNoData" +></A +><B +>DBNoData</B +></TD +><TD CLASS="rdoc" +>Thrown by cursor functions if you try to fetch after the end. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowDB" +></A +><B +>throwDB</B +> :: <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +> -> a</TD +></TR +><TR +><TD CLASS="doc" +>Throw a DBException. It's just a type-specific <TT +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Control-Exception.html#v%3AthrowDyn" +>throwDyn</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AColNum" +></A +><B +>ColNum</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ARowNum" +></A +><B +>RowNum</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlState" +></A +><B +>SqlState</B +> = (<A HREF="Database-InternalEnumerator.html#t%3ASqlStateClass" +>SqlStateClass</A +>, <A HREF="Database-InternalEnumerator.html#t%3ASqlStateSubClass" +>SqlStateSubClass</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlStateClass" +></A +><B +>SqlStateClass</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlStateSubClass" +></A +><B +>SqlStateSubClass</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.7</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-ODBC-Enumerator.html view
@@ -0,0 +1,514 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.ODBC.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>Takusen-0.8: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC.</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.ODBC.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>ODBC implementation of Database.Enumerator. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASession" +></A +><B +>Session</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Session')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Session" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> StmtBind <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> StmtBind <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aconnect" +></A +><B +>connect</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareStmt" +></A +><B +>prepareStmt</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApreparePrefetch" +></A +><B +>preparePrefetch</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareQuery" +></A +><B +>prepareQuery</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareLargeQuery" +></A +><B +>prepareLargeQuery</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareCommand" +></A +><B +>prepareCommand</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asql" +></A +><B +>sql</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asqlbind" +></A +><B +>sqlbind</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> StmtBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprefetch" +></A +><B +>prefetch</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> StmtBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acmdbind" +></A +><B +>cmdbind</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-ODBC-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> StmtBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.7</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-ODBC-OdbcFunctions.html view
@@ -0,0 +1,5628 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.ODBC.OdbcFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>Takusen-0.8: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC.</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.ODBC.OdbcFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Wrappers for ODBC FFI functions, plus buffer marshaling. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AHandleObj" +>HandleObj</A +> = <A HREF="#v%3AHandleObj" +>HandleObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AHandle" +>Handle</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandleObj" +>HandleObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AEnvObj" +>EnvObj</A +> = <A HREF="#v%3AEnvObj" +>EnvObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AEnvHandle" +>EnvHandle</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvObj" +>EnvObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AConnObj" +>ConnObj</A +> = <A HREF="#v%3AConnObj" +>ConnObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AConnHandle" +>ConnHandle</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnObj" +>ConnObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AStmtObj" +>StmtObj</A +> = <A HREF="#v%3AStmtObj" +>StmtObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AStmtHandle" +>StmtHandle</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtObj" +>StmtObj</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AWindowHandle" +>WindowHandle</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ABuffer" +>Buffer</A +> = <A HREF="#v%3ABuffer" +>Buffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ABufferFPtr" +>BufferFPtr</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASizeFPtr" +>SizeFPtr</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ABindBuffer" +>BindBuffer</A +> = <A HREF="#v%3ABindBuffer" +>BindBuffer</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindBufPtr" +>bindBufPtr</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindBufSzPtr" +>bindBufSzPtr</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASizeFPtr" +>SizeFPtr</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindBufSize" +>bindBufSize</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlInteger" +>SqlInteger</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt32" +>Int32</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlUInteger" +>SqlUInteger</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord32" +>Word32</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlSmallInt" +>SqlSmallInt</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt16" +>Int16</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord16" +>Word16</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlLen" +>SqlLen</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt32" +>Int32</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlULen" +>SqlULen</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord32" +>Word32</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlReturn" +>SqlReturn</A +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlHandleType" +>SqlHandleType</A +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlDataType" +>SqlDataType</A +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlCDataType" +>SqlCDataType</A +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlParamDirection" +>SqlParamDirection</A +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlDriverNoPrompt" +>sqlDriverNoPrompt</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlNullTermedString" +>sqlNullTermedString</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlNullData" +>sqlNullData</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlTransCommit" +>sqlTransCommit</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlTransRollback" +>sqlTransRollback</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlAutoCommitOn" +>sqlAutoCommitOn</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlAutoCommitOff" +>sqlAutoCommitOff</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AOdbcException" +>OdbcException</A +> = <A HREF="#v%3AOdbcException" +>OdbcException</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> [<A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcatchOdbc" +>catchOdbc</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowOdbc" +>throwOdbc</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +> -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AMyCString" +>MyCString</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AMyCStringLen" +>MyCStringLen</A +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDiagRec" +>getDiagRec</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcheckError" +>checkError</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AallocHdl" +>allocHdl</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AallocEnv" +>allocEnv</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AallocConn" +>allocConn</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AallocStmt" +>allocStmt</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfreeHelper" +>freeHelper</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfreeEnv" +>freeEnv</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfreeConn" +>freeConn</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfreeStmt" +>freeStmt</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aint2Ptr" +>int2Ptr</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetOdbcVer" +>setOdbcVer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aconnect" +>connect</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Adisconnect" +>disconnect</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareStmt" +>prepareStmt</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecuteStmt" +>executeStmt</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcloseCursor" +>closeCursor</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ArowCount" +>rowCount</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Afetch" +>fetch</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmoreResults" +>moreResults</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acommit" +>commit</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arollback" +>rollback</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetAutoCommitOn" +>setAutoCommitOn</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetAutoCommitOff" +>setAutoCommitOff</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetTxnIsolation" +>setTxnIsolation</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetMaybeFromBuffer" +>getMaybeFromBuffer</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> b) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDataStorable" +>getDataStorable</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> (a -> b) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDataUtcTime" +>getDataUtcTime</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDataCStringLen" +>getDataCStringLen</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDataUTF8String" +>getDataUTF8String</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDataCString" +>getDataCString</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApeekSmallInt" +>peekSmallInt</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApeekUSmallInt" +>peekUSmallInt</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApeekUInteger" +>peekUInteger</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUInteger" +>SqlUInteger</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreadUtcTimeFromMemory" +>readUtcTimeFromMemory</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindColumnBuffer" +>bindColumnBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcreateEmptyBuffer" +>createEmptyBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtestForNull" +>testForNull</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetStorableFromBuffer" +>getStorableFromBuffer</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetCAStringFromBuffer" +>getCAStringFromBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetCWStringFromBuffer" +>getCWStringFromBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetUTF8StringFromBuffer" +>getUTF8StringFromBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetUtcTimeFromBuffer" +>getUtcTimeFromBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcreateBufferForStorable" +>createBufferForStorable</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcreateBufferHelper" +>createBufferHelper</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => a -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwrapSizedBuffer" +>wrapSizedBuffer</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParam" +>bindParam</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlCDataType" +>SqlCDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlULen" +>SqlULen</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindNull" +>bindNull</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlCDataType" +>SqlCDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParamCStringLen" +>bindParamCStringLen</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindEncodedString" +>bindEncodedString</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> ((<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +>) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +>) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParamUTF8String" +>bindParamUTF8String</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParamCAString" +>bindParamCAString</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParamCWString" +>bindParamCWString</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApokeSmallInt" +>pokeSmallInt</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApokeUSmallInt" +>pokeUSmallInt</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApokeUInteger" +>pokeUInteger</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUInteger" +>SqlUInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwriteUTCTimeToMemory" +>writeUTCTimeToMemory</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeUtcTimeBuffer" +>makeUtcTimeBuffer</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeUtcTimeStringBuffer" +>makeUtcTimeStringBuffer</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParamUtcTime" +>bindParamUtcTime</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsizeOfMaybe" +>sizeOfMaybe</A +> :: <SPAN CLASS="keyword" +>forall</SPAN +> a . <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3AOutParam" +>OutParam</A +> a = <A HREF="#v%3AOutParam" +>OutParam</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3AInOutParam" +>InOutParam</A +> a = <A HREF="#v%3AInOutParam" +>InOutParam</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AOdbcBindBuffer" +>OdbcBindBuffer</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindColBuffer" +>bindColBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetFromBuffer" +>getFromBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetData" +>getData</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AOdbcBindParam" +>OdbcBindParam</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindParamBuffer" +>bindParamBuffer</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlAllocHandle" +>sqlAllocHandle</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlFreeHandle" +>sqlFreeHandle</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlGetDiagRec" +>sqlGetDiagRec</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlDriverConnect" +>sqlDriverConnect</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AWindowHandle" +>WindowHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlDisconnect" +>sqlDisconnect</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlSetEnvAttr" +>sqlSetEnvAttr</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlSetConnectAttr" +>sqlSetConnectAttr</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlPrepare" +>sqlPrepare</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlExecute" +>sqlExecute</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlCloseCursor" +>sqlCloseCursor</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlRowCount" +>sqlRowCount</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlGetData" +>sqlGetData</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlBindCol" +>sqlBindCol</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlFetch" +>sqlFetch</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlBindParameter" +>sqlBindParameter</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlCDataType" +>SqlCDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlULen" +>SqlULen</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlMoreResults" +>sqlMoreResults</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlEndTran" +>sqlEndTran</A +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AHandleObj" +></A +><B +>HandleObj</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AHandleObj" +></A +><B +>HandleObj</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AHandle" +></A +><B +>Handle</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandleObj" +>HandleObj</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AEnvObj" +></A +><B +>EnvObj</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AEnvObj" +></A +><B +>EnvObj</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AEnvHandle" +></A +><B +>EnvHandle</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvObj" +>EnvObj</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AConnObj" +></A +><B +>ConnObj</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AConnObj" +></A +><B +>ConnObj</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AConnHandle" +></A +><B +>ConnHandle</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnObj" +>ConnObj</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AStmtObj" +></A +><B +>StmtObj</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AStmtObj" +></A +><B +>StmtObj</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AStmtHandle" +></A +><B +>StmtHandle</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtObj" +>StmtObj</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AWindowHandle" +></A +><B +>WindowHandle</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ABuffer" +></A +><B +>Buffer</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ABuffer" +></A +><B +>Buffer</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ABufferFPtr" +></A +><B +>BufferFPtr</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASizeFPtr" +></A +><B +>SizeFPtr</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ABindBuffer" +></A +><B +>BindBuffer</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ABindBuffer" +></A +><B +>BindBuffer</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AbindBufPtr" +></A +><B +>bindBufPtr</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AbindBufSzPtr" +></A +><B +>bindBufSzPtr</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASizeFPtr" +>SizeFPtr</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AbindBufSize" +></A +><B +>bindBufSize</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlInteger" +></A +><B +>SqlInteger</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt32" +>Int32</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlUInteger" +></A +><B +>SqlUInteger</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord32" +>Word32</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlSmallInt" +></A +><B +>SqlSmallInt</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt16" +>Int16</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlUSmallInt" +></A +><B +>SqlUSmallInt</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord16" +>Word16</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlLen" +></A +><B +>SqlLen</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt32" +>Int32</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlULen" +></A +><B +>SqlULen</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord32" +>Word32</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlReturn" +></A +><B +>SqlReturn</B +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlHandleType" +></A +><B +>SqlHandleType</B +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlDataType" +></A +><B +>SqlDataType</B +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlCDataType" +></A +><B +>SqlCDataType</B +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlParamDirection" +></A +><B +>SqlParamDirection</B +> = <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlDriverNoPrompt" +></A +><B +>sqlDriverNoPrompt</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlNullTermedString" +></A +><B +>sqlNullTermedString</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlNullData" +></A +><B +>sqlNullData</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlTransCommit" +></A +><B +>sqlTransCommit</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlTransRollback" +></A +><B +>sqlTransRollback</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlAutoCommitOn" +></A +><B +>sqlAutoCommitOn</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlAutoCommitOff" +></A +><B +>sqlAutoCommitOff</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AOdbcException" +></A +><B +>OdbcException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOdbcException" +></A +><B +>OdbcException</B +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> [<A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +>]</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:OdbcException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:OdbcException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcatchOdbc" +></A +><B +>catchOdbc</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowOdbc" +></A +><B +>throwOdbc</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +> -> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AMyCString" +></A +><B +>MyCString</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AMyCStringLen" +></A +><B +>MyCStringLen</B +> = <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetDiagRec" +></A +><B +>getDiagRec</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcException" +>OdbcException</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcheckError" +></A +><B +>checkError</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AallocHdl" +></A +><B +>allocHdl</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AallocEnv" +></A +><B +>allocEnv</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AallocConn" +></A +><B +>allocConn</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AallocStmt" +></A +><B +>allocStmt</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfreeHelper" +></A +><B +>freeHelper</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfreeEnv" +></A +><B +>freeEnv</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfreeConn" +></A +><B +>freeConn</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfreeStmt" +></A +><B +>freeStmt</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aint2Ptr" +></A +><B +>int2Ptr</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetOdbcVer" +></A +><B +>setOdbcVer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aconnect" +></A +><B +>connect</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Adisconnect" +></A +><B +>disconnect</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareStmt" +></A +><B +>prepareStmt</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexecuteStmt" +></A +><B +>executeStmt</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcloseCursor" +></A +><B +>closeCursor</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArowCount" +></A +><B +>rowCount</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Afetch" +></A +><B +>fetch</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="doc" +>Return <TT +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#v%3ATrue" +>True</A +></TT +> if there are more rows, <TT +><A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#v%3AFalse" +>False</A +></TT +> if end-of-data. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmoreResults" +></A +><B +>moreResults</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acommit" +></A +><B +>commit</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Arollback" +></A +><B +>rollback</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetAutoCommitOn" +></A +><B +>setAutoCommitOn</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetAutoCommitOff" +></A +><B +>setAutoCommitOff</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetTxnIsolation" +></A +><B +>setTxnIsolation</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetMaybeFromBuffer" +></A +><B +>getMaybeFromBuffer</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> b) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetDataStorable" +></A +><B +>getDataStorable</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> (a -> b) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetDataUtcTime" +></A +><B +>getDataUtcTime</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetDataCStringLen" +></A +><B +>getDataCStringLen</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetDataUTF8String" +></A +><B +>getDataUTF8String</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetDataCString" +></A +><B +>getDataCString</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApeekSmallInt" +></A +><B +>peekSmallInt</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApeekUSmallInt" +></A +><B +>peekUSmallInt</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApeekUInteger" +></A +><B +>peekUInteger</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUInteger" +>SqlUInteger</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AreadUtcTimeFromMemory" +></A +><B +>readUtcTimeFromMemory</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindColumnBuffer" +></A +><B +>bindColumnBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcreateEmptyBuffer" +></A +><B +>createEmptyBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtestForNull" +></A +><B +>testForNull</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetStorableFromBuffer" +></A +><B +>getStorableFromBuffer</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetCAStringFromBuffer" +></A +><B +>getCAStringFromBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetCWStringFromBuffer" +></A +><B +>getCWStringFromBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetUTF8StringFromBuffer" +></A +><B +>getUTF8StringFromBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetUtcTimeFromBuffer" +></A +><B +>getUtcTimeFromBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcreateBufferForStorable" +></A +><B +>createBufferForStorable</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcreateBufferHelper" +></A +><B +>createBufferHelper</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => a -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwrapSizedBuffer" +></A +><B +>wrapSizedBuffer</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParam" +></A +><B +>bindParam</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlCDataType" +>SqlCDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlULen" +>SqlULen</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindNull" +></A +><B +>bindNull</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlCDataType" +>SqlCDataType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParamCStringLen" +></A +><B +>bindParamCStringLen</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindEncodedString" +></A +><B +>bindEncodedString</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> ((<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a, <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +>) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +>) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParamUTF8String" +></A +><B +>bindParamUTF8String</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParamCAString" +></A +><B +>bindParamCAString</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParamCWString" +></A +><B +>bindParamCWString</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApokeSmallInt" +></A +><B +>pokeSmallInt</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApokeUSmallInt" +></A +><B +>pokeUSmallInt</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApokeUInteger" +></A +><B +>pokeUInteger</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUInteger" +>SqlUInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwriteUTCTimeToMemory" +></A +><B +>writeUTCTimeToMemory</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeUtcTimeBuffer" +></A +><B +>makeUtcTimeBuffer</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeUtcTimeStringBuffer" +></A +><B +>makeUtcTimeStringBuffer</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParamUtcTime" +></A +><B +>bindParamUtcTime</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsizeOfMaybe" +></A +><B +>sizeOfMaybe</B +> :: <SPAN CLASS="keyword" +>forall</SPAN +> a . <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3AOutParam" +></A +><B +>OutParam</B +> a</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOutParam" +></A +><B +>OutParam</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3AInOutParam" +></A +><B +>InOutParam</B +> a</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AInOutParam" +></A +><B +>InOutParam</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3AOdbcBindBuffer" +></A +><B +>OdbcBindBuffer</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AbindColBuffer" +></A +><B +>bindColBuffer</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +>stmt handle +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>column position (1-indexed) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>size of result buffer (ignored when it can be inferred from type of a) +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>dummy value of the appropriate type (just to ensure we get the right class instance) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +><TD CLASS="rdoc" +>returns a <TT +><A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TT +> object +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetFromBuffer" +></A +><B +>getFromBuffer</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetData" +></A +><B +>getData</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:OdbcBindBuffer')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:OdbcBindBuffer" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindBuffer" +>OdbcBindBuffer</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindBuffer" +>OdbcBindBuffer</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindBuffer" +>OdbcBindBuffer</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindBuffer" +>OdbcBindBuffer</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3AOdbcBindParam" +></A +><B +>OdbcBindParam</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AbindParamBuffer" +></A +><B +>bindParamBuffer</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +>stmt handle +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>parameter position (1-indexed) +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>value to write to buffer +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +><TD CLASS="rdoc" +>returns a <TT +><A HREF="Database-ODBC-OdbcFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TT +> object +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:OdbcBindParam')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:OdbcBindParam" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindParam" +>OdbcBindParam</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Prelude.html#t%3ADouble" +>Double</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindParam" +>OdbcBindParam</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindParam" +>OdbcBindParam</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-ODBC-OdbcFunctions.html#t%3AOdbcBindParam" +>OdbcBindParam</A +> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/time-1.1.2.0/Data-Time-Clock.html#t%3AUTCTime" +>UTCTime</A +>)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlAllocHandle" +></A +><B +>sqlAllocHandle</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlFreeHandle" +></A +><B +>sqlFreeHandle</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlGetDiagRec" +></A +><B +>sqlGetDiagRec</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlHandleType" +>SqlHandleType</A +></TD +><TD CLASS="rdoc" +>enum: which handle type is the next parameter? +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +></TD +><TD CLASS="rdoc" +>generic handle ptr +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>row (or message) number +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +></TD +><TD CLASS="rdoc" +>OUT: state +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +><TD CLASS="rdoc" +>OUT: error number +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +></TD +><TD CLASS="rdoc" +>OUT: error message +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>IN: message buffer size +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>OUT: message length +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlDriverConnect" +></A +><B +>sqlDriverConnect</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AWindowHandle" +>WindowHandle</A +></TD +><TD CLASS="rdoc" +>just pass nullPtr +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +></TD +><TD CLASS="rdoc" +>connection string +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>connection string size +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +></TD +><TD CLASS="rdoc" +>OUT: buffer for normalised connection string +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>buffer size +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>OUT: length of returned string +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +><TD CLASS="rdoc" +>enum: should driver prompt user for missing info? +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlDisconnect" +></A +><B +>sqlDisconnect</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlSetEnvAttr" +></A +><B +>sqlSetEnvAttr</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AEnvHandle" +>EnvHandle</A +></TD +><TD CLASS="rdoc" +>Env Handle +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +><TD CLASS="rdoc" +>Attribute (enumeration) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> ()</TD +><TD CLASS="rdoc" +>value (cast to void*) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +><TD CLASS="rdoc" +>? - set to 0 +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlSetConnectAttr" +></A +><B +>sqlSetConnectAttr</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TD +><TD CLASS="rdoc" +>Connection Handle +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +><TD CLASS="rdoc" +>Attribute (enumeration) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> ()</TD +><TD CLASS="rdoc" +>value (cast to void*) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +></TD +><TD CLASS="rdoc" +>? - set to 0 +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlPrepare" +></A +><B +>sqlPrepare</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AMyCString" +>MyCString</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlInteger" +>SqlInteger</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlExecute" +></A +><B +>sqlExecute</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlCloseCursor" +></A +><B +>sqlCloseCursor</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlRowCount" +></A +><B +>sqlRowCount</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlGetData" +></A +><B +>sqlGetData</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +><TD CLASS="rdoc" +>column position, 1-indexed +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +></TD +><TD CLASS="rdoc" +>SQL data type: string, int, long, date, etc +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +></TD +><TD CLASS="rdoc" +>output buffer +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +>output buffer size +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +>output data size, or -1 (SQL_NULL_DATA) for null +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlBindCol" +></A +><B +>sqlBindCol</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +><TD CLASS="rdoc" +>column position, 1-indexed +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +></TD +><TD CLASS="rdoc" +>SQL data type: string, int, long, date, etc +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +></TD +><TD CLASS="rdoc" +>output buffer +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +>output buffer size +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +>output data size, or -1 (SQL_NULL_DATA) for null +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlFetch" +></A +><B +>sqlFetch</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlBindParameter" +></A +><B +>sqlBindParameter</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlUSmallInt" +>SqlUSmallInt</A +></TD +><TD CLASS="rdoc" +>position, 1-indexed +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlParamDirection" +>SqlParamDirection</A +></TD +><TD CLASS="rdoc" +>direction: IN, OUT +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlCDataType" +>SqlCDataType</A +></TD +><TD CLASS="rdoc" +>C data type: char, int, long, float, etc +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlDataType" +>SqlDataType</A +></TD +><TD CLASS="rdoc" +>SQL data type: string, int, long, date, etc +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlULen" +>SqlULen</A +></TD +><TD CLASS="rdoc" +>col size (precision) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +></TD +><TD CLASS="rdoc" +>decimal digits (scale) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ABuffer" +>Buffer</A +></TD +><TD CLASS="rdoc" +>input+output buffer +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +>buffer size +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlLen" +>SqlLen</A +></TD +><TD CLASS="rdoc" +>input+output data size, or -1 (SQL_NULL_DATA) for null +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlMoreResults" +></A +><B +>sqlMoreResults</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlEndTran" +></A +><B +>sqlEndTran</B +> :: <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3AHandle" +>Handle</A +> -> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlSmallInt" +>SqlSmallInt</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-ODBC-OdbcFunctions.html#t%3ASqlReturn" +>SqlReturn</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.7</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Foreign-C-UTF8.html view
@@ -0,0 +1,523 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Foreign.C.UTF8</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>Takusen-0.8: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC.</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Foreign.C.UTF8</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Marshall Haskell Strings to and from UTF8-encoded CStrings. + This module's code is inspired by John Meacham's UTF8 en- & de-coders, + and also those found in the HXT library (module Text.XML.HXT.DOM.Unicode). +</P +><P +>Note that the -Len functions all return the length in bytes, + not Chars (this is more useful, as you are most likely to want + to pass the length to an FFI function, which is most likely + expecting the length in bytes). If you want the length in Chars, + well, you have the original String, so... +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3ApeekUTF8String" +>peekUTF8String</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApeekUTF8StringLen" +>peekUTF8StringLen</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnewUTF8String" +>newUTF8String</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithUTF8String" +>withUTF8String</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithUTF8StringLen" +>withUTF8StringLen</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoUTF8String" +>toUTF8String</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromUTF8String" +>fromUTF8String</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AlengthUTF8" +>lengthUTF8</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromUTF8" +>fromUTF8</A +> :: [<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +>] -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoUTF8" +>toUTF8</A +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +>]</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApeekUTF8String" +></A +><B +>peekUTF8String</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="doc" +>Analogous to peekCString. Converts UTF8 CString to String. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApeekUTF8StringLen" +></A +><B +>peekUTF8StringLen</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="doc" +>Analogous to peekCStringLen. Converts UTF8 CString to String. + The resulting String will end either when <TT +>len</TT +> bytes + have been converted, or when a NULL is found. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AnewUTF8String" +></A +><B +>newUTF8String</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="doc" +>Analogous to newCString. Creates UTF8 encoded CString. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithUTF8String" +></A +><B +>withUTF8String</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="doc" +>Analogous to withCString. Creates UTF8 encoded CString. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithUTF8StringLen" +></A +><B +>withUTF8StringLen</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="doc" +>Analogous to withCStringLen. + The length returned is in bytes (encoding units), not chars. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtoUTF8String" +></A +><B +>toUTF8String</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="doc" +>Convert a Haskell String into a UTF8 String, where each UTF8 byte + is represented by its Char equivalent i.e. only chars 0-255 are used. + The resulting String can be marshalled to CString directly i.e. with + a Latin-1 encoding. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfromUTF8String" +></A +><B +>fromUTF8String</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="doc" +>Convert a String that was marshalled from a CString without + any decoder applied. This might be useful if the client encoding + is unknown, and the user code must convert. + We assume that the UTF8 CString was marshalled as if Latin-1 + i.e. all chars are in the range 0-255. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AlengthUTF8" +></A +><B +>lengthUTF8</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfromUTF8" +></A +><B +>fromUTF8</B +> :: [<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +>] -> <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="doc" +>Convert UTF-8 to Unicode. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtoUTF8" +></A +><B +>toUTF8</B +> :: <A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="file:///c:/ghc/ghc-6.8.1/doc/libraries/base-3.0.0.0/Data-Word.html#t%3AWord8" +>Word8</A +>]</TD +></TR +><TR +><TD CLASS="doc" +>Convert Unicode characters to UTF-8. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.7</TD +></TR +></TABLE +></BODY +></HTML +>