Archive for the ‘oracle/database’ Category

Nerd alert: Finding non-printing characters in varchar2 fields in Oracle

How to find non printing characters using instr and regexp_instr in Oracle databases:

Posted in oracle/database | No Comments »

More Oracle regexp_like

Two more examples of regexp_like for the memory banks: — convert to NULL if SOME_COL is not A,B,C,1,2,or 3 case when (regexp_like(a.SOME_COL,’[^A-C1-3]‘)) then NULL else a.SOME_COL end as SOME_COL, — convert to 0000 if the col’s value is not a series of valid digits case when (regexp_like (a.ANOTHER_COL,’[^[:digit:]]’)) then ’0000′ else a.ANOTHER_COL end as ANOTHER_COL,

Posted in oracle/database | No Comments »

Numeric validation with Oracle regexp_like

PROBLEM: Identify records where there is non-numeric values for a particular column. SOLUTION: select SOME_COL from SOME_TBL where regexp_like (SOME_COL,’^[^[:digit:]]’) ; Obviously this implies that maybe the field should be a NUMBER datatype to start with, but sometimes what we want, what we should have, and what we actually have are not the same thing.

Posted in oracle/database | No Comments »

MySQL Gotchas

Geek blog [Slashdot] has been abuzz since it was announced that [MySql], darlings and key ingredient of the [LAMP] explosion, is doing business with SCO, the absolute scourge of the Linux world. Now that MySQL has been associated with the devil, some folks are giving a longer look at [PostgreSQL]. While Postgres isn’t quite as [...]

Posted in oracle/database | No Comments »

Oracle and DECODE- updated

DECODE- better than an Ovaltine Little Orphan Annie Decoder Ring

Posted in oracle/database | No Comments »