MySQL Forums
Forum List  »  Stored Procedures

temporary table losing results
Posted by: Mike McPherson
Date: October 14, 2017 03:48AM

struggling with stored procedure
I'm
- creating a temporary table
- writing records to it
- trying to return the rows from the tabl

I get the correct number of rows returned
but all the data is NULLs

here's the code
begin
declare name varchar(50);
declare caption varchar(50);
declare groups varchar(50);
declare sortorder integer;
declare systemflag varchar(50);
declare hint varchar(50);
declare script varchar(50);
declare formtype varchar(50);

create temporary table results
(
name varchar(50),
caption varchar(50),
groups varchar(50),
sortorder integer,
hint varchar(50),
script varchar(50),
formtype varchar(50)
);
insert into results (name, caption, groups, sortorder, hint, script, formtype) values ('name', 'caption', 'groups', 1, 'hint', 'script', 'form');
insert into results (name, caption, groups, sortorder, hint, script, formtype) values ('name', 'caption', 'groups', 2, 'hint', 'script', 'form');
select name, caption, groups, sortorder, hint, script, formtype from results order by sortorder, name;

end

Options: ReplyQuote


Subject
Views
Written By
Posted
temporary table losing results
3097
October 14, 2017 03:48AM
504
October 14, 2017 03:55AM
503
October 14, 2017 02:50PM
487
October 16, 2017 01:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.