Oracle Archive

  • Oracle: Delete all rows from all tables etc…

    Oracle: Delete all rows from all tables etc…

    Quick method to do multiple actions across multiple tables. Simply spool a script with your commands in for each table – this way you can avoid dropping your tables or user and still keep all your schema structure. So for instance to delete all data...

    Project info

  • Oracle: Update From equivalent

    Oracle: Update From equivalent

    Quick note on how to update data in a series of joined tables using a subquery in the UPDATE statement in Oracle, kind of like the UPDATE FROM in SqlServer. First of all check out the above diagram, I’ve stolen it from this link: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/update_statement.htm...

    Project info

  • Changing the HTTP port Oracle uses

    Changing the HTTP port Oracle uses

    In a production environment your database server will be completely separate from your application server or at least it should be. So in theory you should never really need to change this setting unless its for your development environment. In my case I needed to...

    Project info

  • Setting Database Connections in JBoss/ ATG

    Setting Database Connections in JBoss/ ATG

    ATG communicates to a database via JBoss via a dynamo server setup or in your home/localconfig directory if you’re not using specific dynamo servers. In this setup you specify the JNDI connection name which will then refer to an XML file which makes up part...

    Project info

  • Joining columns/ concatenate strings in Oracle PLSQL/ MySQL

    Joining columns/ concatenate strings in Oracle PLSQL/ MySQL

    Joining columns and results together is really easy in Oracle or MySQL, in both there is the same function – CONCAT(). However you should be aware that there are differences between the databases on how this function works. In MySQL the CONCAT() function works by...

    Project info

  • Writing basic case switch statements in Oracle PL/SQL

    Writing basic case switch statements in Oracle PL/SQL

    This is the equivalent code for writing a switch statement in Oracle. In Oracle to do the switch we use a function called case. Which looks for a value in the field specified, when it returns true it returns a value else returns a default....

    Project info

  • Spool a CSV file from Oracle/ SQL*Plus without quotes

    Spool a CSV file from Oracle/ SQL*Plus without quotes

    Quite useful, I had the case where I needed to provide a CSV file to an external party from our Oracle 10g database. No problem, there are loads of CSV export tools out there. But it then transpired that the CSV’s that I was generating...

    Project info

  • LIMIT equivalent for Oracle

    LIMIT equivalent for Oracle

    So you use MySQL etc… and you’re used to adding a LIMIT clause to your query for example, SELECT * FROM table WHERE name = ‘bob’ LIMIT 1 And now you’re using Oracle and want to do the same thing? But it throws some dread...

    Project info