open-menu closeme
Home
RetroComp icon
Retro Computing Articles Composition Notebooks 8bit
DevOps icon
Automation K8s Done Right
GenAI icon
Fatlama Newsletter Generative AI
Projects icon
Software Projects Arduino Misterio Esp8266 SQLite
Status
Links icon
GitHub LinkedIn
About
github linkedin rss
  • Smart Sync

    calendar Mar 21, 2021 · 1 min read
     en software-projects  · database oracle sqlite
     ·
    Share on: twitter facebook linkedin copy

    On 2002, I was forced to build a small java class to “sync” two databases (sorry for Italian):

    SmartSync used the Metadata offered by JDBC API to be able to copy data between two tables. In the last years I evolved it to be able to support a special use case called “dump to SQLite”.


    Read More
  • Semplice metodo per storicizzare i dati su database

    calendar Mar 16, 2021 · 6 min read
     it sql  · database oracle
     ·
    Share on: twitter facebook linkedin copy

    Abstract: Storicizzare i dati spesso è un attività considerata “secondaria”, ma un cattivo design porta a base dati difficili da ottimizzare e spesso poco comprensibili. In questo articolo illustriamo un semplice metodo che rispetta i dettami della teoria relazionale, è facile da capire ed è attivamente usato in produzione.


    Read More
  • SQLite Oracle Compatibility Layer

    calendar Aug 7, 2018 · 1 min read
     en projects python software-projects sql  · oracle sql sqlite
     ·
    Share on: twitter facebook linkedin copy

    The Sqlite Oracle Compatibility Functions is an experimental compatibility layer for SQLite vs Oracle, written in Python 3.

     

    It aims to provide a minimal compatibility with Oracle. The need was having some regular expression functions, and I do not like to work with risky C code, like this university project did


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

    calendar Jun 15, 2017 · 1 min read
     en knowledgebase sql  · evil oracle postgresql sql
     ·
    Share on: twitter facebook linkedin copy
    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:


    Read More
  • Italian Accent Oracle fix

    calendar Feb 10, 2017 · 1 min read
     en sql  · oracle relax
     ·
    Share on: twitter facebook linkedin copy

    In Italian language we have accent words like àèéìòù

    They are quite important because for instance “is” is spelled

    è

    whereas “and” is spelled

    e

    Accent are bad guys even today: if you copy them from MS-Word inside an Oracle sql script you can end up with different UTF-8 values. Also the accent are likely to be destroyed if you past them in your html page without using the correct html entity (i.e. è )


    Read More
  • Oracle Auto increment trigger HOWTO

    calendar Dec 13, 2016 · 1 min read
     en featured knowledgebase sql  · oracle tip
     ·
    Share on: twitter facebook linkedin copy
    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 way.


    Read More
  • Oracle Database Sync

    calendar Nov 22, 2016 · 1 min read
     en featured knowledgebase sql  · oracle tip
     ·
    Share on: twitter facebook linkedin copy
    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.

    1. Reverse engineer the source database using Oracle Data Modeler
    2. Now select the right arrow  shown below: sync-with-db
    3. Select the destination datasource (more here) when asked.
    4. The compare pane will enable you to compare the databases. But the default options will also use schema name to detect different object, so you will not get what you want in every scenario. In 50% of my daily job, schema are different, so you must select the options below to fix it: Select "Options" and then "Compare options". Then  de-select "Use schema property" like suggested below: magic-option
    5. Push the "Sync new object". Then push the "DLL Preview" button and inspect the generated database.
    6. Bonus: by default the tool will not include tables to drop. Inspect the two pane ad check the table you want to drop in the left pane.
    7. Refrain launching the script without proper testing. You are migrating your valuable data.
  • ORA-01461: can bind a LONG value only for insert into a LONG column

    calendar Sep 1, 2015 · 1 min read
     en knowledgebase  · bad oracle relax sql
     ·
    Share on: twitter facebook linkedin copy
    ORA-01461: can bind a LONG value only for insert into a LONG column

    Disapprove with me! Disapprove with me!

    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 a


    Read More
  • Debian perfect work environment

    calendar Sep 28, 2014 · 3 min read
     en featured software unix-featured  · ibm linux oracle unix virtualization
     ·
    Share on: twitter facebook linkedin copy
    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 in a snap, and have a 64 rock solid system, easy to bring in a USB stick if you like.


    Read More
  • Oracle Invalid number ORA-01722

    calendar Jul 15, 2013 · 1 min read
     en knowledgebase sql  · bad bug oracle sql
     ·
    Share on: twitter facebook linkedin copy
    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 to “explain plan”, you will get something like

    • a table full scan
      • Filter Predicates AND
        • I_LIKE=UPPER('STATIC_CONDITION')
        • TO_NUMBER(S.SNDG) >2000
        • CUSTOMER_ID NOT LIKE '%P%'

    Read More
  • Twitter il gradasso

    calendar Aug 25, 2012 · 2 min read
     it  · api avvocato-del-diavolo development freedom mysql oracle
     ·
    Share on: twitter facebook linkedin copy

    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, e Marco Arment analizza nei dettagli le “novità” della nuova Twitter API che passa dalla versione 1.0 alla 1.1.

    Vi rimando all’articolo per i dettagli, ma in buona sostanza Twitter sta cercando di fare in modo che “se voi fate qualcosa di interessante con Twitter, bhe ora dovete collaborare con noi…per continuare a farlo….”:


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

    calendar Nov 10, 2011 · 1 min read
     en knowledgebase  · database oracle
     ·
    Share on: twitter facebook linkedin copy
    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. Launching %WINDIR%\\System32\\odbcad32.exe

    (the 32bit guy of the odbc drivers side) I was able to get the same error… and this was helpful:


    Read More
  • Shopping in the IT

    calendar Jan 21, 2008 · 2 min read
     blog-objectsrootcom en software  · ant apple arc database db engine file good google hard make microsoft mysql news opinion oracle ping search search-engine sql ui war web
     ·
    Share on: twitter facebook linkedin copy
    Shopping in the IT


    Oracle buys BEA and Sun buys MySql.

    In reply,Migrosoft is hungry and is watching Yahoo :-)

    <joking> 

    Any bets on the next money-based-news?

    I'm going for

    • Oracle buys Sun: "We need more hardware to run Oracle and WebLogic together! "
    • Google buys Oracle: "We have *even* more hardware...come on!"
    • Apple buys Google: "So nice LOGO", retrodating a bunch of stock options, I suppose.
    • Microsoft buys Apple ("So annoied their are more cool then us!") and shut down all them all so you will end up using their search engine, I hope.

    </joking> 


    Read More
  • oracle mass table drop

    calendar Jul 3, 2007 · 1 min read
     blog-objectsrootcom en  · build easy oracle postgresql script small sql table ui vi
     ·
    Share on: twitter facebook linkedin copy
    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 ' || view_name || ' ;'
       from all_views where owner='zerg' ;
     
      select  'drop sequence ' || sequence_name || ' ;'
       from all_sequences where sequence_owner='spacemarine' ;

    The "BIN%" table are special temp tables of oracle.


    Read More

Recent Posts

  • Arduino Q da far crescere
  • Postgres Take it All
  • La ruota del Destino
  • Darth Android
  • Vps Provider
  • Chat
  • RSS Readers

Latest comments

    Giovanni Giorgi

    Copyright 1999-  GIOVANNI GIORGI. All Rights Reserved

    to-top