File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Query" Watch "SQL Query" New topic
Author

SQL Query

deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
Hi All,


i want to create a sql query to store some document numbers in a text file and then create an another sql query which will take the input from the first query result text file.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why do you want to use SQL to access a text file?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
the main requirent is see:

select d.dmedocno from document d JOIN custprop c
ON d.documentid=c.documentid
where (c.strdata is not null
or c.datedata is not null or c.numdata is not null
or c.booldata is not null or c.blobdata is not null)
group by d.dmedocno having count(c.propertyname)=4

This above returns returns about 63000 rows each containing one document number like eg
13434
22321
83534
90345
etc...

now for each of this document number i have to find specific property and each of this document number may be associated with 4 of the properties

SO how to do this
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

So these documents are stored as what? BLOBs?
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
its integer
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sorry, not following you. Are you trying to search the contents of your documents? Or are you trying to do something else?
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
for every document number where are some properties associated with it.I want to use that document number and search for those properties.
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1873
    
  16

deepak carter wrote:for every document number where are some properties associated with it.I want to use that document number and search for those properties.

Having trouble understanding your problem, but where are these "properties"? If they're in a table, why can't you just select them from the table using the document number as a search criterion?


No more Blub for me, thank you, Vicar.
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
there are around 63000 document number so thinking of a query to do it automatically.
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1873
    
  16

Why don't you tell us what your tables look like? Maybe then somebody can help you write the query. But if your document attributes are not in a table, then obviously SQL queries won't help much (unless you want to get into things like Oracle external tables).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Query