Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7021873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:30:25+00:00 2026-05-27T23:30:25+00:00

I want to give if condition in my procedure but creating problem please help

  • 0

I want to give if condition in my procedure but creating problem please help me out .

 DELIMITER $$

DROP PROCEDURE IF EXISTS `fill_plan_data`$$
CREATE PROCEDURE `fill_plan_data`(IN statecode VARCHAR(2), carrier_name VARCHAR(50))
    BEGIN
    DECLARE countMedicaid int default 0;
    insert into carrier (`name`,`state_code`,`active`,`carrier_id`) select CONCAT(UPPER(SUBSTRING(carrier_name, 1, 1)), LOWER(SUBSTRING(carrier_name from 2))), upper(statecode), '1', upper(concat_ws('-',carrier_name,statecode)) from (select distinct `state_code` from zip_codes)t where state_code = upper(statecode);
    select count(*) into countMedicaid from plan_details p , carrier c where c.name = carrier_name and c.state_code = statecode and c.id = p.carrier_id and p.programType = 'medicaid';
    if countMedicaid == 0 then
        //then do some insert query 
    end if

    insert into plan_details (`name`,`plan_type`,`carrier_id`,benefits,active,active_from,active_to,created_by,created_date,updated_by,updated_date,plan_id,market_code,family_code,available_for,level_of_coverage,customer_rating,quality_rating,`type`) select concat(`name`,' Simple 2'), '0', id,'<?xml version=\"1.0\" encoding=\"UTF-8\"?><planBenefits lifeTimeMaximum_outnw=\"0.0\" lifeTimeMaximum_innw=\"0.0\" mailOrderDaysSupply_innw=\"90.0\" mailOrderDaysSupply_outnw=\"0.0\"><pcpRequired_innw value=\"true\"/><pcpRequired_outnw/><srRequired_innw value=\"true\"/><srRequired_outnw/><hsaEligible_innw value=\"true\"/><hsaEligible_outnw/><outOfNetworkCoverage_innw value=\"false\"/><outOfCountryCoverage_innw/><outOfCountryCoverage_outnw/><adminFees_innw payableWhen=\"ONE_TIME\" amount=\"50.0\"/><adminFees_outnw payableWhen=\"NONE\" amount=\"0.0\"/><deductible_innw applicable=\"true\" individual_amt=\"1000.0\" family_amt=\"2000.0\" displayString=\"\"/><deductible_outnw applicable=\"true\" individual_amt=\"10000.0\" family_amt=\"20000.0\"/><coinsurance_innw applicable=\"true\" amount=\"40.0\" beforeDeductible=\"true\"/><coinsurance_outnw applicable=\"true\" amount=\"50.0\" beforeDeductible=\"true\"/><outOfPocketLimit_innw applicable=\"true\" individual_amt=\"2000\" family_amt=\"4000\"   /><outOfPocketLimit_outnw applicable=\"true\" individual_amt=\"12500.0\" family_amt=\"25000.0\"/><primaryDoctor_innw covered=\"true\" copay=\"20.0\"/><primaryDoctor_outnw covered=\"true\"/><specialist_innw covered=\"true\" copay=\"20.0\"/><specialist_outnw covered=\"true\" coinsuranceAfterDeductible=\"50.0\"/><periodicHealthExam_innw covered=\"false\" copay=\"0.0\"/><periodicHealthExam_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\"/><periodicObGynExam_innw covered=\"false\" copay=\"0.0\"/><periodicObGynExam_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\"/><wellBabyCare_innw covered=\"false\" copay=\"0.0\"/><wellBabyCare_outnw covered=\"true\" copay=\"50.0\"/><chiropractic_innw covered=\"true\" coinsuranceAfterDeductible=\"40.0\" displayString=\"Max 5 outpatient visits per benefit year\"/><chiropractic_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\"/><mentalHealth_innw covered=\"false\" coinsuranceAfterDeductible=\"0.0\" displayString=\"Limited to Biologically Based Mental Illness/Copayment or coinsurance/Deductible is depending on place of service.\"/><mentalHealth_outnw covered=\"true\" coinsuranceBeforeDeductible=\"0.0\"/><genericPrescriptionDrugs_innw covered=\"true\" copay=\"15.0\" displayString=\"\"/><genericPrescriptionDrugs_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\" displayString=\"or 50%, whichever is greater \"/><brandedPrescriptionDrugs_innw covered=\"true\" copay=\"30.0\" displayString=\"\"/><brandedPrescriptionDrugs_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\" displayString=\"or 50%, whichever is greater \"/><nonFormulatoryPrescriptionDrugs_innw covered=\"true\" copay=\"50.0\" displayString=\"\"/><nonFormulatoryPrescriptionDrugs_outnw covered=\"true\" copay=\"50.0\"/><annualPrescriptionDrugs_innw applicable=\"false\" individual_amt=\"0.0\" family_amt=\"0.0\"/><anuualPrescriptionDrugs_outnw applicable=\"true\" individual_amt=\"50.0\" family_amt=\"101.0\"/><genericMailOrder_innw covered=\"true\" copay=\"30.0\" displayString=\"\"/><genericMailOrder_outnw covered=\"true\" copay=\"80.0\" displayString=\"or 50%, whichever is greater \"/><brandedMailOrder_innw covered=\"true\" copay=\"60.0\" displayString=\"\"/><brandedMailOrder_outnw covered=\"true\" copay=\"500.0\" displayString=\"or 50%, whichever is greater \"/><nonFormulatoryMailOrder_innw covered=\"true\" copay=\"150.0\" displayString=\"\"/><nonFormulatoryMailOrder_outnw covered=\"true\" coinsuranceBeforeDeductible=\"80.0\"/><annualMailOrder_innw applicable=\"false\" individual_amt=\"0.0\" family_amt=\"0.0\" displayString=\"None\"/><annualMailOrder_outnw applicable=\"true\" individual_amt=\"50.0\" family_amt=\"101.0\"/><labsAndXRays_innw covered=\"true\" copay=\"0.0\" displayString=\"Copay after deductible\"/><labsAndXRays_outnw covered=\"true\" coinsuranceAfterDeductible=\"50.0\"/><emergencyRoom_innw covered=\"true\" copay=\"100.0\" displayString=\"Copay after deductible\"/><emergencyRoom_outnw covered=\"true\" copay=\"50.0\"/><outpatientSurgery_innw covered=\"true\" copay=\"0.0\" displayString=\"Copay after deductible\"/><outpatientSurgery_outnw covered=\"true\" coinsuranceAfterDeductible=\"50.0\"/><hospitalization_innw covered=\"true\" copay=\"0.0\" displayString=\"Copay after deductible\"/><hospitalization_outnw covered=\"true\" coinsuranceAfterDeductible=\"5000.0\"/><preAndPostNatalOfficeVisit_innw covered=\"false\"/><preAndPostNatalOfficeVisit_outnw covered=\"true\" displayString=\"Complications Only\"/><laborDeliveryHospitalStay_innw covered=\"false\"/><laborDeliveryHospitalStay_outnw covered=\"false\" displayString=\"Complications Only\"/><mailOrderAvailable_innw value=\"true\"/><mailOrderAvailable_outnw/><preventiveCare_innw value=\"true\"/><preventiveCare_outnw value=\"true\"/><benefitsUrls><benefits url=\"http://www.electroluxicon.com/Files/International_English/0-999/documents/E24CM76GSS_UC.pdf\"/><benefits url=\"http://www.sedl.org/scimath/pasopartners/pdfs/health.pdf\"/><benefits url=\"CovOne EG 09-10.pdf\" displayText=\"Plan Brochure\"/></benefitsUrls><officeVisits_innw value=\"true\"/><officeVisits_outnw value=\"true\"/><prescriptionDrugBenefit_innw value=\"true\"/><prescriptionDrugBenefit_outnw value=\"true\"/><hospitalServices_innw value=\"true\"/><hospitalServices_outnw value=\"true\"/><maternity_innw value=\"true\"/><maternity_outnw value=\"true\"/><addlCoverage_innw value=\"true\"/><addlCoverage_outnw value=\"true\"/></planBenefits>',1,'2009-01-10','2012-01-03','mohit.agarwal@hcentive.com',CURRENT_TIMESTAMP(),null,null,concat(carrier_id,'SIMPLE_2'),concat(`name`,'_market_code'),'Simple',0,'silver',5,4,0 from carrier where carrier.state_code=upper(statecode) and carrier.name=carrier_name;
    insert into plan_details (`name`,`plan_type`,`carrier_id`,benefits,active,active_from,active_to,created_by,created_date,updated_by,updated_date,plan_id,market_code,family_code,available_for,level_of_coverage,customer_rating,quality_rating,`type`) select concat(`name`,' Simple 3'), '0', id, '<?xml version=\"1.0\" encoding=\"UTF-8\"?><planBenefits lifeTimeMaximum_outnw=\"0.0\" lifeTimeMaximum_innw=\"0.0\" mailOrderDaysSupply_innw=\"90.0\" mailOrderDaysSupply_outnw=\"0.0\"><pcpRequired_innw value=\"true\"/><pcpRequired_outnw/><srRequired_innw value=\"true\"/><srRequired_outnw/><hsaEligible_innw value=\"true\"/><hsaEligible_outnw/><outOfNetworkCoverage_innw value=\"false\"/><outOfCountryCoverage_innw/><outOfCountryCoverage_outnw/><adminFees_innw payableWhen=\"ONE_TIME\" amount=\"50.0\"/><adminFees_outnw payableWhen=\"NONE\" amount=\"0.0\"/><deductible_innw applicable=\"false\" individual_amt=\"0.0\" family_amt=\"0.0\" displayString=\"None\"/><deductible_outnw applicable=\"true\" individual_amt=\"10000.0\" family_amt=\"20000.0\"/><coinsurance_innw applicable=\"true\" amount=\"40.0\" beforeDeductible=\"true\"/><coinsurance_outnw applicable=\"true\" amount=\"50.0\" beforeDeductible=\"true\"/><outOfPocketLimit_innw applicable=\"true\" individual_amt=\"2000\" family_amt=\"4000\"   /><outOfPocketLimit_outnw applicable=\"true\" individual_amt=\"12500.0\" family_amt=\"25000.0\"/><primaryDoctor_innw covered=\"true\" copay=\"25.0\"/><primaryDoctor_outnw covered=\"true\"/><specialist_innw covered=\"true\" copay=\"40.0\"/><specialist_outnw covered=\"true\" coinsuranceAfterDeductible=\"50.0\"/><periodicHealthExam_innw covered=\"false\" copay=\"0.0\"/><periodicHealthExam_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\"/><periodicObGynExam_innw covered=\"false\" copay=\"0.0\"/><periodicObGynExam_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\"/><wellBabyCare_innw covered=\"false\" copay=\"0.0\"/><wellBabyCare_outnw covered=\"true\" copay=\"50.0\"/><chiropractic_innw covered=\"true\" coinsuranceAfterDeductible=\"40.0\" displayString=\"Max 5 outpatient visits per benefit year\"/><chiropractic_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\"/><mentalHealth_innw covered=\"false\" coinsuranceAfterDeductible=\"0.0\" displayString=\"Limited to Biologically Based Mental Illness/Copayment or coinsurance/Deductible is depending on place of service.\"/><mentalHealth_outnw covered=\"true\" coinsuranceBeforeDeductible=\"0.0\"/><genericPrescriptionDrugs_innw covered=\"true\" copay=\"15.0\" displayString=\"\"/><genericPrescriptionDrugs_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\" displayString=\"or 50%, whichever is greater \"/><brandedPrescriptionDrugs_innw covered=\"true\" copay=\"50.0\" displayString=\"\"/><brandedPrescriptionDrugs_outnw covered=\"true\" coinsuranceAfterDeductible=\"0.0\" displayString=\"or 50%, whichever is greater \"/><nonFormulatoryPrescriptionDrugs_innw covered=\"true\" coinsuranceAfterDeductible=\"50.0\" displayString=\"\"/><nonFormulatoryPrescriptionDrugs_outnw covered=\"true\" copay=\"50.0\"/><annualPrescriptionDrugs_innw applicable=\"false\" individual_amt=\"0.0\" family_amt=\"0.0\"/><anuualPrescriptionDrugs_outnw applicable=\"true\" individual_amt=\"50.0\" family_amt=\"101.0\"/><genericMailOrder_innw covered=\"true\" copay=\"30.0\" displayString=\"\"/><genericMailOrder_outnw covered=\"true\" copay=\"80.0\" displayString=\"or 50%, whichever is greater \"/><brandedMailOrder_innw covered=\"true\" coinsuranceAfterDeductible=\"50.0\" displayString=\"\"/><brandedMailOrder_outnw covered=\"true\" copay=\"500.0\" displayString=\"or 50%, whichever is greater \"/><nonFormulatoryMailOrder_innw covered=\"true\" coinsuranceAfterDeductible=\"50.0\" displayString=\"\"/><nonFormulatoryMailOrder_outnw covered=\"true\" coinsuranceBeforeDeductible=\"80.0\"/><annualMailOrder_innw applicable=\"false\" individual_amt=\"0.0\" family_amt=\"0.0\" displayString=\"None\"/><annualMailOrder_outnw applicable=\"true\" individual_amt=\"50.0\" family_amt=\"101.0\"/><labsAndXRays_innw covered=\"true\" copay=\"0.0\"/><labsAndXRays_outnw covered=\"true\" coinsuranceAfterDeductible=\"50.0\"/><emergencyRoom_innw covered=\"true\" copay=\"100.0\"/><emergencyRoom_outnw covered=\"true\" copay=\"50.0\"/><outpatientSurgery_innw covered=\"true\" copay=\"500.0\"/><outpatientSurgery_outnw covered=\"true\" coinsuranceAfterDeductible=\"50.0\"/><hospitalization_innw covered=\"true\" copay=\"500.0\"/><hospitalization_outnw covered=\"true\" coinsuranceAfterDeductible=\"5000.0\"/><preAndPostNatalOfficeVisit_innw covered=\"false\"/><preAndPostNatalOfficeVisit_outnw covered=\"true\" displayString=\"Complications Only\"/><laborDeliveryHospitalStay_innw covered=\"false\"/><laborDeliveryHospitalStay_outnw covered=\"false\" displayString=\"Complications Only\"/><mailOrderAvailable_innw value=\"true\"/><mailOrderAvailable_outnw/><preventiveCare_innw value=\"true\"/><preventiveCare_outnw value=\"true\"/><benefitsUrls><benefits url=\"http://www.electroluxicon.com/Files/International_English/0-999/documents/E24CM76GSS_UC.pdf\"/><benefits url=\"http://www.sedl.org/scimath/pasopartners/pdfs/health.pdf\"/><benefits url=\"CovOne EG 09-10.pdf\" displayText=\"Plan Brochure\"/></benefitsUrls><officeVisits_innw value=\"true\"/><officeVisits_outnw value=\"true\"/><prescriptionDrugBenefit_innw value=\"true\"/><prescriptionDrugBenefit_outnw value=\"true\"/><hospitalServices_innw value=\"true\"/><hospitalServices_outnw value=\"true\"/><maternity_innw value=\"true\"/><maternity_outnw value=\"true\"/><addlCoverage_innw value=\"true\"/><addlCoverage_outnw value=\"true\"/></planBenefits>',1,'2009-01-10','2012-01-03','mohit.agarwal@hcentive.com',CURRENT_TIMESTAMP(),null,null,concat(carrier_id,'SIMPLE_3'),concat(`name`,'_market_code'),'Simple',0,'gold',4,5,0  from carrier where carrier.state_code=upper(statecode) and carrier.name=carrier_name;

    insert into plan_documents (select plan_id, market_code, active_from, ExtractValue(benefits,'/planBenefits/benefitsUrls/benefits[@displayText="Additional Details"]/@url'), ExtractValue(benefits,'/planBenefits/benefitsUrls/benefits[@displayText="Plan Brochure"]/@url'), ExtractValue(benefits,'/planBenefits/benefitsUrls/benefits[@displayText="Exclusions and Limitations"]/@url'), null, CURRENT_TIMESTAMP()  from plan_details where plan_id like concat('%',carrier_name,'-',statecode , '%'));
    insert into plan_service_area_lookup select `code`,`county`,CONCAT(UPPER(SUBSTRING(carrier_name, 1, 1)), LOWER(SUBSTRING(carrier_name from 2)),'_Region_Code'),CONCAT(UPPER(SUBSTRING(carrier_name, 1, 1)), LOWER(SUBSTRING(carrier_name from 2)),'_Region_Desc'),CONCAT(UPPER(SUBSTRING(carrier_name, 1, 1)), LOWER(SUBSTRING(carrier_name FROM 2)),'_Market_Code'),upper(concat_ws('-',carrier_name,statecode)) from zip_codes where state_code = upper(statecode);
    insert into area_code_lookup select `code`,`county`,CONCAT(UPPER(SUBSTRING(carrier_name, 1, 1)), LOWER(SUBSTRING(carrier_name from 2)),'_Region_Code'),CONCAT(UPPER(SUBSTRING(carrier_name, 1, 1)), LOWER(SUBSTRING(carrier_name from 2)),'_Region_Desc'),upper(concat_ws('-',carrier_name,statecode)) from zip_codes where state_code = upper(statecode);

    END$$

please help me what gone wrong in if condition? if i delete if condition procedure execute successfully

DELIMITER ;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:30:26+00:00Added an answer on May 27, 2026 at 11:30 pm

    The “is equal to” operator in SQL is just =, not ==. Your MySQL client should have displayed an error message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to give a user access to a stored procedure, but not to
I want to give a link to a postscript file, but first I want
I want to give credit to all open source libraries we use in our
I want to give Windows Server 2008 a try as a .NET developer and
I want to give a minimal js code to random websites so that they
I want to give integer input to Ruby like this: 12 343 12312 12312
I want to give zoom effect to the iPhone camera image while capturing the
I want to give a blur effect to my DrawingVisual . I can do
I want to give my graph a title in big 18pt font, then a
I want to give users the possibility to dynamically add new columns at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.