aspose file tools*
The moose likes JDBC and the fly likes scalar functions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "scalar functions" Watch "scalar functions" New topic
Author

scalar functions

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Hi,
Has anyone used scalar functions in JDBC? Examples will be helpful.


Groovy
Joshua Doerring
Greenhorn

Joined: Aug 08, 2003
Posts: 19
I use scalar functions to get date information from date fields in a query.
For example I have a table called EMPLOYEE and it has a BIRTHDATE field. If I wanted to split out the month, day, year here's how I'd do that.
SELECT firstname, lastname, MONTH(birthdate), DAY(birthdate), YEAR(birthdate)
FROM employee
WHERE department = "01"
You'd get something like this:
Bob, Smith, 8, 25, 1971
Sam, Thompson, 5, 11, 1966
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: scalar functions