title: Why I always get null for the output in mySQL?
body: <p>In this code, it always output NULL (without any data, despite they have the data). I'm trying to get id_cust,lastName,addRess from 2 table (customer and order_status). Can anyone help me? Im new in SQL.</p>
  
  <pre><code>delimiter //
  #drop procedure if exists  GetOrderStatus 
  create procedure GetOrderStatus(IN id_cust INT, 
                                  OUT lastName VARCHAR(45),
                                  OUT o_number INT,
                                  OUT addRess VARCHAR(45))
  begin
  declare id_cust INT;
  declare lastName VARCHAR(45);
  declare addRess VARCHAR(45);
  declare ci_ty VARCHAR(45);
  declare dscrption VARCHAR(45);
  declare o_number INT;
  declare order_stts VARCHAR(45);
  declare total_item INT;
  declare reMarks VARCHAR(45);
  
  declare curs cursor for 
  select c.c_id,o.order_no,o.o_status,o.item_total,c.description,o.remarks,c.lname
  from order_status o, customer c; 
  open curs;
  fetch curs into id_cust,o_number,order_stts,total_item,dscrption,reMarks,lastName;
  
  select id_cust,lastName,addRess from customer
  where id_cust &gt; 2
  and customer.id_cust = order_status.id_cust;
  end
  </code></pre>