This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes Complex SQL Statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Complex SQL Statements" Watch "Complex SQL Statements" New topic

Complex SQL Statements

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
I have a report using jasperreports(itext)

Is there any way to have a function in the SQL statement as a column and have that function run a seperate SQL statement?

Somthing like "Select f1, myfunction(f1) As f2 From mytable"
Rob Spoor

Joined: Oct 27, 2005
Posts: 19723

I have done similar things quite often:
Of course this function can have only a single row in the result set.

Moving to the JDBC forum.

How To Ask Questions How To Answer Questions
Jan Cumps

Joined: Dec 20, 2006
Posts: 2504

What is your database? Oracle has stored functions that can be used in queries.

OCUP UML fundamental and ITIL foundation
youtube channel
wood burning stoves
subject: Complex SQL Statements