A SQL Anywhere server may have several local databases running at one time. By defining tables in other local SQL Anywhere databases as remote tables, you can perform cross-database joins.
For more information about specifying multiple databases, see USING parameter in the CREATE SERVER statement.
Suppose you are using database db1, and you want to access data in tables in database db2. You need to set up proxy table definitions that point to the tables in database db2. For example, on a SQL Anywhere server named RemoteSA, you might have three databases available, db1, db2, and db3.
CREATE SERVER remote_db2 CLASS 'saodbc' USING 'RemoteSA_db2'; CREATE SERVER remote_db3 CLASS 'saodbc' USING 'RemoteSA_db3'; |
Alternatively, using JDBC:
CREATE SERVER remote_db2 CLASS 'sajdbc' USING 'mypc1:2638/db2'; CREATE SERVER remote_db3 CLASS 'sajdbc' USING 'mypc1:2638/db3'; |
CREATE EXISTING TABLE Employees AT 'remote_db2...Employees'; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |