Gravatar for

Question by aga, Nov 20, 2015 10:50 AM

Creating AccessorSubQueries


Im trying to use AccessorSubQueries to index an Oracle database. If I do not use the AccessorSubQueries then all my documents get indexed. But when I use the AccessorSubQueries none of the documents get indexed and the log is filled with this warning:

Unable to index document : There is a formatting error in a sub query. Cannot find master key %[item_id].

<?xml version="1.0" encoding="utf-8" ?> 
            <AllowedUser type="Windows" allowed="true">
    <Mapping type="Products">
        <Accessor type="query">
            select im.item_id  from t im  where im.item_id = 10000 order by im.item_id
            <AccessorSubQuery name="productPros" separator=";" behaviorOnMultiRows="join" allowDuplicates="false"> 
                select p.item_Id from t p where p.item_Id= %[item_id]                   

1 Reply
Gravatar for

Answer by mgrondines, Dec 4, 2015 10:38 AM

The key in the Sub Query must match exactly what is returned by the server. More importantly, it is case-sensitive. For instance, you ask for im.item_id, but the server might return something like Item_ID. Ensure that the key returned matches the returned key.

Ask a question