Adding a Custom Named Query

Create a custom, or "named" query that can be reused by multiple pages. This saves you time since you don’t have to recreate the same query for each separate use.
- Alan Fisher, Chairman of Iron Speed, Inc.

September 8, 2005
Iron Speed Designer V3.0

Command: Tools, Create New Query...
You can create a custom, or "named" query that can be reused by multiple pages. This saves you time since you don’t have to recreate the same query for each separate use. The concept of a named query is very similar to the concept of a "database view", except that the named query is defined in Iron Speed Designer and not in the underlying database to which you may not have access.



Create custom SQL queries you can reuse in Iron Speed Designer.

Named queries are available for use throughout Iron Speed Designer, including:

  • The Application Wizard for creating Add Record, Edit Record, Show Record and Show Table pages based on the named query.

  • As data sources for several code generation tags, including the FieldValue, Record, and Table tags.
The named queries are defined using a dialog similar to the Add Where Clause dialog in the Properties dialog. The queries are modified in one central place - the Database folder in Iron Speed Designer - allowing you to centrally manage and update them.


Selecting fields for a named query.

Each defined query generates an appropriate set of code classes for the queries. These classes will be derived from the VirtualRecord and VirtualTable classes. The benefit of having queries is that there will be fewer generated classes related to the virtual tables – and more importantly, their names correspond to the name you provide, making them more understandable.

When a query is used as a data source for a code generation tag, editing of the data is not permitted. No editing is allowed regardless of the number of levels below a query. For example, if a query was used for a Table, and a record is embedded within another record in the table row, no editing is allowed for either of the records because they were derived from a query.

Table Name Aliases
When creating queries it is sometimes necessary to join a table with itself. For example, the Northwind.Employees table has a ReportsTo field that is a foreign key to the Employees table (i.e. it references another Employee). Suppose you wanted to create a query that shows an employee's first and last name as well as the first and last name of the person they report to. In SQL your query would look something like the following:

"EmployeesReportsTo" is an alias for the Employees table and is used to avoid ambiguity. When creating queries using Iron Speed Designer, you can create aliases such as EmployeeReportsTo using the "New Alias" button. You can then select this alias in the same way you select a table when specifying join criteria.

Query Name Restrictions
Query names may contain alphanumeric characters, spaces, and underscores. Query names and alias names have these additional restrictions:
  • They may not include asterisks, question marks, or dashes.
  • They may not start with a digit.
  • They may not end with a period (no trailing period).
About the Author
Alan S. Fisher
Co-Founder and Chairman of Iron Speed, Inc.

Mr. Fisher was a General Partner at Outlook Ventures, Inc., a venture capital company prior to co-founding Iron Speed, Inc. He co-founded Onsale, Inc. (now Egghead.com) and was its Chief Technology Officer from July 1994 to December 1999. He also Co-founded and was President of Software Partners, Inc, a developer and publisher of software products from August 1988 to July 1994. From April 1984 to August 1988, Mr. Fisher served as Technical Marketing Manager and Product Development Manager for Teknowledge, Inc., a developer of artificial intelligence software products. From June 1981 to April 1984, he served as a member of the technical staff for AT&T Bell Laboratories. Mr. Fisher serves on the Board of Directors of Infodata Systems Inc. (NASDAQ:INFD) an e-business consulting services company; He formerly served on the board of a number of companies including Onsale, Inc. (later Egghead.com and now Amazon.com), and FatBrain, Inc. an Internet retailer of technical and professional books.

Mr. Fisher received his B.S. in Electrical Engineering from the University of Missouri and received his M.S. in Electrical Engineering from Stanford University.



  Privacy Statement