Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Reference Index > Foreign Data Sources and ODBC

Connecting Data Sources and Tables

Scroll Prev Top Next More

When R:BASE attaches a foreign table, R:BASE only includes those columns in the table that have recognizable data types. Also, if the foreign tables have names that are illegal in R:BASE, or if a foreign table name is the same as one in the R:BASE database, R:BASE prompts you to specify an alias that will be used for the foreign table while that table is attached.

 

To ensure that data in attached tables is updated correctly, attached tables should have a primary or unique key defined. If no primary or unique keys are defined, R:BASE prompts for the columns you want to use to determine unique rows.

 

Attaching a Foreign Database Table

 

1.Connect to your database which foreign tables you want moved into.

2.From the main menu bar, select "Utilities" > "Connect SQL Data Source". This will open the "Select Data Source" dialog. You can also enter SCONNECT at the R> Prompt to achieve the same result.

3.Click on the "Machine Data Source" tab.

4.Select the Data Source Name from the list, and press the "OK" button.

 

At this point, you can select "Utilities" from main menu bar and notice that the options for "Disconnect SQL Data Source" and "Attach SQL Database Tables" are enabled. This means you have correctly connected to the data source.

 

5.From the main menu bar, select "Utilities" > "Attach SQL Database Tables". You can also enter SATTACH at the R> Prompt to achieve the same result. The following dialog will be displayed.

 

AttachTables

 

 

6.From the displayed dialog, choose your defined Data Source from the drop down box to preview the list of available database tables to attach.

7.Select the table you want to attach.

 

Notice the option for "Attach As Alias." It may be necessary for you to assign an alias name if the foreign data source table does not follow the same table name restrictions as R:BASE. The option for "Attach as Temporary" is also available to attach a foreign data source as a temporary table. The "Attach USING" option is available to assign the QualKey columns. Either all columns are assigned, or the button may be used to specify the column(s) that uniquely identify the rows.

 

8.Press the "Attach" button.

9.Now, if you navigate to the Database Explorer, you will see the table(s) listed.

 

When foreign data source tables are attached to R:BASE, the tables will appear differently than other tables in the Database Explorer. The foreign tables will display a green icon next to the name whereas regular R:BASE tables will display a blue icon. Also, the word "SERVER" will appear under the "Rows" column and the table comment will include "Server table with the attached table name.

 

You can repeat the steps for any other database/tables you wish to attach to the main database.

 

If needed, use the PROJECT command to add the table permanently to the database.

 

ODBC Topics:

 

How ODBC Works

ODBC Compliance

Setting Up Data Sources

Working with Data Sources

Disconnecting Data Sources and Tables

 

See also:

 

SATTACH Command

SCONNECT Command

SDETACH Command

SDISCONNECT Command

PASSTHROUGH Setting

SSQL Command