Autodesk 15606-011408-9300 Developer Guide - Page 90
Setting Up the Query, Controlling the Output, Seeing the Results
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 90 highlights
Setting Up the Query First we'll build the statement. If your map links to a table called Parcel_Data through a data source Assessor, will look like this: SELECT * FROM Parcel_Data The NAME attribute specifies the name of the ColdFusion query. This name can be anything you want, as long as it matches the name specified later in . The DATASOURCE attribute is the OLE DB data source name (DSN), in this case Assessor. Between the beginning and end tags is a SQL statement specifying which part of the table you want to look at (this selection is known as a recordset.) In this case, we're selecting everything (*) from the Parcel_Data table. Controlling the Output Now we'll assemble the statement. If you want to display the parcel number, owner's name, and year built, your tag will look like this: Parcel Number: #APN# Owner Name: #Owner_Name# Year Built: #Year_Built# The QUERY attribute tells ColdFusion which recordset you'd like to display; this attribute matches the NAME you specified in . The names within pound signs (#APN#, #Owner_Name#, #Year_Built#) are ColdFusion variables that match column names in the database table (for example, #APN# refers to the APN column). Everything else is straight HTML. Seeing the Results Now we're ready to load the page in the browser. However, because this particular table has more than 5,000 records, selecting everything in it might not be such a good idea. Let's limit the output by showing only houses built in 1963. To do so, go back to and change the SQL statement to the following: SELECT * FROM Parcel_Data Where Year_Built = '1963' 90 | Chapter 6 Using Reports to Query and Update Data Sources