on 2010 Oct 29 10:38 AM
Having written stored procedures for V8 (and below) for years, it's somewhat embarrassing that I'm stuck on this question:
Whereas V9 and above have the handy "SELECT FROM myProcedure()" syntax, V8 has not.
So, within a different stored procedure, when I have a stored procedure myProcedure that returns a result set and I want to insert the result set into a table (here a local temporary one), do I have to use a cursor loop in V8?
I.e. if MyProcedure returns a result set with column MyPk, is a cursor loop like the following the single approach:
begin
declare local temporary table LT (pk int not null primary key);
for forCrs as crs
cursor for call Myprocedure()
-- for read only -- correction: Not allowed (and not necessary) with call
do
insert LT values(MyPk);
end loop;
-- do something with LT's contents
end;
Sidenote: T-SQL has the INSERT ... EXEC syntax for that but that doesn't seem to work with V8, and it would be infeasible here as I'm dealiung with a Watcom-SQL procedure (of course!).
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.