Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Result from select to variable - forum topic by ctpm

$
0
0

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: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>