Specify proxy table locations

The AT keyword is used with both CREATE TABLE and CREATE EXISTING TABLE to define the location of an existing object. This location string has four components, each separated by either a period or a semicolon. The semicolon delimiter allows file names and extensions to be used in the database and owner fields.

The syntax of the AT clause is

... AT 'server.database.owner.table-name'
  • server   This is the name by which the server is known in the current database, as specified in the CREATE SERVER statement. This field is mandatory for all remote data sources.

  • database   The meaning of the database field depends on the data source. In some cases this field does not apply and should be left empty. The delimiter is still required, however.

    If the data source is Adaptive Server Enterprise, database specifies the database where the table exists. For example master or pubs2.

    If the data source is SQL Anywhere, this field does not apply; leave it empty.

    If the data source is Excel, Lotus Notes, or Access, you must include the name of the file containing the table. If the file name includes a period, use the semicolon delimiter.

  • owner   If the database supports the concept of ownership, this field represents the owner name. This field is only required when several owners have tables with the same name.

  • table-name   This field specifies the name of the table. In the case of an Excel spreadsheet, this is the name of the sheet in the workbook. If table-name is left empty, the remote table name is assumed to be the same as the local proxy table name.

Examples:

The following examples illustrate the use of location strings:

  • SQL Anywhere:

'RemoteSA..GROUPO.Employees'
  • Adaptive Server Enterprise:

'RemoteASE.pubs2.dbo.publishers'
  • Excel:

'excel;d:\pcdb\quarter3.xls;;sheet1$'
  • Access:

'access;\\server1\production\inventory.mdb;;parts'