You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by David Yang <dy...@nextjump.com> on 2010/09/16 21:07:15 UTC

DataImportHandler with multiline SQL

Hi

 

I am using the DIH to retrieve data, and as part of the process, I
wanted to create a temporary table and then import data from that. I
have played around a little with DIH and it seems like for a query like:
"select x; select y;" you can have select y to return no results and do
random stuff, but the first select x needs to return results.

Does anybody know exactly how DIH handles multiple sql statements in the
query?

 

Cheers,

David


Re: DataImportHandler with multiline SQL

Posted by Lukas Kahwe Smith <ml...@pooteeweet.org>.
On 16.09.2010, at 21:07, David Yang wrote:

> Hi
> 
> 
> 
> I am using the DIH to retrieve data, and as part of the process, I
> wanted to create a temporary table and then import data from that. I
> have played around a little with DIH and it seems like for a query like:
> "select x; select y;" you can have select y to return no results and do
> random stuff, but the first select x needs to return results.
> 
> Does anybody know exactly how DIH handles multiple sql statements in the
> query?

I do not know the answer to that question, but you can have multiple <entity>  tags and so maybe you can just split up your queries like that?

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




RE: DataImportHandler with multiline SQL

Posted by Ephraim Ofir <Ep...@icq.com>.
I'd go with moving this logic to the DB in a stored procedure...

Ephraim Ofir | Reporting and Host Development team | ICQ 
P: +972 3 7665510 | M: + 972 52 4888510 | F: +972 3 7665566 | ICQ#: 18981 | E: ephraimo@icq.com 
 


-----Original Message-----
From: David Yang [mailto:dyang@nextjump.com] 
Sent: Thursday, September 16, 2010 9:07 PM
To: solr-user@lucene.apache.org
Subject: DataImportHandler with multiline SQL

Hi

 

I am using the DIH to retrieve data, and as part of the process, I
wanted to create a temporary table and then import data from that. I
have played around a little with DIH and it seems like for a query like:
"select x; select y;" you can have select y to return no results and do
random stuff, but the first select x needs to return results.

Does anybody know exactly how DIH handles multiple sql statements in the
query?

 

Cheers,

David


Re: DataImportHandler with multiline SQL

Posted by kenf_nc <ke...@realestate.com>.
Sounds like you want the 
http://wiki.apache.org/solr/DataImportHandler#CachedSqlEntityProcessor
CachedSqlEntityProcessor  it lets you make one query that is cached locally
and can be joined to with a separate query.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/DataImportHandler-with-multiline-SQL-tp1514893p1516737.html
Sent from the Solr - User mailing list archive at Nabble.com.