title: How to execute stored procedure in TeraData
body: <p>I have created a stored procedure in <code>Teradata - SQL Assistant</code> </p>
  
  <p>But, I'm not able to execute it. It has 5 parameters and I only need to pass 3 parameters as an input.</p>
  
  <pre><code>REPLACE PROCEDURE proc_store_import
  (
  IN P1_PROC_TYPE VARCHAR(20),
  IN P2_zone_name VARCHAR(20),
  IN P3_Location_code INT,
  IN P4_RolloutDate VARCHAR(20),
  IN P5_Phase INT
  )
  
  BEGIN
      declare O1_InsertStatus VARCHAR(250);
      IF P1_PROC_TYPE = 'ADD-STORE' THEN   
          IF( ( SELECT Count(*)   FROM dim_location WHERE location_code = P3_Location_code) &gt;0 ) THEN     
              SET O1_InsertStatus =  'Requested Store is already a  Store...!!!';
          ELSE    
              INSERT INTO  dim_location
              (location_code, location_name, store_zone, region, area, opening_date, closing_date, isactive, dc_code,
              city,dc_city,location_type,catchment,emailid,circle,business_zone,cluster_name,store_cluster,ofine_code,
              region,new_date,rollout_Phase,createdDate,createdBy)
  
              SELECT  location_code, store_name, zone_name, region, area, opening_date, closing_date, isactive, dc_code,
              city,dc_city,location_type,catchment,emailid,circle,business_zone,cluster_name,store_cluster,ofine_code,
              region,P4_RolloutDate AS new_date,P5_Phase AS rollout_Phase,CURRENT_DATE AS createdDate,1 AS createdBy
              FROM    dim_location
               WHERE location_code = P3_Location_code; 
  
              SET O1_InsertStatus =  'Store included to  Store...!!!';
          END IF;
      END IF;
  END;
  </code></pre>