File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Query

 
deepak carter
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to use SQL to access a text file?
 
deepak carter
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So these documents are stored as what? BLOBs?
 
deepak carter
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its integer
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 2358
31
Linux Oracle Postgres Database Python Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
deepak carter
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there are around 63000 document number so thinking of a query to do it automatically.
 
chris webster
Bartender
Pie
Posts: 2358
31
Linux Oracle Postgres Database Python Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic