If you are getting the values from one result set and placing them in a second result set, you will need to use two @XResultSetSearch commands. First do an @XResultSetSearch to get the result set you are reading from, and use @XResultSetValue to read the value(s) you interested in. If your search returns more than one record, use XResultSetCurrentPosition to control which record(s) it is reading values from. Then use another call to @XResultSetSearch to second a second handle to the second database. Then use XResultSetValue with that second handle to write the values into the fields in the appropriate records. If your second search returns more than one result, use XResultSetCurrentPosition to control which records are being written to. Then close both result sets with two calls to XResultSetClose, one for each "open" handle.
If we assume that each search only returns one record:
// search database1 ("Pricing") for a particular region
handle1 = @XResultSetSearch(@FN, "Pricing", SEARCH_MODE_OR, SEARCH_SYNTAX_QA, "RegionID=" + vRegion)
if(handle1 <> -1)
{
// search the second database ("Inventory") for an item ID
handle2 = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_OR, SEARCH_SYNTAX_QA, "ItemID=" + vItem)
if(handle2 <> -1)
{
// get the price from database 1 (for the specific region)
vPrice = @XResultSetValue(handle1, "Price")
// write the value to a different field in the record in database 2, as returned by the search
XResultSetValue(handle2, "ItemPrice", vPrice)
// close the result set for database 2
XResultSetClose(handle2)
}
// close the result set for database 1
XResultSetClose(handle1)
}
I don't have access to Sesame right now, so I couldn't test the code above and wrote it from memory. But it should be enough to give you the basic idea of how to use two result sets from two different databases. You will, of course, have to include the steps I left out, like declaring variables.