oracle

Limit number of rows in an oracle query

select *
from (
select *
from (select * from CODETABLE_READCODE)
order by DESCRIPTION
)
where rownum <= 6

  • Share/Bookmark

databases
oracle
sql

Comments (1)

Permalink

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.

  • Share/Bookmark

databases
oracle
sql
websphere

Comments (0)

Permalink

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"
  • Share/Bookmark

oracle

Comments (0)

Permalink

Renaming oracle

alter table
SONGS
rename to
SONGS_HUGE;

AAAARRRHGG!!

  • Share/Bookmark

oracle

Comments (0)

Permalink

Oracle functions

to_date

to_number

decode

all do what i needed. damn!

  • Share/Bookmark

oracle

Comments (0)

Permalink