I'm creating a stored procedure
in teradata , where in I created a volatile table that I then call to do a data insertion. I do not know why the volatile table does not recognize me, can you help me?
Script:
replace PROCEDURE shipment.test ()
DYNAMIC RESULT SETS 1 SQL SECURITY OWNER
BEGIN
CREATE MULTISET VOLATILE TABLE bt_bids_tmp_1 as (
select cus_cust_id_sel,tim_day_winning_date,shp_shipment_id,cus_cust_id_buy,sit_site_id,ord_order_id,bid_quantity_ok
from whowner.bt_bids bd
where
bd.photo_id='TODATE'
and bd.tim_day_winning_date between '2018-07-01' and date-1
and bd.mkt_marketplace_id = 'TM'
and bd.ite_gmv_flag=1
and bd.sit_site_id in ('MLA')
)
with data primary index(cus_cust_id_sel,tim_day_winning_date,shp_shipment_id,cus_cust_id_buy) on commit preserve rows;
insert into shipment.table_test
select * from bt_bids_tmp_1 ;
END ;
Error capture:
Thank you very much to the one who answers me!