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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:14:26+00:00 2026-05-11T10:14:26+00:00

I want to pass a comma delemited list of values as a parameter to

  • 0

I want to pass a comma delemited list of values as a parameter to a query I’m building using the designer in Visual Studio 2008 based on some strongly typed DAL tutorials I was going through. The query is going against a DB2 database. Here’s what I want to do:

select * from prices where customer in(?)

It works fine win I pass in 123456 as ?

But fails when I pass in ‘123456’ (it is a char field so I don’t know why this doesn’t work; it must be adding these behind the scenes) or 123456, 123457 or ‘123456’, ‘123457’

I’m adding this page to a portal where all the data access is being done based on the DAL designer model with a BLL that calls it so I wanted to do it this way for consistency. Is this possible or is this a situation where the tool just isn’t flexible enough to accomplish what I need it to do? Thanks.

  • 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. 2026-05-11T10:14:27+00:00Added an answer on May 11, 2026 at 10:14 am

    This is a very common mistake people make with parameterized queries. You have to remember that a single parameter placeholder ‘?‘ is a substitute for a single value.

    See the question link below for a clever solution for this problem from Joel Spolsky.

    ‘Parameterizing a SQL IN clause?‘

    Also a bunch of other people answered the same question, reiterating that the standard solution is to construct the SQL query dynamically, appending a parameter placeholder for each value you need to pass.

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

Sidebar

Related Questions

I want to pass in a comma separated list of values into a script
I want to pass comma separated values in filter query (fq) of solr response,
I want to pass '#' to the query string like ?page.aspx?someParam=1234#5 .
I want to pass data from second tab to first tab using delegates.But delegate
I need to pass 4 arguments (3 strings and one comma separated list) from
I want to calculate a percentage probability based on a list of past occurrences.
I am using SSIS (SQL Server 2008) to lookup values from a table. I
I want pass a class-instace to a method of an other and be sure
My data is just number, I want pass it from VC1 to VC2 for
I want to pass an ImageIcon instance by value as we know that by

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.