Database Notes
SQL Cookbook
TO_DATE
update security set passwrd_expires = TO_DATE('01/08/2008', 'DD/MM/YYYY') where id = 'SOMEUSER'
TO_CHAR
select to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Current Time" from dual;
Hypersonic - HSQL
Hypersonic has a gui database client in the jar file. The client can be used to inspect the database contents, but should be used with care.
The gui database client can be run from the WEB-INF\lib directory of the servlet container.
| Stop the servlet container prior to running the gui database client. |
Be sure to copy all the commands below, they may scroll off the screen to the right.
/usr/bin/java -cp hsqldb-1.7.3.3.jar org.hsqldb.util.DatabaseManagerSwing -url jdbc:hsqldb:file:/pix-data/hypersonic
java.exe -cp hsqldb-1.7.3.3.jar org.hsqldb.util.DatabaseManagerSwing -url jdbc:hsqldb:file:C:\pix-data\hypersonic
Oracle
ADD_MONTHS
update reward_coupon set end_dt = add_months(sysdate, -5) where fulfillment_id = 'DINEOUT2'