Peter,

Looks like you can call timestampValue() on that object and get back a
java.sql.Timestamp, which is a subclass of java.util.Date:
http://docs.oracle.com/cd/E16338_01/appdev.112/e13995/oracle/sql/TIMESTAMP.html#timestampValue__

Hope that helps,

Michael Della Bitta

------------------------------------------------
Appinions
18 East 41st Street, 2nd Floor
New York, NY 10017-6271

www.appinions.com

Where Influence Isn’t a Game


On Wed, May 8, 2013 at 9:35 AM, Peter Schütt <newsgro...@pstt.de> wrote:

> Hallo,
> I have a field with the type TIMESTAMP(6) in an oracle view.
>
> When I want to import it directly to SOLR I get this error message:
>
> WARNING: Error creating document : SolrInputDocument[oid=12,
> last_action_timestamp=oracle.sql.TIMESTAMP@34907781, status=2, ...]
> org.apache.solr.common.SolrException: Invalid Date
> String:'oracle.sql.TIMESTAMP@
> 34907781'
>         at org.apache.solr.schema.DateField.parseMath(DateField.java:182)
>         at org.apache.solr.schema.TrieField.createField(TrieField.java:616)
>         at org.apache.solr.schema.TrieField.createFields
> (TrieField.java:655)
>
> What is the best way to import it?
>
>
> This way works but I do not know if this is the best practise:
>
> In the query:
>
>         TO_CHAR(LAST_ACTION_TIMESTAMP, 'YYYY-MM-DD HH24:MI:SS') as LAT
>
> For the field:
>
>    <field column="LAT" name="last_action_timestamp"
> dateTimeFormat="yyyy-MM-dd hh:mm:ss" />
>
> Conversion from timestamp to string to timestamp seems to me not a good
> way. Is there a better way?
>
> Thanks for any hints.
>
> Ciao
>   Peter Schütt
>
>

Reply via email to