none
JDBCPrimaryKeyField not in result set when crawling SQL Server data RRS feed

  • Question

  • Hi All,

    I am indexing a SQL View using JDBC configuration file.

    The view has 2 fields which make the primary key i.e. composite field

    The SQL statment is in the following format i.e. Select X,Y, .... from dbo.ViewName

    where X,Y make the composite key.

    When I start to crawl the SQL Source I get an error:

    JDBCPrimaryKeyField not in result set

    a) I have checked the case for the fields to match the SQL statement for view and it matches.

    b) Have tried with comma and semi-colon separator in the JDBCPrimaryKeyField value but still the same error i.e. X,Y  or X;Y

    Could you please suggest any ideas what could be wrong?

    Thanks,

     

     


    -- Mohan | My Blog
    Monday, February 14, 2011 6:58 PM

Answers

  • Hi Rob

    I had resolved the error  by

    Concatenating the two key in SQL view and then use that as id in the primary key element of jdb  config  file

    I still want to know if there is a solution for that by only using the jdbc config file


    -- Mohan | My Blog
    • Marked as answer by Mohan Taneja Friday, February 18, 2011 3:50 AM
    Friday, February 18, 2011 1:51 AM

All replies

  • Hi Mohan,

    Regarding the error:

    ERROR [JDBCAdapter] Caused by: JDBCPrimaryKeyField not in result set: DocumentId

    This is caused by the JDBCPrimaryKeyField value needing to be the output value of the primary key.  To resolve this, for the JDBCPrimaryKeyField value in the JDBC Connector config file, replace DocumentID with getpath. This should result in the JDBCPrimaryKeyField value being the output value of the primary key.

     

    SQL Statement Example:

    Select DocumentID as getpath”

     

    Let us know your results, and feel free to provide your complete SQL statement for a more specific recommendation if needed.

     

    Thanks!

    Rob Vazzana | Microsoft | Enterprise Search Group | Senior Support Engineer | http://www.microsoft.com/enterprisesearch

     

     

    Thursday, February 17, 2011 6:24 PM
  • Hi Rob

    I had resolved the error  by

    Concatenating the two key in SQL view and then use that as id in the primary key element of jdb  config  file

    I still want to know if there is a solution for that by only using the jdbc config file


    -- Mohan | My Blog
    • Marked as answer by Mohan Taneja Friday, February 18, 2011 3:50 AM
    Friday, February 18, 2011 1:51 AM