<sqlx>
	<functionDef id="Category" description="Extract Categories" schemaentity="catgroup">
		<paramDef name=":storeID" type="string" value="STOREID" description="Store ID"/>
		<body>
        select catgroup.* from catgroup, storecgrp where storecgrp.storeent_id = :storeID and catgroup.catgroup_id = storecgrp.catgroup_id
      </body>
	</functionDef>
	<execute id="Category" description="Extract Categories" schemaentity="catgroup">
		<paramDef name=":storeID" type="string" value="STOREID" description="Store ID"/>
	</execute>
	<functionDef id="Category Description" description="Extract Category Descriptions for a Locale" schemaentity="catgrpdesc">
		<paramDef name=":storeID" type="string" value="STOREID" description="Store ID"/>
		<body>
        select catgrpdesc.* from catgroup, storecgrp, catgrpdesc where storecgrp.storeent_id = :storeID and catgroup.catgroup_id = storecgrp.catgroup_id and catgrpdesc.catgroup_id = catgroup.catgroup_id;
      </body>
	</functionDef>
	<execute id="Category Description" description="ExtractCategory Descriptions       for a Locale" schemaentity="catgrpdesc">
		<paramDef name=":storeID" type="string" value="STOREID" description="Store ID"/>
	</execute>
	<functionDef id="Category Relationship" description="ExtractCategory-Relations for a Locale" schemaentity="catgrprel">
		<paramDef name=":catalogID" type="string" value="(CATALOGID)" description="Catalog Numbers include both master and sales catalogs."/>
		<body>
        select * from catgrprel where catalog_id in :catalogID;
      </body>
	</functionDef>
	<execute id="Category Relationship" description="Extract category-Relations for a Locale" schemaentity="catgrprel">
		<paramDef name=":catalogID" type="string" value="(CATALOGID)" description="Catalog Numbers include both master and sales catalogs."/>
	</execute>
	<functionDef id="Product" description="Extract Product" schemaentity="catentry">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
		<body>
        Select * from catentry where catentry_id in (select catentry_id from catgpenrel where catalog_id in (:masterCatalogID));
      </body>
	</functionDef>
	<execute id="Product" description="Extract Product" schemaentity="catentry">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
	</execute>
	<functionDef id="Product Relationship" description="Extract Product Relationship information" schemaentity="catentrel">
		<paramDef name=":catalogID" type="string" value="(CATALOGID)" description="Catalog Numbers include both master and sales catalogs."/>
		<body>
       select * from catgpenrel where catalog_id in :catalogID
      </body>
	</functionDef>
	<execute id="Product Relationship" description="Extract Product RelationShip information" schemaentity="catentrel">
		<paramDef name=":catalogID" type="string" value="(CATALOGID)" description="Catalog Numbers include both master and sales catalogs."/>
	</execute>
	
	<functionDef id="Product Description" description="Extract Product Description" schemaentity="catentdesc">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
		<body>
		Select * from catentdesc where catentry_id in (select catentry_id from catgpenrel where catalog_id in (:masterCatalogID));
      </body>
	</functionDef>
	<execute id="Product Description" description="Extract Product Description" schemaentity="catentdesc">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
	</execute>
	
	<functionDef id="Product Ship" description="Extract Product Ship information" schemaentity="catentship">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
		<body>
		Select * from catentship where catentry_id in (select catentry_id from catgpenrel where catalog_id in (:masterCatalogID));
      </body>
	</functionDef>
	<execute id="Product Ship" description="Extract Product Ship information" schemaentity="catentship">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
	</execute>
	<functionDef id="Category Product Relationship" description="Extract Category       Product Relations" schemaentity="catgpenrel">
		<paramDef name=":catalogID" type="string" value="CATALOGID" description="Catalog Numbers include both master and sales catalogs."/>
		<body>
        select * from catgpenrel where catalog_id in (:catalogID)
      </body>
	</functionDef>
	<execute id="Category Product Relationship" description="Extract Category Product      Relations" schemaentity="catgpenrel">
		<paramDef name=":catalogID" type="string" value="CATALOGID" description="Catalog Numbers include both master and sales catalogs."/>
	</execute>

	<functionDef id="Product Attribute Values" description="Extract Product Attribute       values for a Locale" schemaentity="attrvalue">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
		<body>
        select * from attrvalue where catentry_id in (select catentry_id from catgpenrel where catalog_id in (:masterCatalogID));
      </body>
	</functionDef>
	<execute id="Product Attribute Values" description="Extract Product Attribute values      for a Locale" schemaentity="attrvalue">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
	</execute>
	<functionDef id="Offer" description="Extract Offer" schemaentity="offer">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
		<body>
        select * from offer where catentry_id in (select catentry_id from catgpenrel where catalog_id in (:masterCatalogID));
      </body>
	</functionDef>
	<execute id="Offer" description="Extract Offer" schemaentity="offer">
		<paramDef name=":masterCatalogID" type="string" value="CATALOGID" description="Master Catalog ONLY"/>
	</execute>
</sqlx>

