USE tpch1; create or replace view v_temp as select * from part where p_partkey<10; drop procedure if exists sp_simple_select; Create Procedure sp_simple_select( ) begin select * from v_temp where p_partkey < 5; end $$ drop procedure if exists sp_simple_variable; Create Procedure sp_simple_variable(in arg_key int) begin select * from v_temp where p_partkey <= arg_key; end $$ call sp_simple_select; p_partkey p_name p_mfgr p_brand p_type p_size p_container p_retailprice p_comment 1 goldenrod lavender spring chocolate lace Manufacturer#1 Brand#13 PROMO BURNISHED COPPER 7 JUMBO PKG 901.00 ly. slyly ironi 2 blush thistle blue yellow saddle Manufacturer#1 Brand#13 LARGE BRUSHED BRASS 1 LG CASE 902.00 lar accounts amo 3 spring green yellow purple cornsilk Manufacturer#4 Brand#42 STANDARD POLISHED BRASS 21 WRAP CASE 903.00 egular deposits hag 4 cornflower chocolate smoke green pink Manufacturer#3 Brand#34 SMALL PLATED BRASS 14 MED DRUM 904.00 p furiously r call sp_simple_variable(2); p_partkey p_name p_mfgr p_brand p_type p_size p_container p_retailprice p_comment 1 goldenrod lavender spring chocolate lace Manufacturer#1 Brand#13 PROMO BURNISHED COPPER 7 JUMBO PKG 901.00 ly. slyly ironi 2 blush thistle blue yellow saddle Manufacturer#1 Brand#13 LARGE BRUSHED BRASS 1 LG CASE 902.00 lar accounts amo drop procedure sp_simple_select; drop procedure sp_simple_variable; drop view v_temp;