Main menu:

Site search

Categories

Tags

intern

Oracle und SQL

Perl

Archive for 'SQL Beispiele'

Oracle 11.2:IGNORE_ROW_ON_DUPKEY_INDEX – Please No!

Oracle hat mit 11.2 neue optimizer hints “erfunden” und zwar auch IGNORE_ROW_ON_DUPKEY_INDEX. Er dient dazu (wie der Name schon sagt) bei einem INSERT  (und nicht bei einem UPDATE!) auf einen Unique Key die Exception zu ignorieren und das statement tut dann einfach nichts. Es würde dann also zb funktionieren (ohne unique key violation): insert into […]

20 Jahre Mauerfall im Lichte von RDBMS

In jedem meiner Datenbankkurse predige ich ein paar Stehsätze einer davon lautet jede Tabelle muß eine “abstrake” ID haben, und es ist sehr schlecht “scheinbar” eindeutige numerische Felder wie zum Beispiel Kontonummer, Personalnummer oder auch die Postleitzahl als ID zu mißbrauchen. Ich bringe immer das Beispiel das eine Personentabelle mit einer Orte Tabellen über die […]

New Feature for collections in Oracle 11

Starting with Oracle 11 it is now possible to use set operators on “some” collection types (ie varrays and nested tables, NOT index by Tables). A simple example: PROCEDURE COLL_SET_OP IS cursor c_emp(c_p_salary number) is select first_name, last_name, salary from employees where salary > c_p_salary; type t_emp is table of varchar2(50); a1_emp t_emp := t_emp(); […]

Compare available Objects on two Oracle Instances

Compare available Objects on two Oracle Instances For this snippet to work you need a functioning database link select object_name, object_type from user_objects@; minus select object_name, object_type from user_objects to get the actual DDL (for a package body in this example) statments you have to issue select referenced_name, dbms_metadata.get_ddl(referenced_type, referenced_name) from ( select name, type, […]

Die With Clause

Möchte man herausfinden welcher Vermieter wieviel Autos mit welchem Extra anbietet, also zum Beispiel wieviele Autos hat “Karls Luxuskutschen” mit Klimaanlage und Automatik, kommt einem die “with clause” zur Hilfe with verm_extras as ( SELECT vrm_name, ext_name FROM tst_vermieter, tst_fahrzeuge, tst_fhz_ext_int, tst_extras WHERE ( (tst_vermieter.vrm_id = tst_fahrzeuge.fhz_vrm_id) AND (tst_fahrzeuge.fhz_id = tst_fhz_ext_int.fei_fhz_id(+)) AND (tst_extras.ext_id(+) = tst_fhz_ext_int.fei_ext_id) […]

Dealing with student loans The consequences of defaulting on student loans are steep. Students who default on loans owed to their school receive a discharge of their federal student loans, which could mean losing access to any federal education aid, this means they wouldn’t be eligible for any graduate student loans in the future. In […]