Query results: which kind of datatype?

Hi to all,
I have a query which returns more more more records. I must insert this records in a string that i have to return from a function ( i have to invoke this procedure from an application visual basic 6).
What kind of datatype i have to use? Long datatype is small for me (and for my demand i cannot use clob).
Maybe i could return from a function (for example) a string that is concatenation of more than 2 long datatype! But could i do this? And, if yes, how could i declare my procedure (or function)?
Thanks
Edited by: user635881 on 8-ott-2008 11.09
Edited by: user635881 on 8-ott-2008 11.20

This is my code:
declare
risultati LONG;*
i number;
TYPE t_cur IS REF CURSOR;
TYPE type_rec IS RECORD (...more code...more code...);
cur  t_cur;
bilancio_def_entry   type_rec;
BEGIN
OPEN cur FOR
SELECT q.codicepool, q.codicefisico, q.denominazione,
q.tipoedificio, q.tipoimpianto, q.stationtypecaminus, q.codiceateco,
+...more code ...more code...+
--end of select;+     
risultati:='';
LOOP
FETCH cur INTO bilancio_def_entry;
EXIT WHEN cur%NOTFOUND;
if bilancio_def_entry.codicepool is null then
bilancio_def_entry.codicepool := bilancio_def_entry.codicefisico;
end if;
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita1)) || ';' || trim(to_char( bilancio_def_entry.energia1)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato1)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita2)) || ';' || trim(to_char( bilancio_def_entry.energia2)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato2)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita3)) || ';' || trim(to_char( bilancio_def_entry.energia3)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato3)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita4)) || ';' || trim(to_char( bilancio_def_entry.energia4)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato4)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita5)) || ';' || trim(to_char( bilancio_def_entry.energia5)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato5)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita6)) || ';' || trim(to_char( bilancio_def_entry.energia6)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato6)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita7)) || ';' || trim(to_char( bilancio_def_entry.energia7)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato7)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita8)) || ';' || trim(to_char( bilancio_def_entry.energia8)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato8)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita9)) || ';' || trim(to_char( bilancio_def_entry.energia9)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato9)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita10)) || ';' || trim(to_char( bilancio_def_entry.energia10)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato10)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita11)) || ';' || trim(to_char( bilancio_def_entry.energia11)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato11)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita12)) || ';' || trim(to_char( bilancio_def_entry.energia12)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato12)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita13)) || ';' || trim(to_char( bilancio_def_entry.energia13)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato13)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita14)) || ';' || trim(to_char( bilancio_def_entry.energia14)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato14)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita15)) || ';' || trim(to_char( bilancio_def_entry.energia15)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato15)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita16)) || ';' || trim(to_char( bilancio_def_entry.energia16)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato16)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita17)) || ';' || trim(to_char( bilancio_def_entry.energia17)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato17)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita18)) || ';' || trim(to_char( bilancio_def_entry.energia18)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato18)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita19)) || ';' || trim(to_char( bilancio_def_entry.energia19)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato19)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita20)) || ';' || trim(to_char( bilancio_def_entry.energia20)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato20)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita21)) || ';' || trim(to_char( bilancio_def_entry.energia21)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato21)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita22)) || ';' || trim(to_char( bilancio_def_entry.energia22)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato22)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita23)) || ';' || trim(to_char( bilancio_def_entry.energia23)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato23)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita24)) || ';' || trim(to_char( bilancio_def_entry.energia24)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato24)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita25)) || ';' || trim(to_char( bilancio_def_entry.energia25)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato25)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita26)) || ';' || trim(to_char( bilancio_def_entry.energia26)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato26)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita27)) || ';' || trim(to_char( bilancio_def_entry.energia27)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato27)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita28)) || ';' || trim(to_char( bilancio_def_entry.energia28)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato28)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita29)) || ';' || trim(to_char( bilancio_def_entry.energia29)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato29)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita30)) || ';' || trim(to_char( bilancio_def_entry.energia30)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato30)) || chr(10);*
risultati:= risultati || trim(bilancio_def_entry.codicepool) || ';' || trim(bilancio_def_entry.codicefisico) || ';' ||  trim(bilancio_def_entry.denominazione) || ';' ||  trim(bilancio_def_entry.tipoedificio) || ';' || trim(bilancio_def_entry.tipoimpianto) || ';' ||*
trim(bilancio_def_entry.stationtypecaminus) || ';' || trim(bilancio_def_entry.codiceateco) || ';' || trim(to_char(bilancio_def_entry.capacitatrasporto)) || ';' ||*
trim(to_char(bilancio_def_entry.capacitaconferita31)) || ';' || trim(to_char( bilancio_def_entry.energia31)) || ';' ||   trim(to_char(bilancio_def_entry.volumeprofilato31)) || chr(10);*
END LOOP;
INSERT INTO APPOGGIO VALUES (risultati);
commit;
CLOSE cur;
END;
Pl sql variable is risultati (it is a long type).
In the previous code i insert it in a table (but only to see what is results of concatenation ...it's not my purpose). When i insert this code in a procedure i want return from the procedure pl sql the variable risultati+. If risultati is longer than 32k i obtain an error. How could i do to obtain at the end a variable (or a concatenation of variables) long (for example) 2.000.000 of characters? This variable is the return variable of a procedure pl sql.
Thanks a lot.

Similar Messages

  • Desktop apps: Report Builder 3.0 (x86) that does not let me allow query result which I created Customers Report. Here is the error message returns.:

    Desktop apps: Report Builder 3.0 (x86) that does not let me allow query result which I created Customers Report. Here is the error message returns as following.
    Database query from: AdventureWorks2014
    System.Web.Services.Protocols.SoapException: The permissions granted to user 'SQLServer2014\Mubs' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to
    user 'mujb-HP\mujb' are insufficient for performing this operation.
       at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)
       at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)
    The permissions granted to user 'mujb-HP\mujb' are insufficient for performing this operation.
    Is there anybody help me out, pl
    My MSSQL Server express 2014 edition x64  and My desktop "Report Builder (RB) 3.0' is 32bit (x86).
    Does Report Builder x64 exist? I didn't see anywhere so I downloaded x86 RB

    Hi mujb,
    Per my understanding you are using the report builder 3.0 to design the report and when you click the query designer button to execute the query you got the error message above, right?
    I have tested on my local envornment and your issue can be caused by the user "SQLServer2014\Mubs"  and "mujb-HP\mujb"  haven't grant permission to the report server or the shared dataeource/dataset if you have used this.
    I would like to confirm if you have assigned both the Item-Level and System-Level role of the user above to sucessfully access the report server, If you haven't grant any access to the above user and when you connect to the report server in the report builder,
    you may got the error message:
    More details information below for your reference:
    Please execute the query in the microsoft SQL Server Management Studio to see if you have permission to execute the query.
    If the query works fine in step1, please run the report builder as Administrator and if you are using the shared datasource/dataset the issue can be cause by the you haven't grant access the share datasource, Double click to open the Datasource
    and click the "Test Connection" as below to test if it can connect successfully:
    If the "Test Connection" failed, please click the shared datasource/dataset on Report Server to check if you have grant correct permission.
    Related information about the grant permission to report server for your reference:
    https://msdn.microsoft.com/en-us/library/ms156034.aspx
    http://www.allenkinsel.com/archive/2013/01/adventures-in-ssrs/
    If your issue still exists, please try to provide more details information.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • What does "*" mean in my query result?

    Hello all,
    I met a problem in my query result which was some of cells in one KF column didn't display the amount but instead with * . Could anybody tell me what the wrong was?
    thanks
    Ryan

    Hi Ryan,
    This normally happens when the key figures refers to a unit / currency and the units and currencies are different for different records in the result set of the query.
    BEx couldn't sum amounts with different currency or value with different unit. hence you get a '*'. However if you put your cursor on the cell then you can actually see total amount in the cell value at the top header of the excel.
    Hope it helps.
    Thanks
    Soumya

  • Which kind of ABAP-Data can be transferred over JCo?

    Hello,
    I'm new in ABAP-Programming. I have to build communication between an ABAP-Process an a Java-Applikation. There have to be sent a sing-deep-structure (ABAP-Structure, which contanins tables, lists, variables...). Is It possible to sent a single-deep-structure over the JCo? Which kind of Datatypes are also supported?
    Regards
    Bahtiyar
    Edited by: Bahtiyar Yanik on Oct 14, 2008 3:43 PM

    Hi Rebeca,
    This forum is for SAP Business One users only. It is not related to the topic you posted.
    Please close your thread and post it on a proper forum.
    Thanks,
    Gordon

  • How to set the link to the result which are executed my query from database

    Hi,
    i have successfully displayed the results which are available in the database by jdbc, query.
    Then, How to give the link like href to each & every result...
    note: The number of records may be change. depending upon the records availablity in the database. but every result have the link.
    Thanks in advance.
    Regards
    Kumar

    hai kumar..
    i post an example code ..
    <%
    ResultSet rs1=stmt.executeQuery("select fromu,subject,message,mdate,status,mesid from message where to='" + lname +"'" );
    while(rs1.next())
         l=rs1.getLong(6);
         out.println("<tr align='center'> <td> <a href='deletemessage.jsp?mesid="+ l + "'>Delete </a></td><td>" + rs1.getString(1) +"</td><td> <a href='viewmessage.jsp?mesid="+ l +"'>"+ rs1.getString(2) +"</a></td><td>"+ rs1.getString(4) +"</td><td>"+ rs1.getString(5) +"</td></tr>");
    %>

  • Need SQL Query which saves query results to an excel file

    Hi,
    I am looking for a sql query which saves/ export results of an query to a excel file
    Thanks,
    Chetan

    I am looking for a sql query which saves/ export results of an query to a excel file
    Thanks,
    Chetan
    Options:
    1) You can use
    BCP command to export result to excel
    2) Insert into excel by using OPENROWSET
    3) Use Import and Export Wizard and provide SQL query as source and Excel as destination
    Please refer:
    http://stackoverflow.com/questions/87735/how-do-you-transfer-or-export-sql-server-2005-data-to-excel
    http://www.codeproject.com/Questions/617527/Export-sql-query-result-in-excel-file
    Cheers,
    Vaibhav Chaudhari
    [MCTS],
    [MCP]

  • ADF - How to create table which column header come from query result

    I would like to create table that show the summary of task for each month, the query result such as
    Status MonthofYear Total Task
    03 2007/06 9
    03 2007/05 12
    03 2007/04 10
    03 2007/03 7
    05 2007/06 6
    05 2007/05 3
    06 2007/06 1
    09 2007/06 1
    And the table that I would like to show in jdeveloper is
    Status 2007/06 | 2007/05 | 2007/04 | 2007/03 | ......... | 2006/05
    03 9 | 12 | 10 | 0 | .......
    05 6 | 3 | 0 | 0 | .......
    06 1 | 0 | 0 | 0 | .......
    09 1 | 0 | 0 | 0 | .......

    Lucas worked out a solution for this:
    http://technology.amis.nl/blog/?p=2070

  • How to upload the web query result  to CSV/Text file

    Hi,
    Kindly help me on the following.
    1)       I have info-provider (IP), which has info-objects "company code" and "supplier".
    2)       I built a query by putting company-code with a variable in free-charateristics and supplier-code in row.
    3)       When I run this query, it will ask company-code as input and the result will be filtered using company-code.
    4)       For this query, I created a web-template and assigned data-provider to display the data on the web.
    5)       The user wants to enter input company-code='1000' and write the data in a CSV file in a specific directory. i.e, by clicking the execute button (after entering company code) , the result should go to the CSV or text file. i.e. the application should automatically generate the file with query results.
    Note: The user should not use context menu to EXPORT TO CSV OR EXCEL file.
    Please let me know, if there is any tutorial. Thanks a lot advance help.
    Regards
    Kandasamy

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • Query result to ASCII file output

    Seems like there SHOULD be some rediculously simple solution
    to this - but I sure haven't found it yet! I have a query which
    produces the a varying number of columns (based on a multi-select
    cfselect) which I need to output to a comma delimited ASCII (.TXT
    or .DAT or .CSV file). I have all the steps worked out when the
    number of columns and their names are known, but I need to make
    this variable. First choice would be to be able to just "DUMP" the
    query result into a text file. CFDUMP can send results to a text
    file, but NOT in comma delimited format, and with all kinds of info
    besides just the basic data. (NOT good!) Second choice, since the
    "append to text file" uses an output property that expects a comma
    delimited string variable would be to use CFLOOP to loop thru the
    rows in the query and put them (a row at a time) into a variable,
    then use that variable for the file append. Problem is I can't find
    a way to just say "send *ALL* to the string variable. Every example
    I have been able to find includes specifying the column NAMES when
    doing anything with a row in the query result!!! Short of a brute
    force series of if/then statements that specify EACH POSSIBILITY
    (in this case 60 - 75 of them, and the number WILL GROW!) I haven't
    been able to find a solution. There's GOTTA BE A WAY!!!!! :)

    auntiealias
    > I tried that, but as far as I could figure you still
    have to have a specific column name
    Look at the udf more closely. If you read the documentation
    it states all of the parameters are optional, except the query. So
    if you do not supply column names, the function will use the
    columnList variable to determine the names of the columns in the
    query. If you look at the actual code, notice it uses array
    notation to extract the values (not evaluate) .
    ... (code to create query) ...
    <!--- pass in the query object only ---->
    <cfset test = QueryToCSV2( data )>
    http://cflib.org/index.cfm?event=page.udfbyid&udfid=1197
    > I have a cfselect with multiple set to "yes" and the
    selections are "which columns of
    > data do you want to see?"
    Hopefully you are not using the raw form value directly in
    your sql, because that is a sql injection attack just waiting to
    happen.

  • Query resulting Incorrect values

    Hello ALL.
    I need your suggestions on this issue.
    I have a Query on top of multiprovider which is on top of 6 cubes. In the query one RKF is resulting wrong values for Unassigned WBS Element Hierarchy.
    <u><b>RF: Forecast amount</b></u>
    0amount, Version:01, Vtype:20,Company Code:100,Fiscyear=2008 and Posting Period=1-12.
    Query resulting: 68,000 and Where as Multi prvider has only 2 rows satisfying the above Restrictions and giving 13,000.
    These wrong values are only for Unassgined Nodes of WBS Element.(Rows) Other node values are correct.
    I am not sure where it is getting these values?
    Kindly suggest.
    Thanks,
    Geetha
    <u></u>

    Can you chk if you have the values in the multiprovider?

  • Optimize query results(timing) returned from custom search query

    Casey can you send the following to Oracle Support as soon as you can, we need their input on optimizing returning search results.
    To Oracle:
    We have noticed in the IdocScript reference guide that there is a way to optimize the query results returning to the user.
    Here is the scenario: We have created a custom web query where we send a query to the UCM and return a result using a custom template via url like so
    http://dnrucm.dnr.state.la.us/ucm/idcplg?IdcService=GET_SEARCH_RESULTS&QueryText=dDocTitle <matches> `AGREEMENT` <AND> xStateLeaseNum<matches>`00340`&ResultCount=30&SortOrder=Desc&SortField=dInDate&urlTemplate=/ucm/groups/public/documents/oos/hcst-search.hcst
    This works fine. The problem is that when a query is broader like
    http://dnrucm.dnr.state.la.us/ucm/idcplg?IdcService=GET_SEARCH_RESULTS&QueryText= xStateLeaseNum<matches>`00340`&ResultCount=30&SortOrder=Desc&SortField=dInDate&urlTemplate=/ucm/groups/public/documents/oos/hcst-search.hcst
    The query takes an extremely long time to execute and the results template sometimes never comes back, which seems like a timeout.
    Is there something else that we can do to optimize the query results?

    Hi John,
    What version of xMII are you using?
    Some things I would try:
    1. Clear the Java Web Start Cache - see if that makes any difference.
    2. If not, what happens if you save the query under a different name, and then try using it in a new transaction?
    3. Please feel free to enter you case into xMII Support via the SAP Support Portal if you are unable to make this work.
    Kind Regards,
    Diana Hoppe

  • Exporting Query Result to OpenOffice

    Hello,
    We would like to export Query Result from Web Application to a file which could be opened in OpenOffice.
    Exporting data in XLS format doesn't work because XLS file is created with MS VML Markup with couln't be read by OpenOffice.
    Does someone already deals with this kind of issue ?
    How do you overcome this problem ?
    Thanks in advance for your answer
    Laurent

    Hi Laurent,
    Can you try saving the file in .csv.
    ad try opening it in openoffice.
    Hope this helps
    PV

  • Need QUERY result in Graph

    Dear Experts,
    I am having the following requirement.
              Can it be possible to present the QUERY result in Graph ?
    I read many thread in SDN, I found through APD/WAD we can do it . But I am confused.
    But I am not getting any thread , How to proceed step by step ?
    Kindly help..
    Thanks,
    Sethi

    Hi,
    If you are using Bex Query make as work book ,in that you can add charts and save as work book not as a query.
    To insert the chart
    Go to insert tab in the Excel(Work book) choose which chart  you want in that.
    After that go the chart which you have selected, right click and go to select data option, choose series for Entries and choose labels for category.
    Hope it helps.
    Thanks & Regards,
    Ramnaresh.P.

  • Need help on retrieving query result - NPE

    Hi, I could get results with the native query in my TOAD, but I can't get it working in my session EJB. I tried both native query and EJB ql. The query created fine, as soon as I try to retrieve results, it gets stuck.
    My native query looks like this:
    Query query = em.createNativeQuery("select sum(o.amount_reimbursed) from t_expenses o where o.employee_id = '999999911' " +
    "and o.EXPENSE_ID in (select p.expense_id from T_Per_Diem_Xref p where p.expense_Type_Xref_Id=22 " +
    "and p.expense_Id in (select e.expense_Id from T_Expenses e where e.employee_Id='999999911' " +
    "and e.expense_date > to_date('01/01/2011', 'mm/dd/yyyy') and e.expense_date < to_date('12/31/2011', 'mm/dd/yyyy')))") ;
    My EJB query looks like this:
    Query query = em.createQuery("select sum(o.amountReimbursed) from TExpenses o where o.employeeId = ?1 " +
    "and o.expenseId in (select p.expenseId from TPerDiemXref p where p.expenseTypeXrefId=?2 " +
    "and p.expenseId in (select e.expenseId from TExpenses e where e.employeeId=?1 and e.expenseDate>=?3 and e.expenseDate<=?4))");
    query.setParameter(1, employeeId);
    query.setParameter(2, expenseType);
    query.setParameter(3, fDay, TemporalType.TIMESTAMP);
    query.setParameter(4, lDay, TemporalType.TIMESTAMP);
    Either one, I get NPE at the line retrieve result.
    // sumAmt = (Double)query.getSingleResult();
    List list = query.getResultList();
    if (list != null) {
    long longAmt = (Long)list.get(0);
    sumAmt = (Double)list.get(0);
    As you can see, I tried to getSingleResult, or getResultList. also tried to convert the result to Double or Long. None worked.
    Please help and thank you for your time.
    Sophia

    Frank, thank you for your reply. I have this code in my session Facade EJB, and I get the NPE in my backing bean which calls this method. When I debug the code, it appears what really cuases the problem is in this code on the line I try to assign the query result to my variable 'sumAmt = (Double)query.getSingleResult();'. In the debug, when it reaches this line, it starts to give me all kinds of pop-up windows saying couldn't find this file or that file or packages. If I get a stack trace later, I will post it. Right now I am trying to fix something else.
    Thanks, Sophia

  • Saving query results as excel

    hi,
    Is there a way to save the query results as excel programatically (some kind of utility which does the job)? we are using oracle 10g. This will be a nightly job.. so that every other day morning we have the huge excel report ready for viewing. Any help is appreciated..

    Did you think to try searching the forum? I typed in the EXACT string you used for your thread title and the first hit was ...
    Saving sql query result as excel file

Maybe you are looking for

  • Script for the SAP report - download to excel - problem

    Hi all I know that similar problem had already been discussed but going through the solution presented in any of that topic I was not able to be successful  (I am beginner in terms of VBA and SAP scripting) What I would like to do is simply create th

  • PDF files don't open in iPad

    Why I cannot open PDF files in net pages by iPad ?

  • Impossible to download Adobe Reader

    As I could not read any more my pdf docs, I tried to re-install Adove Reader. Go a message saying that it was impossible to install this application in my exploitation system... What can I do ? Thanks for helping.

  • Update termination with BAPI_FIXEDASSET_CHANGE

    Hello, We want to capture the serial number of an asset at the point of goods receipt. There does not appear to be any standard functionality to do this so I am making use of a BAdI in transaction MIGO. But I am encountering a problem with BAPI_FIXED

  • How to attach the files in SDN

    HI how to attach the files in SDN HOW ATTACH THE SEREEN SHORTS IN snd