NexusDB Provider - Access others DataBases

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eduardomendes
Posts: 28
Joined: Wed 24 Feb 2010 14:08

NexusDB Provider - Access others DataBases

Post by eduardomendes » Mon 07 Feb 2011 13:15

Hi,

how can I access tables the others DataBases in NexusDB?

Ex: UniConnection ( ProviderName = 'NexusDB'
Server = '[email protected]'
DataBase = 'DataBase1' )

Select *
From DataBase1.Table1 T1
Join DataBase2.Table2 T2 on (T1.ID = T2.ID)


Thanks...

AndreyZ

Post by AndreyZ » Thu 10 Feb 2011 13:48

Hello,

You can execute query to several databases under following conditions:
1) the Nexus server must be running;
2) you must use aliases;
3) the TUniConnection.Server property must be set;
4) in the FROM SQL statement the name of the first alias must be equal to the alias that is set to the TUniConnection.Database property.
Here is a code example:

Code: Select all

  UniConnection.ProviderName := 'NexusDB';
  UniConnection.Server := 'your_server';
  UniConnection.Database := 'Alias1';
  UniConnection.LoginPrompt := false;
  UniQuery.SQL.Text := 'select * from Alias1.Table1 T1 Join Alias2.Table2 T2 on (T1.ID = T2.ID)';
  UniQuery.Open;

eduardomendes
Posts: 28
Joined: Wed 24 Feb 2010 14:08

Post by eduardomendes » Thu 10 Feb 2011 18:41

Hello,

I can't execute cross schema(alises) commands with NexusDBProvider, but native nexus connection allow me to do it.

Ex:

UniConnection.ProviderName := 'NexusDB';
UniConnection.Server := 'my_server';
UniConnection.Database := 'Alias1';
UniConnection.LoginPrompt := false;

UniQuery.SQL.Text := 'select * from Alias2.Table2';
UniQuery.Open;


Return this error: Root table "Table2" not found [$2728/10024]

I'm use NxServer version 3.07

I need to do it without put another UniConnection on application, cause It will run with sqlserver and nexus.

There is some way to do it?

Thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 14 Feb 2011 16:05

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

eduardomendes
Posts: 28
Joined: Wed 24 Feb 2010 14:08

Post by eduardomendes » Mon 14 Feb 2011 16:10

When will be released the next UNIDAC version?

Thanks...

AndreyZ

Post by AndreyZ » Tue 15 Feb 2011 13:36

We are planning to release UniDAC in two or three weeks.

kamiller42
Posts: 40
Joined: Thu 27 Jan 2011 22:31

Post by kamiller42 » Tue 15 Feb 2011 21:21

AndreyZ wrote:We are planning to release UniDAC in two or three weeks.
This is good to know. Thanks!

Post Reply