• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

scalar functions

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Has anyone used scalar functions in JDBC? Examples will be helpful.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic