How to retrieve the field structure in a dataset ?

How to retrieve the field structure in a dataset ?

I searched Google and couldn't find anything about it. I use "Unidac" and I'd like to know if anyone has created a function to return the SQL field structure.

Example SQL

SELECT
Case When (CC.FOTO is Not Null) Then 'Sim' Else Null End as FOTO
FROM CADASTRO_PESSOAS CC

How could I retrieve the SQL ?

Case When (CC.FOTO is Not Null) Then 'Sim' Else Null End

Through the field "FOTO"