The OutSystems Platform integrates with external databases, making it possible to use data from those databases.

For this, you can use the 'Connect to External Table or View' wizard in Integration Studio, to automatically create a connector to the external database, and use the data from the external database in a transparent way.

For the list of supported external databases please see the System Requirements.

To create a connector to an external database, and import a table or a view from there to use it as an Entity in OutSystems, follow the steps below.

Create a connection to an external database

To be able to import tables and views from external databases, you need to create a new database connection, or use an existing one. Database connections allow you to connect to external databases using a database connection string that contains information such as the database server, a user name and a password.

To create a new database connection, follow these steps:

    1. In Service Center, under the 'Administration' tab, click 'Database Connections';

    2. On the left side choose 'New Database Connection';

    3. Fill in the fields with the information about the database to connect to.
      You can use the 'Advanced Configuration' option to customize the connection string to connect to the database.
      The database user needs to have permissions to list the tables and views, and perform Create, Read, Update, and Delete operations. Check the System Requirements to learn more.

Import a table from an external database

    1. In Integration Studio connect to the environment where the database connection is configured;

    2. In the left side right-click the Entities folder, and choose 'Connect to External Table or View'

    3. On the Welcome window click 'Next';

    4. The OutSystems Platform displays a list of database servers that can be reached using the already configured database connections, or database servers that can be reached via Linked Server. Choose a database server from this list;

    5. Choose a database schema or catalog;

    6. In the 'Available Tables and Views' box choose the tables and views you want to import.
      To automatically import tables pointed by foreign keys, set the 'Levels of related tables' to import;

    7. In the 'Imported Tables and Views Report' the wizard displays information detailing the expected result of the import you are about to make.
      You can click the 'View Report...' button to see a full report;

    8. After importing the tables and views, review their names, descriptions and data types for each attribute;

    9. You can also review the 'Table or View Name' field, since this is the name that will be used to represent the database table. You can customize this field using for example database synonyms.
      Make sure that the Runtime User that is specified in the Configuration Tool can access the table, view or synonym using the object name you define here.

    10. To publish the extension module, click the 1-Click Publish button.

Configure the Database Connection

After the publishing is finished, the OutSystems platform notifies that you still need to configure which database connection to use. For this, click the 'Configure' button.

Once in Service Center, choose a database connection from the ones available.

Now this extension module is ready to be used in Service Studio. Learn how to use the Extension in an eSpace module.

If later you make changes to the table or view in thew source database, you can update your extension by refreshing the entity. See Refresh an Entity.

Status icons used in the Imported Tables and Views Report:

New: a new entity was successfully imported.

OK: if the attributes are the same, on both the entity definition and the database.

Refreshed: if there are some differences between the physical table and the entity definition.

See Also

Entities Change Management | Entity Editor | Entity Properties | Entity Attributes | Define Extension Entities