×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using the "IN" filter in Select statement for source

Using the "IN" filter in Select statement for source

Using the "IN" filter in Select statement for source

(OP)
I need to use a parameter to pass in one string with multiple values for use inside the "IN" filter of a select statement. Example: parameter is named myParam

I want to set myParam value to 'A2fg','A2fh','A2fi','A2fj'

And use it in the select statement inside the source query of a dts package like this


Select * from tblTable where ID in (?)

I've tried it but keep getting an error when clicking on preview that states:
[Microsoft][ODBC Driver For Oracle]Wrong Number of Parameters.

RE: Using the "IN" filter in Select statement for source

I'm very new to sQL Server, so this may be absolutely worthless.  However, I've run into similar problems in PL/SQL and was able to work around it by passing the target in completely enclosed in surrounding quotes - like ''A2fg','A2fh','A2fi','A2fj'' or "'A2fg','A2fh','A2fi','A2fj'".  The problem you are running into is that the target routine sees 'A2fg','A2fh','A2fi','A2fj' as four different values instead of one character string.  The enclosing marks make your list appear as a single value (at least, they do in Oracle).  Hope this helps.

RE: Using the "IN" filter in Select statement for source

(OP)
Does anyone know if it's possible to pass in a query as a global parameter?

I tried adding a Dynamic Properties Task to set the global variable to the values I wanted posted inside the "IN" filter of the query but it never set the entire string to the value of the global variable.

RE: Using the "IN" filter in Select statement for source

you can with 2000+. not with earlier versions

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

RE: Using the "IN" filter in Select statement for source

(OP)
does 2000+ include SQL Server 2000? If so could you explain how to go about doing it?

Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close