All posts tagged with 'Oracle'

SQL Snippets

19-Dec-13

Some useful SQL Snippets: Oracle Create a date without any formatting hassle (like to_date): SELECT DATE’2014-01-01′ FROM dual;select date’2014-01-01′ from dual; Extract values as numbers from a date object SELECT EXTRACT (YEAR FROM DATE’2013-05-06’) FROM dual; SELECT EXTRACT (MONTH FROM DATE’2013-05-06’) FROM dual; SELECT EXTRACT (DAY FROM DATE’2013-05-06’) FROM dual;select extract (year from date’2013-05-06′) from […]

Read the complete article »

JDBC: Autogenerated keys revisited.

02-Apr-08

Some months ago i wrote about retrieving auto generated values with JDBC from an Oracle Database: JDBC: Get autogenerated keys on a Oracle DB. The solution i presented in the previous article doesn’t run in a Oracle Java Stored Procedure. To accomplish this, use a callable statement like this: final String sql = "BEGIN INSERT […]

Read the complete article »