Archiv für September 2007

Falls jemand schon einmal eine ORA-00904 bekommen hat, als er versucht hat einen XMLType in ein CLOB umzuverwandeln, …

SQL> select attributes.getCLOBVal() from product_xv;
select attributes.getCLOBVal() from product_xv
*
ERROR at line 1:
ORA-00904: “ATTRIBUTES”.”GETCLOBVAL”: invalid identifier

Elapsed: 00:00:00.00

… der sollte einmal ein Tabellen-Alias verwenden. Ohne diesem geht es nämlich nicht:

SQL> select p.attributes.getCLOBVal() from [...]

Von admin, 28. September 2007, 16:06 Uhr

Leider gibt es keine RENAME $oldname$ TO $newname$ für Stored-Procedures in Oracle. Dafür kann man folgendes kleines SQL-Skript benutzen:

DECLARE
txt VARCHAR2(4000);
BEGIN
SELECT dbms_metadata.get_ddl(’&&type’, UPPER(’&&old’))
INTO txt FROM dual;
 
txt := REPLACE(txt, ‘&&old’, ‘&&new’);
txt := REPLACE(txt, UPPER(’&&old’), ‘&&new’);
 
[...]

Von admin, 6. September 2007, 16:13 Uhr