{ Category Archives }
oracle
Websphere Wierdness
I discovered a joyful thing with the websphere JDBC connection:
You want to make a prepared statement that uses the “like” operator.
You write :
select * from SOMETABLE where SOMECOLUMN like ?
and it throws an IndexOutOfBoundsException !!
YOU HAVE TO GET THE CASE CORRECT! so :
select * from SOMETABLE where SOMECOLUMN LIKE ?
or
select * from SOMETABLE where SOMECOLUMN Like ?
Weird eh ?
also if you want to select by a date you have to do :
select * from SOMETABLE where SOMEDATECOLUMN = to_date(?, ‘dd-mm-yyyy’)
putting in whatever format you have.
Scary Oracle Guy
http://www.dba-oracle.com/t_alter_table_rename.htm
create table faq_tbl( id number, doc xmltype, hits number) XMLTYPE COLUMN doc XMLSCHEMA "http://www.oracle.com/faq.xsd" ELEMENT "FAQ"
