0 / 0
Creating data assets by using SQL queries
Last updated: Dec 05, 2024
Creating data assets by using SQL queries

To add a dynamic view of data from a connection to your project, create an SQL query to select specific data.

To add a dynamic view:

  1. From the project page, click the Assets tab, and then click New asset > Create a dynamic view of data.

  2. Leave the data selection method Write an SQL query selected.

  3. Enter a name and optionally a description. The maximum number of characters that are allowed for the name or the description is 100 each.

  4. Select an existing connection asset as the source of the data. The connection must support SQL queries.

  5. Optional: Add tags as required.

  6. On the Query tab, enter your SQL query for selecting the data for the dynamic view. Example:

    SELECT name, address, client_id FROM BANK1.BANK_CLIENTS WHERE account_type='CHECKING' AND online_access='YES'
    

    This query creates a view with the columns that contain the names, addresses, and client IDs of clients who have online access to their checking account. The source is the BANK_CLIENTS database table.

    To validate your SQL statement, you can switch to the Preview tab. If the statement is valid, the selected columns with their data types are listed. Otherwise, your query is validated when you click Create. You must fix any SQL errors before you can create the asset.

  7. Click Create.

The asset is added to the project Assets page. To differentiate dynamic views from other data assets, such assets are marked with the reference data icon (reference data asset). If folders are enabled in the project, a dynamic view is always created in the root folder, but you can move it to any subdirectory to organize your dynamic views.

Next steps

Parent topic: Adding a dynamic view of data from a connection

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more