oracle

Removing duplicate rows in PostgreSQL, Oracle and SQLite

Sometimes you need to remove nasty duplicate on a table, based on a subset of the column. On every big database there is something called “rowid” which can be used to indentify a column in a unique way. On PostgreSQL is called ctid, as we shall see: Oracle way: DELETE FROM your_table WHERE rowid not …

Removing duplicate rows in PostgreSQL, Oracle and SQLite Read More »

Oracle SQL Developer Keep Alive plugin

On some environment, on some customers, Oracle connections are drop after some idle time (i.e. 2 minutes). I have found a small plugin for Sql Developer to solve this issue: it is very handy and logs its usage. Code is also very clean https://github.com/scristalli/sql-developer-keepalive 16 forks. 96 stars. 2 open issues. Recent commits: Update README.md, GitHub …

Oracle SQL Developer Keep Alive plugin Read More »

Oracle Auto increment trigger HOWTO

Oracle SQL Developer is full of nice feature, damned by a overwhelming options pane, like the one I will describe to you right now. Even if  Oracle databases (<12) does not support auto increment, you can easily ask to your sql data modeler to generate for you a sequence and a trigger in a automatic …

Oracle Auto increment trigger HOWTO Read More »

Oracle Database Sync

Oracle SQL Developer is full of nice feature, damned by a overwhelming options pane, like the one I will describe to you right now. I will show here a very fast way of comparing different database and auto-generate migration script. Reverse engineer the source database using Oracle Data Modeler Now select the right arrow  shown …

Oracle Database Sync Read More »

ORA-01461: can bind a LONG value only for insert into a LONG column

Okey, you know Oracle. A very good database, a very old database, a very solid rock. Not famous for its error messages. I have already stumbled upon a misleading error on the old rock. This error anyway is incredible. If you try to push a very long text in a varchar2, you can end up with …

ORA-01461: can bind a LONG value only for insert into a LONG column Read More »

Debian perfect work environment

Working in a big company, my work laptop came with MS-Windows7 Enterprise installed. But as you imagine, Unix is my preferred desktop environment. So let’s how to configure a perfect Debian Linux for a old wolf consultant like me. You will be able to install commercial software mubmo jumbo like Oracle Express and IBM Websphere …

Debian perfect work environment Read More »

Oracle Invalid number ORA-01722

I stumbled upon a very brain-f**k error on Oracle 10g on these days. Context: the following query [sql]SELECT * FROM ( SELECT TO_NUMBER(CUSTOMER_ID) AS SNDG FROM BAD_CODES_TABLE WHERE AND I_LIKE=UPPER(‘STATIC_CONDITION’) AND CUSTOMER_ID NOT LIKE ‘%P%’ ) S WHERE TO_NUMBER(S.SNDG) >2000[/sql] could trigger a Invalid number if CUSTOMER_ID column contains invalid numbers. Why? Well…if you ask …

Oracle Invalid number ORA-01722 Read More »

Twitter il gradasso

C’è una cosa fantastica di Internet: se qualsiasi società prova a fare la furba, inserendo delle righe scritte in piccolo quando revisiona la sua API da 1.0 a 1.1, state certi che ci sarà  almeno una persona che si leggerà tutto, troverà la fregatura e sputtanerà la summenzionata società. E’ quello che è successo con …

Twitter il gradasso Read More »

Windows x64: 32bit Odbc vs 64bit Odbc

I run into a very big trouble on these days. My big company delivered to me a Windows7 64bit system (first error) I asked for Office 64 bit and Visio2007 32 bit I tried to connect to Oracle (second error) to reverse engenieer a DB with Visio2007 I got a “driver architecture” error under Visio2007. …

Windows x64: 32bit Odbc vs 64bit Odbc Read More »

oracle mass table drop

Sometimes I need to build a small script to delete a huge set of tables of a schema. In Oracle is easy to do it, using the meta tables "all_tables", "all_views", and "all_sequences": select  'drop table ' || table_name || ' cascade constraints;'    from all_tables where owner='protoss' and  table_name not like 'BIN%';select  'drop view …

oracle mass table drop Read More »