Home > Contents > Index >
SEARCHSTATE.ADDRANGECONSTRAINT
Adds a range constraint for a specific attribute name.
Syntax
<SEARCHSTATE.ADDRANGECONSTRAINTNAME="ssname" [BUCKET="bucketname"] [TYPENAME="assettype"] ATTRIBUTE="attribname" LOWER="lowrange" UPPER="uprange" [CASEINSENSITIVE="true|false"] />Parameters
NAME(required)- Input parameter. Name of an object representing a searchstate.
BUCKET(optional)- Input parameter. Bucket name. If not specified, the attribute name is used. Use this parameter to indicate which constraint you need when the same attribute is used in multiple contstraints. A bucket is an alias and functions similar to an inner join in SQL; when you have multiple tables that have columns of the same name, you must specify the table name to indicate which column you are requesting.
TYPENAME(optional)- Input parameter. The internal asset name for the attribute (either
CAttributesfor content attribute, orPAttributesfor product attribute). If you do not specifyTYPENAME, a value is supplied from a property in thegator.iniproperty file:mwb.defaultattributes=PAttributes.The default value is set to bePAttributesand may be changed to be the name of any custom attribute asset types you create.
ATTRIBUTE(required)- Input parameter. Name of the attribute to constrain.
LOWER|LOWEREQUAL(required)- Input parameter. The bottom end of the range.
UPPER|UPPEREQUAL(required)- Input parameter. The top end of the range.
CASEINSENSITIVE (optional)- Input parameter. A Boolean value:
trueindicates that the comparison is case-insensitive;false(the default) considers case in the comparison.
Error Numbers
The possible values of
errnoinclude:
Value Description -10004 A required parameter is missing. -13050 General error.Example
This code creates an empty
SEARCHSTATEand adds a range constraint. The constraint setsupperandlowerlimits on theattributebeing searched on. Thetypenameparameter is not specified and the default set in gator.ini is picked up. Any assets with values for this attribute in that range will be returned as matches for this constraint. This code then sets thisSEARCHSTATEinto anASSETSET.SETSEARCHEDASSETStag to constrain theASSETSETto be used when searching with other assetset tags. The last tag uses this constrained assetset to search for matching assets and fetch a list of actual values for theattributeof the returned assets:<SEARCHSTATE.CREATE NAME="ss" /> <SEARCHSTATE.ADDRANGECONSTRAINT NAME="ss" ATTRIBUTE="price" UPPER="3" LOWEREQUAL="2"/> <ASSETSET.SETSEARCHEDASSETS NAME="as" CONSTRAINT="ss" ASSETTYPES="Products"/> <ASSETSET.GETATTRIBUTEVALUES NAME="as" ATTRIBUTE="price" LISTVARNAME="resultlist"/> <LOOP LIST="resultlist"> <CSVAR NAME="resultlist.value"/><br/> </LOOP>See Also
SEARCHSTATE.CREATE
SEARCHSTATE.ADDRICHTEXTCONSTRAINT
SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT
ASSETSET.SETSEARCHEDASSETS
ASSETSET.GETATTRIBUTEVALUES
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.