(IDS 9.13):Problem with lists
Posted in 1998
Hi everybody,
I send this message for the second time because I still have the same
problem and I really need help.
Problem:
I tried to insert an element at the end of the list defined below .
The position is specified through variable 'var_n' wich is set in the
first select -statement.
The Error Msg occurs at the insert - statment: 'insert at var_n into
table(var_NrListe) values( var_Nummer);' It says that I have to specify
the position through a variable or a constant.
So what is wrong with my variable 'var_n'?
Any ideas ?
Thanks Ilona
_______________________________________________________________________________________________________
create procedure KatListe_bearb(aufgabe varchar(10), var_Id integer,
var_Kat_Id integer, var_Nr integer, var_Zusatz varchar(5))
returning int, varchar(10);
define var_NrListe list(rt_Nr not null);
define var_Nummer rt_Nr;
define var_n smallint;
let var_Nummer=ROW(0, "")::rt_Nr;
if aufgabe="neu" then
let var_Nummer.Nr=var_Nr;
let var_Nummer.Zusatz=var_Zusatz;
select CARDINALITY(NrListe) into var_n
from Katalog
where Kat_Id=var_Kat_Id and Id=var_Id;
let var_n = var_n + 1;
select NrListe into var_NrListe
from Katalog
where Kat_Id=var_Kat_Id and Id=var_Id;
insert at var_n into table(var_NrListe)
values( var_Nummer);
update Katalog set NrListe=var_NrListe
where Kat_Id=var_Kat_Id and Id=var_Id; return 1, "neu";
end if;
end procedure;