I need to use an oracle database link to get data using
SELECT > FROM >@>
It all works fine using SQL Developer (using tnsnames.ora)
If I delete the tnsnames.ora entry however it all goes 'orribly wrong!
does dbExpress support this form of database link?
or maybe there's another way...
thanks!
dbExpress with database link
Hello,
dbExpress driver for Oracle supports Oracle dblink.
Below is a small sample demonstrating how to use Oracle dblink:
CREATE PUBLIC DATABASE LINK remote
CONNECT TO remote_user_name IDENTIFIED BY remote_password
USING 'REMOTE_HOST:PORT/SID';
var
SQLConnection: TSQLConnection;
SimpleDataSet: TSimpleDataSet;
begin
SQLConnection:= TSQLConnection.Create(nil);
SQLConnection.ConnectionName :='Devart Oracle';
SQLConnection.DriverName := 'DevartOracle';
SQLConnection.GetDriverFunc:= 'getSQLDriverORA';
SQLConnection.LibraryName:= 'dbexpoda.dll';
SQLConnection.VendorLib:= 'OCI.DLL';
SQLConnection.Params.Values['User_Name']:='user_name';
SQLConnection.Params.Values['Password']:='password';
SQLConnection.Params.Values['DataBase']:='local';
SQLConnection.Execute('CREATE PUBLIC DATABASE LINK remote CONNECT TO remote_user_name IDENTIFIED BY remote_password USING ''REMOTE_HOST:PORT/SID''',nil);
SQLConnection.Execute('Select * from dual@remote', nil);
also you can connect to Oracle in the direct mode.
dbExpress driver for Oracle supports Oracle dblink.
Below is a small sample demonstrating how to use Oracle dblink:
CREATE PUBLIC DATABASE LINK remote
CONNECT TO remote_user_name IDENTIFIED BY remote_password
USING 'REMOTE_HOST:PORT/SID';
var
SQLConnection: TSQLConnection;
SimpleDataSet: TSimpleDataSet;
begin
SQLConnection:= TSQLConnection.Create(nil);
SQLConnection.ConnectionName :='Devart Oracle';
SQLConnection.DriverName := 'DevartOracle';
SQLConnection.GetDriverFunc:= 'getSQLDriverORA';
SQLConnection.LibraryName:= 'dbexpoda.dll';
SQLConnection.VendorLib:= 'OCI.DLL';
SQLConnection.Params.Values['User_Name']:='user_name';
SQLConnection.Params.Values['Password']:='password';
SQLConnection.Params.Values['DataBase']:='local';
SQLConnection.Execute('CREATE PUBLIC DATABASE LINK remote CONNECT TO remote_user_name IDENTIFIED BY remote_password USING ''REMOTE_HOST:PORT/SID''',nil);
SQLConnection.Execute('Select * from dual@remote', nil);
also you can connect to Oracle in the direct mode.