Dependent lookup

Top  Previous  Next

Dependent Lookup queries can be used by streets normalizers to retrieve the readable text for a location based two fields. Like a lookup query that returns readable text for a single value, the Dependent lookup queries uses two values. Crash Magic stores the results of this query to display the text to the Crash Magic user

 

 

The following are the fields required for a lookup query:

 

DBNAME: Reserved for future use. This should be blank ('').

 

DBTABLE: Reserved for future use. This should be blank ('').

 

DBFIELD: This is the name of the field that needs to be looked up.

 

DBVALUE: This field contains the values that will be looked up.

 

DBPARENTVALUE: This field contains the parent value that will be used by the streets normalizer. This value is the Unique1 field from the streets normalizer.

 

DBLOOKUP: This field contains the information displayed to the Crash Magic user.  

 

 

Crash Magic uses DBVALUE and DBPARENTVALUE to locate the DBLOOKUP field.

 

 

SELECT

   '' AS Dbname,

   '' AS Dbtable,

   'CITY_SECT_ID' AS DBFIELD,

   City.CITY_SECT_ID AS DBVALUE,

   Cnty.CNTY_ID AS DBPARENTVALUE,

   City.CITY_SECT_NM AS DBLOOKUP

 

 

FROM

     Dbo.CITY_SECT City

     INNER JOIN dbo.ST Cnty ON ((Cnty.City_Sect_Id=City.CITY_SECT_ID))

 

ORDER BY 

City.CITY_SECT_NM Asc

In this example the CITY_SECT_ID and the CNTY_ID fields are used to find the city name field, CITY_SECT_NM.