Copyright | (c) Daniel YU |
---|---|
License | BSD3 |
Maintainer | leptonyu@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Database.Dpi
Contents
Description
FFI raw bindings to ODPI-C
- createContext :: IO PtrContext
- destroyContext :: PtrContext -> IO Bool
- withContext :: (PtrContext -> IO a) -> IO a
- getClientVersion :: PtrContext -> IO Data_VersionInfo
- getContextError :: PtrContext -> IO Data_ErrorInfo
- throwContextError :: PtrContext -> IO a
- createConnection :: PtrContext -> ByteString -> ByteString -> ByteString -> (Data_CommonCreateParams -> Data_CommonCreateParams) -> IO PtrConn
- closeConnection :: ConnCloseMode -> PtrConn -> IO Bool
- releaseConnection :: PtrConn -> IO Bool
- pingConnection :: PtrConn -> IO Bool
- withConnection :: PtrContext -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> (PtrConn -> IO a) -> IO a
- beginTransaction :: PtrConn -> Int64 -> ByteString -> ByteString -> IO Bool
- prepareTransaction :: PtrConn -> IO Bool
- commitConnection :: PtrConn -> IO Bool
- rollbackConnection :: PtrConn -> IO Bool
- getCurrentSchema :: PtrConn -> IO ByteString
- getEdition :: PtrConn -> IO ByteString
- getExternalName :: PtrConn -> IO ByteString
- getInternalName :: PtrConn -> IO ByteString
- getLTXID :: PtrConn -> IO ByteString
- getServerVersion :: PtrConn -> IO (ByteString, Data_VersionInfo)
- getObjectType :: PtrConn -> ByteString -> IO PtrObjectType
- getEncodingInfo :: PtrConn -> IO Data_EncodingInfo
- getStmtCacheSize :: PtrConn -> IO Int
- createStatement :: PtrConn -> Bool -> ByteString -> IO PtrStmt
- closeStatement :: PtrStmt -> IO Bool
- releaseStatement :: PtrStmt -> IO Bool
- withStatement :: PtrConn -> Bool -> ByteString -> (PtrStmt -> IO a) -> IO a
- scrollStatement :: PtrStmt -> FetchMode -> Int -> IO Bool
- bindByName :: PtrStmt -> ByteString -> PtrVar -> IO Bool
- bindByPosition :: PtrStmt -> Int -> PtrVar -> IO Bool
- bindValueByName :: PtrStmt -> ByteString -> NativeTypeNum -> PtrData -> IO Bool
- bindValueByPosition :: PtrStmt -> Int -> NativeTypeNum -> PtrData -> IO Bool
- define :: PtrStmt -> Int -> PtrVar -> IO Bool
- defineValue :: PtrStmt -> Int -> OracleTypeNum -> NativeTypeNum -> Int -> Bool -> PtrObjectType -> IO Bool
- getBindCount :: PtrStmt -> IO Int
- getBindNames :: PtrStmt -> IO [ByteString]
- getStatementInfo :: PtrStmt -> IO Data_StmtInfo
- getFetchArraySize :: PtrStmt -> IO Int
- setFetchArraySize :: PtrStmt -> Int -> IO Bool
- getImplicitResult :: PtrStmt -> IO (Maybe PtrStmt)
- getNumberQueryColumns :: PtrStmt -> IO Int
- getQueryInfo :: PtrStmt -> Int -> IO Data_QueryInfo
- getQueryValue :: PtrStmt -> Int -> IO DataValue
- executeStatement :: PtrStmt -> ExecMode -> IO Int
- executeMany :: PtrStmt -> ExecMode -> Int -> IO Bool
- fetch :: PtrStmt -> IO (Maybe PageOffset)
- type PageOffset = Int64
- type PageLimit = Int64
- type Page = (PageOffset, PageLimit)
- type FetchRows a = PtrStmt -> Page -> IO a
- fetchRows :: PtrStmt -> Int -> IO (Bool, [DataValue])
- getRowCount :: PtrStmt -> IO Int
- getRowCounts :: PtrStmt -> IO [Int]
- getSubscrQueryId :: PtrStmt -> IO Word64
- getBatchErrorCount :: PtrStmt -> IO Int
- getBatchErrors :: PtrStmt -> IO [Data_ErrorInfo]
- newTempLob :: PtrConn -> OracleTypeNum -> IO PtrLob
- closeLob :: PtrLob -> IO Bool
- closeLobResource :: PtrLob -> IO Bool
- copyLob :: PtrLob -> IO PtrLob
- flushLob :: PtrLob -> IO Bool
- getLobBufferSize :: PtrLob -> Word64 -> IO Word64
- getLobChunkSize :: PtrLob -> IO Int64
- getLobDirectoryAndFileName :: PtrLob -> IO (FilePath, String)
- setLobDirectoryAndFileName :: PtrLob -> (FilePath, String) -> IO Bool
- lobFileExists :: PtrLob -> IO Bool
- isLobResourceOpen :: PtrLob -> IO Bool
- getLobSize :: PtrLob -> IO Int64
- openLobResource :: PtrLob -> IO Bool
- releaseLob :: PtrLob -> IO Bool
- trimLob :: PtrLob -> Int64 -> IO Bool
- setLobFromBytes :: PtrLob -> ByteString -> IO Bool
- type BufferSize = Int64
- readLobBytes :: PtrLob -> Page -> BufferSize -> IO ByteString
- writeLobBytes :: PtrLob -> PageOffset -> ByteString -> IO Bool
- objectAppendElement :: PtrObject -> NativeTypeNum -> PtrData -> IO Bool
- copyObject :: PtrObject -> IO PtrObject
- releaseObject :: PtrObject -> IO Bool
- trimObject :: PtrObject -> Int -> IO Bool
- objectDeleteElementByIndex :: PtrObject -> Int -> IO Bool
- objectSetAttributeValue :: PtrObject -> PtrObjectAttr -> DataValue -> IO Bool
- objectGetAttributeValue :: PtrObject -> PtrObjectAttr -> NativeTypeNum -> IO DataValue
- objectGetElementExistsByIndex :: PtrObject -> Int -> IO Bool
- objectSetElementValueByIndex :: PtrObject -> Int -> DataValue -> IO Bool
- objectGetElementValueByIndex :: PtrObject -> Int -> NativeTypeNum -> IO DataValue
- objectGetFirstIndex :: PtrObject -> IO (Maybe Int)
- objectGetLastIndex :: PtrObject -> IO (Maybe Int)
- objectGetNextIndex :: Int -> PtrObject -> IO (Maybe Int)
- objectGetPrevIndex :: Int -> PtrObject -> IO (Maybe Int)
- getObjectSize :: PtrObject -> IO Int
- getObjectAttrInfo :: PtrObjectAttr -> IO Data_ObjectAttrInfo
- objectAttrAddRef :: PtrObjectAttr -> IO Bool
- releaseObjectAttr :: PtrObjectAttr -> IO Bool
- objectTypeAddRef :: PtrObjectType -> IO Bool
- createObjectByType :: PtrObjectType -> IO PtrObject
- objectTypeGetAttributes :: PtrObjectType -> Int -> IO PtrObjectAttr
- objectTypeGetInfo :: PtrObjectType -> IO Data_ObjectTypeInfo
- releaseObjectType :: PtrObjectType -> IO Bool
- rowidAddRef :: PtrRowid -> IO Bool
- releaseRowid :: PtrRowid -> IO Bool
- rowidGetStringValue :: PtrRowid -> IO ByteString
- newVar :: PtrConn -> OracleTypeNum -> NativeTypeNum -> Int -> Int -> Bool -> Bool -> PtrObjectType -> IO (PtrVar, [PtrData])
- varAddRef :: PtrVar -> IO Bool
- copyVar :: PtrVar -> Int -> PtrVar -> Int -> IO Bool
- varGetData :: PtrVar -> IO [Data]
- varGetNumberOfElements :: PtrVar -> IO Int
- varGetSizeInBytes :: PtrVar -> IO Int
- releaseVar :: PtrVar -> IO Bool
- setVarFromBytes :: PtrVar -> Int -> ByteString -> IO Bool
- setVarFromLob :: PtrVar -> Int -> PtrLob -> IO Bool
- setVarFromObject :: PtrVar -> Int -> PtrObject -> IO Bool
- setVarFromRowid :: PtrVar -> Int -> PtrRowid -> IO Bool
- setVarFromStatement :: PtrVar -> Int -> PtrStmt -> IO Bool
- setVarNumberOfElements :: PtrVar -> Int -> IO Bool
- data DpiException
- = ErrorInfoException Data_ErrorInfo
- | VersionInfoNotFound
- | ConnectionCreateFailed Data_ErrorInfo
- | StatementCreateFailed
- | ConnectionPropNotFound ByteString
- | StatementExecuteFailed
- | StatementFetchFailed
- | StatementFetchRowFailed
- | StatementGetBatchErrorFailed
- | StatementGetBindFailed
- | LobOperateFailed
- | ObjectOperateFailed
- | TransactionPrepareFailed
- data AuthMode
- data ConnCloseMode
- data CreateMode
- data DeqMode
- data DeqNavigation
- data EventType
- data ExecMode
- data FetchMode
- data MessageDeliveryMode
- data MessageState
- data NativeTypeNum
- data OpCode
- data OracleTypeNum
- = OracleTypeNone
- | OracleTypeVarchar
- | OracleTypeNvarchar
- | OracleTypeChar
- | OracleTypeNchar
- | OracleTypeRowid
- | OracleTypeRaw
- | OracleTypeNativeFloat
- | OracleTypeNativeDouble
- | OracleTypeNativeInt
- | OracleTypeNumber
- | OracleTypeDate
- | OracleTypeTimestamp
- | OracleTypeTimestampTz
- | OracleTypeTimestampLtz
- | OracleTypeIntervalDs
- | OracleTypeIntervalYm
- | OracleTypeClob
- | OracleTypeNclob
- | OracleTypeBlob
- | OracleTypeBfile
- | OracleTypeStmt
- | OracleTypeBoolean
- | OracleTypeObject
- | OracleTypeLongVarchar
- | OracleTypeLongRaw
- | OracleTypeNativeUint
- | OracleTypeMax
- data PoolCloseMode
- data PoolGetMode
- data Purity
- data ShutdownMode
- data StartupMode
- data StatementType
- data SubscrNamespace = SubscrNamespaceDbchange
- data SubscrProtocol
- data SubscrQOS
- data Visibility
- type PtrConn = Ptr DPI_Conn
- type PtrPool = Ptr DPI_Pool
- type PtrStmt = Ptr DPI_Stmt
- type PtrVar = Ptr DPI_Var
- type PtrLob = Ptr DPI_Lob
- type PtrObject = Ptr DPI_Object
- type PtrObjectAttr = Ptr DPI_ObjectAttr
- type PtrObjectType = Ptr DPI_ObjectType
- type PtrRowid = Ptr DPI_Rowid
- type PtrSubscr = Ptr DPI_Subscr
- type PtrDeqOptions = Ptr DPI_DeqOptions
- type PtrEnqOptions = Ptr DPI_EnqOptions
- type PtrMsgProps = Ptr DPI_MsgProps
- type PtrContext = Ptr DPI_Context
- data Data_AppContext = Data_AppContext {}
- data Data_CommonCreateParams = Data_CommonCreateParams {}
- data Data_ConnCreateParams = Data_ConnCreateParams {
- authMode :: AuthMode
- connectionClass :: ByteString
- purity :: Purity
- newPassword :: ByteString
- appContext :: PtrAppContext
- numAppContext :: CUInt
- externalAuth :: CInt
- externalHandle :: Ptr ()
- pool :: PtrPool
- tag :: ByteString
- matchAnyTag :: CInt
- outTag :: ByteString
- outTagFound :: CInt
- shardingKeyColumns :: PtrShardingKeyColumn
- numShardingKeyColumns :: CUChar
- superShardingKeyColumns :: PtrShardingKeyColumn
- numSuperShardingKeyColumns :: CUChar
- newtype Data = Data (NativeTypeNum -> IO DataValue)
- data DataValue
- = DataNull NativeTypeNum
- | DataInt64 CLLong
- | DataUint64 CULLong
- | DataFloat CFloat
- | DataDouble CDouble
- | DataBytes Data_Bytes
- | DataTimestamp Data_Timestamp
- | DataIntervalDs Data_IntervalDS
- | DataIntervalYm Data_IntervalYM
- | DataLob PtrLob
- | DataObject PtrObject
- | DataStmt PtrStmt
- | DataBoolean Bool
- | DataRowid PtrRowid
- data Data_Bytes = Data_Bytes {}
- data Data_Timestamp = Data_Timestamp {}
- data Data_IntervalDS = Data_IntervalDS {}
- data Data_IntervalYM = Data_IntervalYM {}
- data Data_DataTypeInfo = Data_DataTypeInfo {}
- data Data_EncodingInfo = Data_EncodingInfo {}
- data Data_ErrorInfo = Data_ErrorInfo {
- code :: CInt
- offset :: CUShort
- message :: ByteString
- encoding :: ByteString
- fnName :: ByteString
- action :: ByteString
- sqlState :: ByteString
- isRecoverable :: Bool
- data Data_ObjectAttrInfo = Data_ObjectAttrInfo {}
- data Data_ObjectTypeInfo = Data_ObjectTypeInfo {}
- data Data_PoolCreateParams = Data_PoolCreateParams {}
- data Data_QueryInfo = Data_QueryInfo {}
- data Data_ShardingKeyColumn = Data_ShardingKeyColumn {}
- data Data_StmtInfo = Data_StmtInfo {
- isQuery :: Bool
- isPLSQL :: Bool
- isDDL :: Bool
- isDML :: Bool
- statementType :: StatementType
- isReturning :: Bool
- data Data_SubscrCreateParams = Data_SubscrCreateParams {
- subscrNamespace :: SubscrNamespace
- protocol :: SubscrProtocol
- qos :: SubscrQOS
- operations :: CInt
- portNumber :: CUInt
- timeout :: CUInt
- name :: ByteString
- callback :: FunPtr (Ptr () -> PtrSubscrMessage -> IO ())
- callbackContext :: Ptr ()
- recipientName :: ByteString
- data Data_SubscrMessage = Data_SubscrMessage {}
- data Data_SubscrMessageQuery = Data_SubscrMessageQuery {}
- data Data_SubscrMessageRow = Data_SubscrMessageRow {
- operation :: OpCode
- rowid :: ByteString
- data Data_SubscrMessageTable = Data_SubscrMessageTable {
- operation :: OpCode
- name :: ByteString
- rows :: PtrSubscrMessageRow
- numRows :: CUInt
- data Data_VersionInfo = Data_VersionInfo {
- versionNum :: CInt
- releaseNum :: CInt
- updateNum :: CInt
- portReleaseNum :: CInt
- portUpdateNum :: CInt
- fullVersionNum :: CUInt
- type PtrAppContext = Ptr Data_AppContext
- type PtrCommonCreateParams = Ptr Data_CommonCreateParams
- type PtrConnCreateParams = Ptr Data_ConnCreateParams
- type PtrData = Ptr Data
- type PtrDataTypeInfo = Ptr Data_DataTypeInfo
- type PtrEncodingInfo = Ptr Data_EncodingInfo
- type PtrErrorInfo = Ptr Data_ErrorInfo
- type PtrObjectAttrInfo = Ptr Data_ObjectAttrInfo
- type PtrObjectTypeInfo = Ptr Data_ObjectTypeInfo
- type PtrPoolCreateParams = Ptr Data_PoolCreateParams
- type PtrQueryInfo = Ptr Data_QueryInfo
- type PtrShardingKeyColumn = Ptr Data_ShardingKeyColumn
- type PtrStmtInfo = Ptr Data_StmtInfo
- type PtrSubscrCreateParams = Ptr Data_SubscrCreateParams
- type PtrSubscrMessage = Ptr Data_SubscrMessage
- type PtrSubscrMessageQuery = Ptr Data_SubscrMessageQuery
- type PtrSubscrMessageRow = Ptr Data_SubscrMessageRow
- type PtrSubscrMessageTable = Ptr Data_SubscrMessageTable
- type PtrVersionInfo = Ptr Data_VersionInfo
Context Interface
Context handles are the top level handles created by the library and are used for all
error handling as well as creating pools and standalone connections to the database.
The first call to ODPI-C by any application must be createContext
which will create the context
as well as validate the version used by the application. Context handles are destroyed by
using the function destroyContext
.
createContext :: IO PtrContext Source #
Creates a new context for interaction with the library. This is the first function that must be called and it must have completed successfully before any other functions can be called, including in other threads.
destroyContext :: PtrContext -> IO Bool Source #
Destroys the context that was earlier created with the function createContext
.
withContext :: (PtrContext -> IO a) -> IO a Source #
With Context, PtrContext
will be destroyed after run
Information from Context
getClientVersion :: PtrContext -> IO Data_VersionInfo Source #
Return information about the version of the Oracle Client that is being used.
getContextError :: PtrContext -> IO Data_ErrorInfo Source #
Returns error information for the last error that was raised by the library. This function must be called with the same thread that generated the error. It must also be called before any other ODPI-C library calls are made on the calling thread since the error information specific to that thread is cleared at the start of every ODPI-C function call.
throwContextError :: PtrContext -> IO a Source #
Connection Interface
Connection handles are used to represent connections to the database.
These can be standalone connections created by calling the function createConnetion
.
They can be closed by calling the function closeConnection
or releasing the last reference
to the connection by calling the function releaseConnection
.
Connection handles are used to create all handles other than session pools and context handles.
Arguments
:: PtrContext | Context |
-> ByteString | the name of the user used for authenticating the user |
-> ByteString | the password to use for authenticating the user |
-> ByteString | he connect string identifying the database to which a connection is to be established |
-> (Data_CommonCreateParams -> Data_CommonCreateParams) | custom |
-> IO PtrConn |
Creates a standalone connection to a database or acquires a connection from a session pool and returns a reference to the connection.
closeConnection :: ConnCloseMode -> PtrConn -> IO Bool Source #
Closes the connection and makes it unusable for further activity. close connection, but not release resource, plese use releaseConnection
to release and close connection
releaseConnection :: PtrConn -> IO Bool Source #
Releases a reference to the connection. A count of the references to the connection is maintained
and when this count reaches zero, the memory associated with the connection is freed and
the connection is closed or released back to the session pool if that has not already taken place
using the function closeConnection
.
pingConnection :: PtrConn -> IO Bool Source #
Pings the database to verify that the connection is still alive.
Arguments
:: PtrContext | Context |
-> ByteString | Username |
-> ByteString | Password |
-> ByteString | Connection String |
-> ByteString | NLS_LANG encoding |
-> ByteString | NLS_NCHAR encoding |
-> (PtrConn -> IO a) | action use connection |
-> IO a |
with connection
Transaction Interface
Arguments
:: PtrConn | Connection |
-> Int64 | formatId |
-> ByteString | transactionId |
-> ByteString | branchId |
-> IO Bool |
Begins a distributed transaction using the specified transaction id (XID) made up of the formatId, transactionId and branchId.
prepareTransaction :: PtrConn -> IO Bool Source #
Prepares a distributed transaction for commit.
This function should only be called after beginTransaction
is called and before commitConnection
is called.
Information from Connection
getCurrentSchema :: PtrConn -> IO ByteString Source #
getEdition :: PtrConn -> IO ByteString Source #
getExternalName :: PtrConn -> IO ByteString Source #
getInternalName :: PtrConn -> IO ByteString Source #
getServerVersion :: PtrConn -> IO (ByteString, Data_VersionInfo) Source #
getObjectType :: PtrConn -> ByteString -> IO PtrObjectType Source #
Statement Interface
Statement handles are used to represent statements of all types (queries, DML, DDL and PL/SQL).
They are created by calling the function createStatement
.
They are also created implicitly when a variable of type OracleTypeStmt
is created.
Statement handles can be closed by calling the function closeStatement
or by releasing the last reference to the statement by calling the function releaseStatement
.
Arguments
:: PtrConn | Connection |
-> Bool | scrollable |
-> ByteString | SQL String |
-> IO PtrStmt |
Returns a reference to a statement prepared for execution. The reference should be released as soon as it is no longer needed.
closeStatement :: PtrStmt -> IO Bool Source #
Closes the statement and makes it unusable for further work immediately, rather than when the reference count reaches zero.
releaseStatement :: PtrStmt -> IO Bool Source #
Releases a reference to the statement. A count of the references to the statement is maintained
and when this count reaches zero, the memory associated with the statement is freed
and the statement is closed if that has not already taken place using the function closeStatement
.
scrollStatement :: PtrStmt -> FetchMode -> Int -> IO Bool Source #
Scrolls the statement to the position in the cursor specified by the mode and offset.
Statement Bind Vars
bindByName :: PtrStmt -> ByteString -> PtrVar -> IO Bool Source #
Binds a variable to a named placeholder in the statement. A reference to the variable is retained by the library and is released when the statement itself is released or a new variable is bound to the same name.
bindByPosition :: PtrStmt -> Int -> PtrVar -> IO Bool Source #
Binds a variable to a placeholder in the statement by position. A reference to the variable is retained by the library and is released when the statement itself is released or a new variable is bound to the same position.
bindValueByName :: PtrStmt -> ByteString -> NativeTypeNum -> PtrData -> IO Bool Source #
Binds a value to a named placeholder in the statement without the need to create a variable directly. One is created implicitly and released when the statement is released or a new value is bound to the same name.
bindValueByPosition :: PtrStmt -> Int -> NativeTypeNum -> PtrData -> IO Bool Source #
Binds a value to a placeholder in the statement without the need to create a variable directly. One is created implicitly and released when the statement is released or a new value is bound to the same position.
define :: PtrStmt -> Int -> PtrVar -> IO Bool Source #
Defines the variable that will be used to fetch rows from the statement. A reference to the variable will be retained until the next define is performed on the same position or the statement is closed.
defineValue :: PtrStmt -> Int -> OracleTypeNum -> NativeTypeNum -> Int -> Bool -> PtrObjectType -> IO Bool Source #
Defines the type of data that will be used to fetch rows from the statement.
This is intended for use with the function getQueryValue
, when the default data type
derived from the column metadata needs to be overridden by the application.
Internally, a variable is created with the specified data type and size.
getBindCount :: PtrStmt -> IO Int Source #
Returns the number of bind variables in the prepared statement. In SQL statements this is the total number of bind variables whereas in PL/SQL statements this is the count of the unique bind variables.
getBindNames :: PtrStmt -> IO [ByteString] Source #
Returns the names of the unique bind variables in the prepared statement.
Arguments
:: PtrStmt | Statement |
-> Int | the position of the column whose metadata is to be retrieved. The first position is 1. |
-> IO Data_QueryInfo |
Returns information about the column that is being queried.
Arguments
:: PtrStmt | Statement |
-> Int | the position of the column whose metadata is to be retrieved. The first position is 1. |
-> IO DataValue |
Returns the value of the column at the given position for the currently fetched row,
without needing to provide a variable. If the data type of the column needs to be overridden,
the function defineValue
can be called to specify a different type after executing
the statement but before fetching any data.
Execute Statement
executeStatement :: PtrStmt -> ExecMode -> IO Int Source #
Executes the statement using the bound values.
For queries this makes available metadata which can be acquired using the function getQueryInfo
.
For non-queries, out and in-out variables are populated with their values.
fetch :: PtrStmt -> IO (Maybe PageOffset) Source #
Fetches a single row from the statement. If the statement does not refer to a query an error is returned. All columns that have not been defined prior to this call are implicitly defined using the metadata made available when the statement was executed.
type PageOffset = Int64 Source #
type Page = (PageOffset, PageLimit) Source #
Arguments
:: PtrStmt | Statement |
-> Int | the maximum number of rows to fetch. If the number of rows available exceeds this value only this number will be fetched. |
-> IO (Bool, [DataValue]) |
Returns the number of rows that are available in the buffers defined for the query. If no rows are currently available in the buffers, an internal fetch takes place in order to populate them, if rows are available. If the statement does not refer to a query an error is returned. All columns that have not been defined prior to this call are implicitly defined using the metadata made available when the statement was executed.
getRowCount :: PtrStmt -> IO Int Source #
Returns the number of rows affected by the last DML statement that was executed or the number of rows currently fetched from a query. In all other cases 0 is returned.
getRowCounts :: PtrStmt -> IO [Int] Source #
Returns an array of row counts affected by the last invocation of executeMany
with the array DML rowcounts mode enabled.
This feature is only available if both client and server are at 12.1.
getBatchErrors :: PtrStmt -> IO [Data_ErrorInfo] Source #
Lob Interface
newTempLob :: PtrConn -> OracleTypeNum -> IO PtrLob Source #
setLobFromBytes :: PtrLob -> ByteString -> IO Bool Source #
type BufferSize = Int64 Source #
readLobBytes :: PtrLob -> Page -> BufferSize -> IO ByteString Source #
writeLobBytes :: PtrLob -> PageOffset -> ByteString -> IO Bool Source #
Object Interface
objectAppendElement :: PtrObject -> NativeTypeNum -> PtrData -> IO Bool Source #
objectSetAttributeValue :: PtrObject -> PtrObjectAttr -> DataValue -> IO Bool Source #
objectGetAttributeValue :: PtrObject -> PtrObjectAttr -> NativeTypeNum -> IO DataValue Source #
objectGetElementValueByIndex :: PtrObject -> Int -> NativeTypeNum -> IO DataValue Source #
objectAttrAddRef :: PtrObjectAttr -> IO Bool Source #
releaseObjectAttr :: PtrObjectAttr -> IO Bool Source #
objectTypeAddRef :: PtrObjectType -> IO Bool Source #
releaseObjectType :: PtrObjectType -> IO Bool Source #
Rowid Interface
Var Interface
Variable handles are used to represent memory areas used for transferring data to and from the database.
They are created by calling the function newVar
.
They are destroyed when the last reference to the variable is released by calling the function releaseVar
.
They are bound to statements by calling the function bindByName
or the function bindByPosition
.
They can also be used for fetching data from the database by calling the function define
.
Arguments
:: PtrConn | Connection |
-> OracleTypeNum | Oracle type enum |
-> NativeTypeNum | Native type enum |
-> Int | maxArraySize |
-> Int | size |
-> Bool | sizeIsBytes |
-> Bool | isArray |
-> PtrObjectType | Object type |
-> IO (PtrVar, [PtrData]) |
Returns a reference to a new variable which can be used for binding data to a statement or providing a buffer for querying data from the database. The reference should be released as soon as it is no longer needed.
setVarFromBytes :: PtrVar -> Int -> ByteString -> IO Bool Source #
data DpiException Source #
Constructors
Instances
data ConnCloseMode Source #
Constructors
ModeConnCloseDefault | |
ModeConnCloseDrop | |
ModeConnCloseRetag |
Instances
Constructors
ModeDeqBrowse | |
ModeDeqLocked | |
ModeDeqRemove | |
ModeDeqRemoveNoData |
data MessageDeliveryMode Source #
Instances
data MessageState Source #
Constructors
MsgStateReady | |
MsgStateWaiting | |
MsgStateProcessed | |
MsgStateExpired |
Instances
data NativeTypeNum Source #
Constructors
Instances
data OracleTypeNum Source #
Constructors
Instances
data PoolGetMode Source #
Constructors
ModePoolGetWait | |
ModePoolGetNowait | |
ModePoolGetForceget |
Instances
Constructors
PurityDefault | |
PurityNew | |
PuritySelf |
data ShutdownMode Source #
Constructors
ModeShutdownDefault | |
ModeShutdownTransactional | |
ModeShutdownTransactionalLocal | |
ModeShutdownImmediate | |
ModeShutdownAbort | |
ModeShutdownFinal |
Instances
data StartupMode Source #
Constructors
ModeStartupDefault | |
ModeStartupForce | |
ModeStartupRestrict |
Instances
data StatementType Source #
Constructors
StmtTypeSelect | |
StmtTypeUpdate | |
StmtTypeDelete | |
StmtTypeInsert | |
StmtTypeCreate | |
StmtTypeDrop | |
StmtTypeAlter | |
StmtTypeBegin | |
StmtTypeDeclare | |
StmtTypeCall | |
StmtTypeMerge |
Instances
data SubscrProtocol Source #
Instances
type PtrObjectAttr = Ptr DPI_ObjectAttr Source #
type PtrObjectType = Ptr DPI_ObjectType Source #
type PtrDeqOptions = Ptr DPI_DeqOptions Source #
type PtrEnqOptions = Ptr DPI_EnqOptions Source #
type PtrMsgProps = Ptr DPI_MsgProps Source #
type PtrContext = Ptr DPI_Context Source #
data Data_AppContext Source #
Constructors
Data_AppContext | |
Fields
|
Instances
data Data_CommonCreateParams Source #
Constructors
Data_CommonCreateParams | |
Fields
|
data Data_ConnCreateParams Source #
Constructors
Instances
Constructors
Data (NativeTypeNum -> IO DataValue) |
Constructors
data Data_Bytes Source #
Constructors
Data_Bytes | |
Fields
|
Instances
data Data_ErrorInfo Source #
Constructors
Data_ErrorInfo | |
Fields
|
Instances
data Data_PoolCreateParams Source #
Constructors
Data_PoolCreateParams | |
Fields
|
Instances
data Data_QueryInfo Source #
Constructors
Data_QueryInfo | |
Fields
|
Instances
data Data_ShardingKeyColumn Source #
Constructors
Data_ShardingKeyColumn | |
Fields |
data Data_StmtInfo Source #
Constructors
Data_StmtInfo | |
Fields
|
Instances
data Data_SubscrCreateParams Source #
Constructors
Data_SubscrCreateParams | |
Fields
|
data Data_SubscrMessage Source #
Constructors
Data_SubscrMessage | |
Fields
|
Instances
data Data_SubscrMessageQuery Source #
Constructors
Data_SubscrMessageQuery | |
data Data_SubscrMessageRow Source #
Constructors
Data_SubscrMessageRow | |
Fields
|
Instances
data Data_SubscrMessageTable Source #
Constructors
Data_SubscrMessageTable | |
Fields
|
data Data_VersionInfo Source #
Constructors
Data_VersionInfo | |
Fields
|
Instances
type PtrAppContext = Ptr Data_AppContext Source #
type PtrDataTypeInfo = Ptr Data_DataTypeInfo Source #
type PtrEncodingInfo = Ptr Data_EncodingInfo Source #
type PtrErrorInfo = Ptr Data_ErrorInfo Source #
type PtrQueryInfo = Ptr Data_QueryInfo Source #
type PtrStmtInfo = Ptr Data_StmtInfo Source #
type PtrSubscrMessage = Ptr Data_SubscrMessage Source #
type PtrVersionInfo = Ptr Data_VersionInfo Source #