Posts Tagged ‘Tab’

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 from all tables you could do the following:

set heading off;
set feedback off;
spool C:my_file_name.sql
select 'delete from ' || tname ||';' from tab where tabtype = 'TABLE';
spool off;

This will produce an SQL file with a series of delete commands for each table and then you can just run this script which will delete all rows in all tables. The || is the shortcut for the concatenation function in Oracle and this basically works the same as a select script using Dual.

Tab like user_tables refers to a system table that describes the users tables in the schema. Tab has only a few columns and I’ve used this because it has the type of table as a column (just in case). You can see this for yourself by doing:

select * from tab;

And if you do:

select * from user_tables;

You’ll see the difference, user_tables contains alot more data about each table.

You can change the SQL command to ‘truncate table’ or whatever else you want – even drop all tables by querying user_tables instead of tab:

set heading off;
set feedback off;
spool C:my_file_name.sql
select 'drop table ' || table_name || 'cascade constraints;' from user_tables;
spool off;

Using this method you can do the same action across multiple tables and save it for later use.

Tenacious D: Classico on the Bass Guitar

Classico on bass

Not so sure I’ve tabbed this 100% but it’s a start, Tenacious D’s Classico for the Bass guitar. Video at the bottom showing it being played.

It’s essentially parts from Bachs Bouree in E Minor, Beethovens Fur Elise and Mozarts Eine Kleine Nachtmusik. I’ve translated the notes as best I can on the bass but let me know if I’ve got it wrong, I’ve also done this in power tab as well here. Click the image below to see it a bit bigger and better quality.

I do apologise for the sound quality in the video below but through decent speakers you can actually hear the bass, shame about the hissing but its a good enough start.