Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision dc501412

Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt

  • ID dc501412d935a07046f3c6b179afacb129f06bbb
  • Vorgänger ee757592
  • Nachfolger 46d3e453

Artikel-Bericht: sql-Fehler: gleiche Typen in Union

record_type in oe ist ein enum von DB-Typ order_types. Wenn in den anderen
SELECTs, die mit UNION verbunden sind, die Type als Text-String gestezt werden,
dann muss auch record_type zu Text gecastet werden.

Unterschiede anzeigen:

SL/IC.pm
218 218
      q|LEFT JOIN (
219 219
         SELECT id, transdate, 'ir' AS module, ordnumber, quonumber,         invnumber, 'purchase_invoice' AS record_type, NULL AS customer_id,         vendor_id,    NULL AS deliverydate, globalproject_id, 'invoice'    AS ioi FROM ap UNION
220 220
         SELECT id, transdate, 'is' AS module, ordnumber, quonumber,         invnumber, 'sales_invoice'    AS record_type,         customer_id, NULL AS vendor_id,            deliverydate, globalproject_id, 'invoice'    AS ioi FROM ar UNION
221
         SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber,                       record_type,         customer_id,         vendor_id, reqdate AS deliverydate, globalproject_id, 'orderitems' AS ioi FROM oe
221
         SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber,                       record_type::text,   customer_id,         vendor_id, reqdate AS deliverydate, globalproject_id, 'orderitems' AS ioi FROM oe
222 222
       ) AS apoe ON ((ioi.trans_id = apoe.id) AND (ioi.ioi = apoe.ioi))|,
223 223
    cv         =>
224 224
      q|LEFT JOIN (

Auch abrufbar als: Unified diff