Skip to content

Instantly share code, notes, and snippets.

@Sakurina
Created August 31, 2010 14:04
Show Gist options
  • Save Sakurina/559063 to your computer and use it in GitHub Desktop.
Save Sakurina/559063 to your computer and use it in GitHub Desktop.
fuckoracle-banner -- a part of the FuckOracle project
set serveroutput on;
DECLARE
TYPE ct IS REF CURSOR;
bu VARCHAR2(264) := '';
lb VARCHAR2(1000);
qs VARCHAR2(1000);
le BINARY_INTEGER;
cu ct;
CURSOR cf IS
SELECT table_name, column_name FROM user_tab_columns WHERE data_type='VARCHAR2';
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
FOR f IN cf LOOP
qs := 'SELECT ' || f.column_name || ' FROM ' || f.table_name;
OPEN cu FOR qs;
LOOP
FETCH cu INTO lb;
EXIT WHEN cu%notfound OR LENGTH(bu) = 264;
lb := UPPER(TRANSLATE(lb,'a ','a'));
IF (LENGTH(bu) + LENGTH(lb)) > 264 THEN
le := 264 - LENGTH(bu);
lb := SUBSTR(lb,0,le);
END IF;
bu := bu||lb;
END LOOP;
CLOSE cu;
END LOOP;
-- FUCK
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,1,12)||' '||SUBSTR(bu,13,4)||' '||SUBSTR(bu,17,4)||' '||SUBSTR(bu,21,12)||' '||SUBSTR(bu,33,4)||' '||SUBSTR(bu,37,4));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,41,12)||' '||SUBSTR(bu,53,4)||' '||SUBSTR(bu,57,4)||' '||SUBSTR(bu,61,12)||' '||SUBSTR(bu,73,4)||' '||SUBSTR(bu,77,4));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,81,4)||' '||SUBSTR(bu,85,4)||' '||SUBSTR(bu,89,4)||' '||SUBSTR(bu,93,3)||' '||SUBSTR(bu,96,4)||' '||SUBSTR(bu,100,4));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,104,12)||' '||SUBSTR(bu,116,4)||' '||SUBSTR(bu,120,4)||' '||SUBSTR(bu,124,3)||' '||SUBSTR(bu,127,9));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,136,12)||' '||SUBSTR(bu,148,4)||' '||SUBSTR(bu,152,4)||' '||SUBSTR(bu,156,3)||' '||SUBSTR(bu,159,9));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,168,4)||' '||SUBSTR(bu,172,11)||' '||SUBSTR(bu,183,3)||' '||SUBSTR(bu,186,4)||' '||SUBSTR(bu,190,4));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,194,4)||' '||SUBSTR(bu,198,11)||' '||SUBSTR(bu,209,12)||' '||SUBSTR(bu,221,4)||' '||SUBSTR(bu,225,4));
DBMS_OUTPUT.PUT_LINE(SUBSTR(bu,229,4)||' '||SUBSTR(bu,233,11)||' '||SUBSTR(bu,244,12)||' '||SUBSTR(bu,256,4)||' '||SUBSTR(bu,260,4));
-- ORACLE
DBMS_OUTPUT.PUT_LINE('.'||SUBSTR(bu,264,5)||' '||SUBSTR(bu,269,6)||' '||SUBSTR(bu,275,5)||' '||SUBSTR(bu,280,2)||' '||SUBSTR(bu,282,7));
-- OOOOO RRRRRR AAA CCCCC LL EEEEEEE
-- OO OO RR RR AAAAA CC C LL EE
-- OO OO RRRRRR AA AA CC LL EEEEE
-- OO OO RR RR AAAAAAA CC C LL EE
-- OOOO0 RR RR AA AA CCCCC LLLLLLL EEEEEEE
END;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment