Reading a row into a Row variable (SPL)
Posted in 1998
Topics: Stored Procedures & SPL, Platform-Specific Issues, Jobs, Consulting & Announcements
Hello,
I am trying to read an entire row into a Row variable within a
function. Here is a simplified version of the function:
create function scan()
returning integer;
DEFINE r Table_t; -- Table_t is the row type of "Table"
DEFINE Aid INTEGER;
FOREACH cursorA FOR
SELECT * INTO r FROM Table
LET Aid = r.mps_urid;
return Aid with resume;
end foreach
end function;
The problem is that when I run the function, the server complains as
follows:
720: Number of columns in FOREACH SELECT does not match number of
variables.
The problem seems to be that '*' is (correctly) interpreted as all the
attributes of Table and the system seems to be expected as many
variables as attributes in Table after INTO.
Is there a way to select all attributes into a row variable?
I am running the Universal Server, 9.12.UC1 on Solaris 2.5.1.
Thanks,
Mauricio
--
Mauricio A. Hernandez
http://www.cs.columbia.edu/~mauricio