lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From archit2112 <archit2...@gmail.com>
Subject Timestamp compatibility while performing delta import in solr
Date Wed, 24 Jul 2013 09:32:01 GMT
Im new to solr.I have successfully indexed oracle 10g xe database. Im trying
to perform delta import on the same.
The Delta query required a comparison of last_modified column of the table
with ${dih.last_index_time}.
However in my application I do not have such a column . Also, i cannot add
this column. Therefore i used 'scn_to_timestamp(ora_rowscn)' to give the
value of the required timestamps. This query returns the value of type
timestamp in the following format 24-JUL-13 12.42.32.000000000 PM and
dih.last_index_time is in the format 2013-07-24 12:18:03. So, I changed the
format of dih.last_index_time as to_timestamp('${dih.last_index_time}',
'YYYY/MM/DD HH:MI:SS').

My Data-config looks like this - 

<dataConfig>
<dataSource type="JdbcDataSource" driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@160.110.13.49:1521:xe" user="system"
password="manager" /> 
<document name="product_info">
<entity name="PRODUCT" pk="PID" query="SELECT * FROM PRODUCT"
deltaImportQuery="SELECT * FROM PRODUCT WHERE PID=${dih.delta.id}"
deltaQuery="SELECT PID FROM PRODUCT WHERE scn_to_timestamp(ora_rowscn) >
to_timestamp('${dih.last_index_time}', 'YYYY/MM/DD HH:MI:SS')">
  <field column="PID" name="id" /> 
  <field column="PNAME" name="itemName" /> 
  <field column="INITQTY" name="itemQuantity" />
  <field column="REMQTY" name="remQuantity" />
  <field column="PRICE" name="itemPrice" /> 
  <field column="SPECIFICATION" name="specifications" /> 
  <entity name="SUB_CATEGORY" query="SELECT * FROM SUB_CATEGORY WHERE
SCID=${PRODUCT.SCID}">
    <field column="SUBCATNAME" name="brand" /> 
    <entity name="CATEGORY" query="SELECT CNAME FROM CATEGORY WHERE
CID=${SUB_CATEGORY.CID}">
      <field column="CNAME" name="itemCategory" /> 
    </entity>
  </entity>
</entity>
</document>
</dataConfig>

However,This is not working and im getting the following error - 
Unable to execute query: SELECT * FROM PRODUCT WHERE PID= Processing
Document # 1
Caused by: java.sql.SQLException: ORA-00936: missing expression

Please help me out!!!



--
View this message in context: http://lucene.472066.n3.nabble.com/Timestamp-compatibility-while-performing-delta-import-in-solr-tp4079982.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message