× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Goodmorning,

I've struggled with an arrays of arrays for a while now, but I couldn't
find out why it doesn't work.
Without the use of the "iniziative" variabile the service program compiles
and runs as expected.
When I try to use "iniziative" variable in dsAgente, which is based on
"dsIniziativa" the compile process always returns
"SQL0312 Variable DSAGENTE not defined or not usable in position 24 ."

That's the code:
dcl-proc getListaAgenti export;
//--------------------------------------
dcl-pi *N;
i_codice char(3) const;
errore ind;
messaggio varchar(250);
contaAgenti int(5);
agenti likeds(dsAgente) dim(999);
end-pi;
//--------------------------------------
dcl-ds dsAgente qualified inz;
codice varchar(3);
nominativo varchar(35);
telefono varchar(20);
email varchar(50);
emailPEC varchar(50);
agenziaId varchar(4);
inizioMandato zoned(8: 0);
iniziativeAttive zoned(3: 0);
iniziative likeds(dsIniziativa) dim(999);
end-ds;
//--------------------------------------
dcl-ds dsIniziativa inz;
codice varchar(6);
comune varchar(35);
provincia char(2);
stato varchar(10);
campagna ind;
end-ds;
(some initializations here)
//--------------------------------------
exec sql
declare cur_age cursor for
select
trim(agn.ageagn)
, trim(age.agras)
, trim(age.agtel)
, trim(age.agmail)
, trim(agx.prpec)
, trim(agn.agegnz)
, agx.prdim
, 0
from AGELA01L agn //agenda
left join AGEAG00F age on agn.ageagn =
age.agage //anagrafica agente
left join AGEPR01L agx on agn.ageagn =
agx.prage //estensione agente
where 1 = 1
and agn.ageagn =
case
when :wFiltroCodice = 'all' then agn.ageagn
else :wFiltroCodice
end
order by agn.ageagn
;
exec sql open cur_age;
dow 1 = 1;
reset dsAgente;
exec sql fetch cur_age into :dsAgente;
(rest of the code)

The error instruction is the "fecth into", the last blue one.

I tried using precompiler options *LVL1 and *LVL2 without success.
I really don't know where the problem is, also because the message is too
generic, and I can't update the system right now to install the latest
cumulative which allow a detailed message to be printed.

Thank you for any help.
(and I hope you are all fine)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.