All posts in 'Oracle'

Oracle NLS-Lang Settings


To use SQL*Plus Windows correctly, export NLS_LANG like so: set NLS_LANG=GERMAN_GERMANY.WE8MSWIN1252 If you prefer the command line client SQL*Plus, export NLS_LANG like so: set NLS_LANG=GERMAN_GERMANY.WE8PC850

Read the complete article »

Oracle: Drop table if exists replacement


Mysql has a nice “if exists” addition to the drop table statement. If the table to be dropped does not exists, it doesn’t raise an exception but only creates a warning. In Oracle RDMBS you can emulate this behavior like so: BEGIN EXECUTE immediate ‘drop table INSERT_TABLE_NAME_HERE’; EXCEPTION WHEN others THEN IF SQLCODE != -942 […]

Read the complete article »

RFC3339 revisited


Not just for ruby but also the corresponding formats for Java public static final SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat("yyyy-MM-dd’T’HH:mm:ssZ");public static final SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat("yyyy-MM-dd’T’HH:mm:ssZ"); and for Oracle SELECT to_timestamp_tz(’1979-21-09T06:54:00+01:00′,’YYYY-MM-DD"T"HH24:MI:SSTZH:TZM’) FROM dual /select to_timestamp_tz(‘1979-21-09T06:54:00+01:00′,’YYYY-MM-DD"T"HH24:MI:SSTZH:TZM’) from dual / Oracle

Read the complete article »

Fun with sql


What’s all the fuss about this SQL Injection thing? It boils down getting some malicious crafted SQL code into the SQL code of an application, destroying data or authenticate yourself without knowing any real password. xkdc has a nice explanation. The simple cases base on wrong escaped strings and the like. But as this SQL […]

Read the complete article »