We help IT Professionals succeed at work.
Get Started

mysql stored proc parameter

717 Views
Last Modified: 2012-05-10
Hi,

How do i add my SEAS parameter into the season part of my Proc?

so where i have  SET P_SEASON = 'H08'

I want to have
 SET P_SEASON = ',SEAS,'

and in the call, populate the fied to be season 'H09'



also what is the alternative to LOAD DATA, as this is not possible in Mysql stored proc.
Thanks guys
delimiter $$
Drop procedure if exists `havais` $$
create procedure `havais`(SEAS varchar(20))

BEGIN

UPDATE havais
SET B_DESCRIPTION=replace(B_DESCRIPTION,E_SIZE,'');
    UPDATE havais
    SET A_STYLECODE =replace(A_STYLECODE,E_SIZE,'');
        UPDATE havais
        SET C_SHORT_COLOUR = left(D_FULL_COLOUR,5);
            UPDATE havais
            SET E_SIZE = left(E_SIZE,3);
                  UPDATE havais
                  SET M_SUBDEPARTMENT = L_DEPARTMENT;
            UPDATE havais
            SET P_SEASON = 'H08' ;
        UPDATE havais
        SET S_VALID_MONTHS = "YYYYYYYYYYYY";
    UPDATE havais
    SET AD_RESERVED_B = '';

SET @selhav = concat("
select * from havais order by N_PRODUCT  ") ;

prepare hav from @selhav;
execute hav;
deallocate prepare hav ;


END $$
DELIMITER $$

call `havais`('H09');

Open in new window

Comment
Watch Question
Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE