Hi all, i am there new, i try write function or procedure which out will be variable.I don't know how assign result from select() to the variable.Primary goal is compare structure of 2 tables. I Some kind of :
create function/procedure check_tables(IN XXX1 varchar(150), XXX2 varcahr(150) ,OUT R int)
LANGUAGE SQL
CONTAINS SQL
BEGIN
declare R int;
select count(*) from
(select count(*)as S
FROM DBC.COLUMNS
where upper(TRIM(TABLENAME)) = 'XXX1'
minus all
select count(*)
FROM DBC.COLUMNS as N
where upper(TRIM(TABLENAME)) = 'XXX2'
)
as src) set into @v;
END;
Thanks for some ideas, and sorry for english :)
Forums: