5.13.5.2 Connections

Following is the list of datasources related to workspace using:

  • mmg.list_datasources("SB1", 1): will list datasources related to SB1 workspace with order 1 as passed in second argument

    mmg.list_datasources("workspace_name",order) order is integer for specific order or null for all datasources.

    For example:

    df <- mmg.list_datasources("workspace_name",order) df will be Data.Frame Object.

    From the datasource name or order for the attached workspace, we can get the ROracle or RODBC Connection Object.

  • mmg.get_connection():

    datasource_name is the string name of the datasource, order is integer, library is one of "RODBC" or "ROracle"

    conn <- mmg.get_connection(datasource=order,conn_type="library");

    conn <- mmg.get_connection(datasource="datasource_name",conn_type="library");

    conn <- mmg.get_connection(datasource="datasource_name","library");

    conn <- mmg.get_connection(datasource=order,"library");

    conn <- mmg.get_connection("datasource_name",conn_type="library");

    conn <- mmg.get_connection(order,conn_type="library");

    conn <- mmg.get_connection("datasource_name","library");

    conn <- mmg.get_connection(order,"library");

    sets the conn variable to connection object of relevant library