Share via


QueryProdInfoADO

Use this component to retrieve product information from a database.

Ee798978.note(en-US,CS.10).gif Note

  • Use the new QueryCatalogInfo for new applications to take advantage of the new Commerce Server 2000 catalog API.

Intended use: Order Processing pipeline, Product Info stage.

Configuration Values

You can determine the query the QueryProdInfoADO component runs by setting component properties. Use the following boxes on the Query Prod Info (ADO) tab of the Component Properties dialog box to determine this information.

Box Description
Connection String The connection string to connect to the database. This may be a full connection string or a name in a connection map. If blank, the default connection string is passed through.
Query The full SQL text of the query this component will execute, or the name of a query whose full SQL text is defined in the Global.asa file in the QueryMap key.
Parameter List A space-separated list of the parameters to pass to the query. The stockkeeping unit (SKU) for an item (item.sku) is commonly used.

Values Read

The QueryProdInfoADO component reads the following values from the indicated dictionaries.

Key Dictionary Description
DefaultConnectionString Context Optional. The key in the Application dictionary containing the default query string.
ConnectionStringMap Context Optional. The map in which to look up the name of a mapped connection string.
QueryMap Context Optional. A reference to a dictionary containing a query map.

Values Written

The QueryProdInfoADO component writes the following values to the Order dictionary.

Key Description
item._product_* The product information for each SKU found, added to the Item dictionary in the Order dictionary. The column name is appended to form the key name.
item.delete A deletion flag, set to one (1) for an item if it is not found. The item will be deleted from the order.

Remarks

The QueryProdInfoADO component runs a database query to retrieve data about products on the order form. If unique data for the specified query is found, then for each column retrieved by the query, the component writes the data into the item._product_columnvalue keys in the Item dictionary of the order form. This makes product information available to components later in the pipeline.

The connection string must include either the full connection string (the data source name (DSN), database login ID, and database password) or the name of a named connection stored in the connection map.

If you add new columns to the product database table, and if this information is needed by any component in the pipeline, then you must add the column to the query used by the QueryProdInfoADO component.

If data for the specified SKU is found, then for each column retrieved by the query, the QueryProdInfoADO component writes a key and value pair to the Item dictionary. The key consists of the prefix _product_, followed by the column name. Thus, for example, the data in a table column named col would be placed in the value of item._product_col. Finally, the QueryProdInfoADO component initializes the value to contain the data stored in the appropriate column.

If no rows or more than one row are returned by the query, the QueryProdInfoADO component writes a key named delete to the Item dictionary, initializes the delete item to 1 (marking it for deletion) and moves on to the next item. Items marked for deletion are removed from the order form, typically by the RequiredProdInfo component.


All rights reserved.