Defining a query
About this task
After you have opened an MDQ file in the Database Interface Designer window and a database has been defined, you can specify queries. To use a query as a source, define the query by assigning it a name and entering either the SQL SELECT statement or the stored procedure invocation statement.
To define a query:
Procedure
- In the Navigator, select Queries under the database icon for which you want to add a query.
-
From the Query menu, select New.
The New Query dialog appears.
- In the Name field, enter a name for your query. Use this name to reference this query using the Map Designer or you can use it in a data source override execution command.
-
In the Query text box, enter an SQL statement that defines
how data should be retrieved from the database.
If your SELECT statement includes table names with spaces, you must enclose them with either single or double quotation marks.
-
Click OK.
The new query appears in the Navigator next to the query icon.