Affiliate

22. Februar 2012

Create a flat file with multiple characters for enclosures fails on OWB 11g2

Die Aufgabe klingt einfach und sollte den OWB 11g2 vor kein Problem stellen. Sollte man meinen, aber der Reihe nach.
Laut der Dokumentation zum OWB 11g2 ist das zulässig:
Enclosures (Left and Right): Some delimited files contain enclosures that denote text strings within a field. If the file contains enclosures, enter an enclosure character in the text box or select one from the list. The list displays common enclosures. However, you may enter any character. The default for both the left and right enclosure is the double quotation mark ("). You can specify multiple characters and hexadecimal characters as field enclosures.
Im Projekte sollte der Inhalt einer Tabelle vom OWB als CSV-Datei geschrieben werden. Dabei sind folgende Definitionen einzuhalten:
Delimiter: ;
Left enclosure: {#{
Right enclosure: }#}

Das läßt sich auch alles im Flat File Dialog eintragen:

Im Mapping, das die Datei schreiben soll, sieht auch alles Bestens aus:

Alles kann wunderbar compiliert und deployt werden. Das Mapping läßt sich starten und läuft dann ohne Fehlermeldung scheinbar sauber durch.
Schauen wir dann aber in die erstellte Datei, dann ist die Verwirrung groß.
Der Inhalt sieht dort dann so aus:

{col1#;{col2#;{col3#;.....

Offenbar verwendet der OWB als Left Enclosure nur das Zeichen { und als Right Enclosure das Zeichen #.
Diese Verhalten ist reproduzierbar. Eine kurze Suche in den gängigen Oracle Foren und per Google brachte mir keine Ergebnisse, dieses Problem scheint noch nirgendwo einer gehabt zu haben.

Also ran an den Oracle Support, der auf meinen SR dann 21 Tage (sic) mit mehreren Rückfragen benötigte, um sich auch von diesem Verhalten zu überzeugen und dann eine Bug dafür zu erstellen.

Bug 13768220 - OWB 11.2 MULTIPLE CHARACTERS FOR ENCLOSURES DOES NOT WORK WHEN WRITING TO FILE
As a possible temporary workaround you can edit the deployed package to change to code that would look like :
BEGIN
UTL_FILE.PUT("MY_EMAIL_BOOK_Fh",
'[' ||
"MY_EMAIL_BOOK_0_EM_NAME"(i) ||
'[' ||
',' ||
'[' ||
"MY_EMAIL_BOOK_1_EM_MAIL"(i) ||
'['
with something like :
FOR i IN "MY_EMAIL_BOOK_si".."MY_EMAIL_BOOK_i" - 1 LOOPBEGIN
UTL_FILE.PUT("MY_EMAIL_BOOK_Fh",'[[' ||"MY_EMAIL_BOOK_0_EM_NAME"(i) ||']]' ||',' ||'[[' ||"MY_EMAIL_BOOK_1_EM_MAIL"(i) ||']]'

note : when testing the workaround I could find 2 occurrences of that code.
The bug will go through screening process before being assigned to development.
with something like :
FOR i IN "MY_EMAIL_BOOK_si".."MY_EMAIL_BOOK_i" - 1 LOOP
BEGIN
UTL_FILE.PUT("MY_EMAIL_BOOK_Fh",
'[[' ||
"MY_EMAIL_BOOK_0_EM_NAME"(i) ||
']]' ||
',' ||
'[[' ||
"MY_EMAIL_BOOK_1_EM_MAIL"(i) ||
']]'
note : when testing the workaround I could find 2 occurrences of that code.
The bug will go through screening process before being assigned to development.
Erstaunt war ich dann über die Aussage:
Please also note that only one set of left and right characters can be used. 
Das steht so nicht in der Dokumentation und die Oracle Datenbank ist sehr wohl in der Lage zwischen Left und Right Enclosure zu unterscheiden. Wieso sollte der OWB das dann nicht können? Die Antwort darauf steht (noch) aus.


Fortsetzung folgt...


Update: 
Im Test hat es mit der Änderung im deployten package des Mappings funktioniert. Ich musste an vier Stellen die Symbole für den Left und Right enclosure ändern und dann erfolgte die gewünschte die Ausgabe in der Datei.
Umständlich, aber fürs erste machbar.


Update II:
Nun ist es offiziell:
The bug successfully passed the Screening/diagnosis process and have been assigned to development. The bug should be available for monitoring in MyOracle.
Bug 13768220: OWB 11.2 MULTIPLE CHARACTERS FOR ENCLOSURES DOES NOT WORK WHEN WRITING TO FILE


Keine Kommentare:

Anzeige