Page 1 of 1

NexusDB Provider - Access others DataBases

Posted: Mon 07 Feb 2011 13:15
by eduardomendes
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...

Posted: Thu 10 Feb 2011 13:48
by AndreyZ
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;

Posted: Thu 10 Feb 2011 18:41
by eduardomendes
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

Posted: Mon 14 Feb 2011 16:05
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Posted: Mon 14 Feb 2011 16:10
by eduardomendes
When will be released the next UNIDAC version?

Thanks...

Posted: Tue 15 Feb 2011 13:36
by AndreyZ
We are planning to release UniDAC in two or three weeks.

Posted: Tue 15 Feb 2011 21:21
by kamiller42
AndreyZ wrote:We are planning to release UniDAC in two or three weeks.
This is good to know. Thanks!