Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global temporary table

Status
Not open for further replies.

oana12

Programmer
Jan 6, 2005
21
CA
Hi,

I create a procedure in which I have a global temprary table and a cursor to select information from this table but I received error that I can't declare the cursor. Why?
My proc is like this
create procedure test()
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE GLOBAL TEMPORARY TABLE SESSION.tmpaccref
(num integer,EmpName varchar(30))
WITH REPLACE
ON COMMIT PRESERVE ROWS
NOT LOGGED;
DECLARE temp_cursor CURSOR WITH HOLD WITH RETURN TO CLIENT FOR
select * from SESSION.tmpaccref;
INSERT INTO session.tmpaccref(
SELECT a,b
FROM x_table);

updatex_table set a='222' when a is null;
open temp_curosr;
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top