If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Stored procedure to improve performance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-11, 07:28
najeeb najeeb is offline
Registered User
 
Join Date: Dec 2011
Posts: 2
Arrow Stored procedure to improve performance

Please show me how to write a stored procedure for this query....Thanks

SELECT consumer_number,name,address,contact_mobile,subare aid,
ownership,hometype,num_cfl_type1,num_cfl_type2,num _icl_type1,num_icl_type2,
payment_received,distribution_completed,participat ion, non_participating_reason,registeredr,registereddat e
FROM cpa_consumerinfo
WHERE subareaid =’?’;

PLEASE SOMEONE HELP ME WITH THIS....
Reply With Quote
  #2 (permalink)  
Old 12-13-11, 08:54
bono56 bono56 is offline
Registered User
 
Join Date: May 2004
Posts: 133
Code:
DELIMITER $$
DROP PROCEDURE IF EXISTS `spCurrentTeamValue` $$
CREATE PROCEDURE `spMy`(IN sid INT)
BEGIN
  SELECT consumer_number,name,address,contact_mobile,subare aid,
  ownership,hometype,num_cfl_type1,num_cfl_type2,num _icl_type1,num_icl_type2,
  payment_received,distribution_completed,participat ion, non_participating_reason,registeredr,registereddat e
  FROM cpa_consumerinfo
  WHERE subareaid =sid;
END $$
DELIMITER ;
& call it by

Code:
CALL spMy(1);
__________________
Lyrics Database: www.shermani.com
Reply With Quote
  #3 (permalink)  
Old 12-15-11, 05:57
najeeb najeeb is offline
Registered User
 
Join Date: Dec 2011
Posts: 2
Thanks!!!! i got it
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On