SELECT  CAST(CF.CPF AS VARCHAR(14)) AS CPFCNPJ,
    CAST(CF.RG AS VARCHAR(20)) AS RGIE, CAST(NULL AS VARCHAR(70)) AS NOMEFANTAZIA
 FROM CLIENTEFISICO CF
   WHERE CF.CODCLIENTE=:CODCLIENTE
UNION ALL
 SELECT CJ.CNPJ AS CPFCNPJ,  CAST(CJ.IE AS VARCHAR(20)) AS RGIE,
 CJ.RAZAO AS NOMEFANTAZIA
 FROM CLIENTEJURIDICO CJ
   WHERE CJ.CODCLIENTE=:CODCLIENTE

