Subject RE: [IBO] Determining SQL statement source of the column
Author IBO Support List
Marcin,

I'm not sure what you are asking. Are you wanting IBO to deliver to you the
parsed portion of the SELECT statement that this column is derived from?

There is a property in IBO that does this but you have to dig a little
deeply.

This is a line of code showing how it is accessed.
tSQL is a TIB_SQLStrings instance.

tmpFld := Trim( stLitCriteria( tSQL.ParsedSQLInfo.FieldsList[jj] ));

Please investigate this and let me know if you need any further assistance.

Jason

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Monday, September 19, 2016 10:55 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Determining SQL statement source of the column

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



------------------------------------
Posted by: "Marcin Bury" <marcin.bury@...>
------------------------------------

___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
http://tracker.ibobjects.com - your portal to submit and monitor bug reports
http://community.ibobjects.com - your portal to purchase and upgrade
------------------------------------

Yahoo Groups Links