select 1 as tip,(case when tip_persoana = 1 then prefix||' '||denumire||' '||sufix else denumire end) as denumire,cod_fiscal,adresa,telefon,'' as telefon2,'' as telefon3,'' as fax,reg_comert,banca,cont_banca,sysdate as dataora,tip_persoana,0 as capital_soc_var,0 as capital_soc_sub from jcsserver.vnom_parteneri where id_part = ?poDate.id_client union all select 2 as tip,denumire,cod_fiscal,'' as adresa,'' as telefon,'' as telefon2,'' as telefon3,'' as fax,reg_comert,'' as banca,'' as cont_banca,null as dataora,tip_persoana,0 as capital_soc_var,0 as capital_soc_sub from jcsserver.nom_parteneri where sters = 0 and inactiv = 0 and id_part in (select id_partener from jcsserver.utilizatori_rol_intern where sters = 0 and id_util = ?gnIdUtil)union all select 3 as tip,antet as denumire,cod_fiscal,adresa,telefon,telefon2,telefon3,fax,reg_comert,banca1 as banca,cont_banca1 as cont_banca,null as dataora,0 as tip_persoana,capital_soc_var,capital_soc_sub from syn_nom_firme where id_firma = ?gnIdFirma 