Componentes.Terceros.RemObj.../internal/5.0.23.613/1/Data Abstract for Delphi/Source/uDAOracleInterfaces.pas
david 2824855ea7 - Modificación del paquete RemObjects_Core_D10 para que sea un paquete de runtime/designtime (antes era designtime sólo)
- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10
- Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10

git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
2007-09-10 14:06:19 +00:00

118 lines
3.6 KiB
ObjectPascal

unit uDAOracleInterfaces;
{----------------------------------------------------------------------------}
{ Data Abstract Library - Core Library }
{ }
{ compiler: Delphi 6 and up, Kylix 3 and up }
{ platform: Win32, Linux }
{ }
{ (c)opyright RemObjects Software. all rights reserved. }
{ }
{ Using this code requires a valid license of the Data Abstract }
{ which can be obtained at http://www.remobjects.com. }
{----------------------------------------------------------------------------}
{$I DataAbstract.inc}
interface
uses
uDAInterfaces, uDAEngine;
type
{ IDAOracleConnection
For identification purposes Implemented by all Oracle connections }
IDAOracleConnection = interface(IDAConnection)
['{C7C88680-12BF-402A-8843-80016429BAC1}']
end;
IOracleConnection = IDAOracleConnection;
TDAOracleLockMode = (olmNone, olmLockImmediate, olmLockDelayed);
TDAOracleOption = (opAutoClose,
opDefaultValues,
opLongStrings,
opQueryRecCount,
opCacheLobs,
opDeferredLobRead,
opKeepPrepared);
TDAOracleOptions = set of TDAOracleOption;
{ IOracleDataset
Provides access to features of ODAC mostly which might or might not be mappable
to other drivers for Oracle. }
IDAOracleDataset = interface
['{D555E209-0ED7-40D4-B97B-7C2044453E70}']
function GetLockMode: TDAOracleLockMode;
procedure SetLockMode(Value: TDAOracleLockMode);
function GetOptions: TDAOracleOptions;
procedure SetOptions(Value: TDAOracleOptions);
property LockMode: TDAOracleLockMode read GetLockMode write SetLockMode;
property Options: TDAOracleOptions read GetOptions write SetOptions;
end;
IOracleDataset = IDAOracleDataset;
TDAOracleDriver = class(TDAEDriver)
protected
function GetDefaultConnectionType(const AuxDriver: string): string; override; safecall;
end;
function Oracle_CreateMacroProcessor: TDASQLMacroProcessor;
function Oracle_GetSPSelectSyntax(HasArguments: Boolean): String;
function Oracle_DoGetLastAutoInc(const GeneratorName: string;Query: IDADataset): integer;
function Oracle_GetNextAutoinc(const GeneratorName: string;Query: IDADataset): integer;
const
Oracle_DriverType = 'Oracle';
implementation
uses
uDAMacroProcessors;
function Oracle_CreateMacroProcessor: TDASQLMacroProcessor;
begin
Result := TDAOracleMacroProcessor.Create;
end;
function Oracle_GetSPSelectSyntax(HasArguments: Boolean): String;
begin
if HasArguments then
Result := 'CALL {0}({1})'
else
Result := 'CALL {0}';
end;
function Oracle_DoGetLastAutoInc(const GeneratorName: string;Query: IDADataset): integer;
begin
try
Query.SQL := 'SELECT ' + GeneratorName + '.Currval FROM dual';
Query.Open;
result := Query.Fields[0].Value;
finally
Query := nil;
end;
end;
function Oracle_GetNextAutoinc(const GeneratorName: string;Query: IDADataset): integer;
begin
try
Query.SQL := 'SELECT ' + GeneratorName + '.Nextval FROM dual';
Query.Open;
result := Query.Fields[0].Value;
finally
Query := nil;
end;
end;
{ TDAOracleDriver }
function TDAOracleDriver.GetDefaultConnectionType(
const AuxDriver: string): string;
begin
Result := Oracle_DriverType;
end;
end.