Subject Determining SQL statement source of the column
Author Marcin Bury
Hi

I have following statement

SELECT (CASE WHEN BE.CROSS_B = 1
THEN 'OBCY'
ELSE 'WŁASNY'
END) B
,(CASE WHEN (UPPER(BE.SCO) STARTING WITH 'GDY')
OR (UPPER(BE.SCO) STARTING WITH 'WAS')
OR (UPPER(BE.SCO) STARTING WITH 'PL')
THEN 'WŁASNY'
ELSE 'OBCY'
END) K
,P_L.PORT_NAME POL_NAME

,CT.C_SIZE
,COUNT(C.CONTAINER_ID) C_QTY
,SUM(CAST(CT.C_SIZE / 20 AS INTEGER)) C_TEU

FROM BOOKINGS_EXP BE
INNER JOIN CONTAINERS C ON BE.BOOKING_ID = C.E_BOOKING_ID AND
C.E_LDN_DATE BETWEEN :D1 AND :D31
LEFT JOIN DEPOTS D_L ON D_L.DEPOT_ID = BE.E_POL
LEFT JOIN PORTS P_L ON (P_L.PORT_ID = D_L.PORT_ID)
LEFT JOIN CONTAINER_TYPES CT ON CT.C_TYPE_ISO = C.C_TYPE_ISO


How I can determine that the source of IB_DataSet column with FieldName
B is used CASE expression: (CASE WHEN BE.CROSS_B = 1 THEN 'OBCY' ELSE
'WŁASNY' END)

Thanks
Marcin