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 8558749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:52:57+00:00 2026-06-11T15:52:57+00:00

I have a stored procedure which takes input like myProcedure(Fashion,Sports, Shirts, Pants, null, null

  • 0

I have a stored procedure which takes input like

myProcedure("Fashion,Sports", "Shirts, Pants", null, null , "0,100")

myProc( productType, Item, ProductID, costprice, minMaxQuantity);

Now for the first parameter, myProcedure creates a mysql query somthing like

Select * from myTable where ProductType in ('Fashion,'Sports')
and Item in ('Shirts','Pants');

For creating “in” statement part I am using “Repalce” method of mysql

SET whrClause = REPLACE(productType, "," ," ',' ");

This way I am able to make a correct query, and even I am getting the desired results.

But the problem is, in input sometime I am getting

myProcedure("Adm/Husleie/Royalty,Fashion,Sports", "Shirts, Pants", null, null , "0,100");

now for first part of the first argument (i.e Adm/Husleie/Royalty)
Replace method is not working properly. I am not getting result for ProductType = Adm/Husleie/Royalty , but for Fashion and Sports I am getting the results. Can someone help me. How can I use absolute string and I can use replace method as well.

  • 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-06-11T15:52:59+00:00Added an answer on June 11, 2026 at 3:52 pm

    try this:

    Change your replace statement to

    SET whrClause =REPLACE(REPLACE(productType, "," ," ',' "),"/" ," ',' ");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mysql 5.1, stored procedure that takes TEXT input which is supposed
I have a stored procedure which takes an XML parameter and inserts the data
I have a stored procedure which basically does something like select top 1 expiryDate,
I have an Informix stored procedure which takes an int and a smallint as
I have an insert stored procedure which takes many parameters - 2 of them
If I have a parametrized stored procedure which takes a varchar(10) value and converts
I have a Stored procedure which schedules a job. This Job takes a lot
I have one Stored Procedure which takes around 2-3 minutes to complete its execution.
I have a stored procedure which takes as its parameter a varchar which needs
I have the following stored procedure which takes a user ID, a starting date,

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.