• Topic
  • Discussion
  • ODS.VirtSybaseLinkingObjects(Last) -- DAVWikiAdmin? , 2017-06-29 07:34:37 Edit WebDAV System Administrator 2017-06-29 03:34:37

    Linking Sybase Database Objects (Tables, Views, and Stored Procedures) Virtuoso

    Prerequisites

    • Virtuoso Universal Server, Commercial Edition
      Virtuoso Universal Server Release 6.x or later is recommended, optimally the latest version available.

    • ODBC Driver for Sybase
      The Virtuoso Server uses an ODBC Driver for Sybase to link in the Sybase Schema Objects (Tables, Views, and Stored Procedures). The OpenLink Multi-Tier ODBC Driver for Sybase will be used in this document, and a functional ODBC Data Source Name (DSN) of syb12ma-pub2 will be assumed to exist on the machine hosting the Virtuoso Server. Any ODBC compliant driver for Sybase should work.

    • Sybase DBMS
      A Sybase DBMS hosting the required Schema Objects (Tables, Views, and Stored Procedures) needs to be available. This may be on any host which is TCP/IP accessible from the Virtuoso Server host. In this document, the Sybase pubs2 sample database will be used to demonstrate the process.

    Steps

    1. Load the HTTP-based Virtuoso User Interface in your browser.



    2. Click the Conductor link in the left-side navbar, and log in as a user with DBA privileges, such as the default dba user.

      VirtConductor.png

    3. Drill down to the Databases -> External Data Source -> Data Sources tab.

      VirtLinkSyb01.png

    4. Locate the DSN for the desired remote data source (we're using syb12ma-pub2 for this example). If not yet connected to the DSN, click Connect, and input your user credentials for the remote data source.

      VirtLinkSyb02.png

    5. Once connected to the DSN, click the associated Link objects to get a list of available objects (tables, views, stored procedures).

      VirtLinkSyb03.png

    6. Locate and select the desired objects.

      VirtLinkSyb04.png

      • You can use the Catalog and Schema drop-down selectors and the table name test-entry box to construct a filter to shorten the visible list.
      • For this example, we'll choose the key tables from the Sybase sample pubs2.dbo schema -- au_pix, authors, discounts, publishers, roysched, sales, salesdetail, stores, titleauthor, titles.
      • When all desired objects are selected, click the Link... button.
    7. Virtuoso will interrogate the remote data source to learn about primary keys, and present you with a default linkage setup.

      VirtLinkSyb05.png

    8. You can adjust the Virtuoso catalog, schema/owner, and object identifiers to suit your goals. The Set To All button can be used to speed the process. In this example, we'll put all linked objects into the sybase12 catalog, and the pubs2 schema. We'll leave the object identifiers unchanged.

      VirtLinkSyb06.png

      • Sometimes a primary key is not reported properly, or you want to use a different key, either simple or compound. Click Edit next to the primary key you want to change, and select the columns that Virtuoso should use for the purpose --

        VirtLinkSyb07.png

    9. When all are set as desired, click the Link button to link the objects into Virtuoso. Virtuoso may take some time to complete this step, depending on network infrastructure, DBMS load, etc.

      VirtLinkSyb07a.png

    10. The Link process will complete by listing the linked objects in the Databases -> External Data Source -> External Linked Objects tab.

      VirtLinkSyb08.png

    Confirmation and Testing

    Working with External Linked Objects (Tables, Views, and Stored Procedures)

    1. Linked object are shown in the Databases -> External Data Source -> External Linked Objects tab.

      VirtLinkSyb08.png

    2. Clicking the hyperlinked Local Name of the External Linked Objects will load the Virtuoso Interactive SQL (iSQL) HTTP interface (in a new browser tab or window) with a default SELECT * SQL query. For instance, clicking on sybase12.pubs2.authors brings --

      VirtLinkSyb09.png

    3. Click the Execute button to run the query. Virtuoso will retrieve the results from the remote table. Note: By default, iSQL will "Show no more than 100 rows ." You can change this value as desired.

      VirtLinkSyb10.png

    Working with SQL Database Objects (Tables, Views, and Stored Procedures)

    1. Linked objects are also visible through the Database -> SQL Database Object tab, just as if they were local Virtuoso data.

      VirtLinkSyb11.png

    2. Simply drill down to the Catalog you set while linking --

      VirtLinkSyb12.png

    3. As you might expect, clicking on any of the Action links will reveal the table definition, indexes, triggers, constraints, or privileges. For example, clicking Definition for informix.stores.orders --

      VirtLinkSyb13.png

    Related

    • Mapping SQL Data to Linked Data Views?
    • Using Microsoft Entity Frameworks to Access Sybase Schema Objects (Tables, Views, and Stored Procedures) with Virtuoso?

    CategoryDocumentation CategoryVirtuoso CategoryDotNET? CategoryEntityFrameworks? CategoryWebSite