Hi experts,
I have a requirement, need to compare data between two tables where each table contain single record and based on validation need to throw an error. I written a stored procedure and when ran it, omg it is showing errors from line 1. I am new to Vertica. Below is the skeleton of my proc. Could you please advice on where I am going wrong?
create or replace procedure proc_name() language PLvSQL AS $$
DECLARE
t1_var1 int;
t1_var2 int;
t2_var1 int;
t2_var2 int;
begin
select col1 into t1_var1,col2 into t1_var2 from tab1;
select col1 into t2_var1,col2 into t2_var2 from tab2;
if
t1_var1!=t2_var1 or
t1_var2!=t2_var2
raise exception 'count not matched'
end if;
end
$$;
appreciate your help.
Thanks,
Sri
