comma delimated output

Results 1 to 3 of 3

Thread: comma delimated output

  1. #1
    Join Date
    Dec 1969

    Default comma delimated output

    Hi all,<BR><BR>I have a table emp(id,name,city,sal). If I query the table for the empids who are getting more than 10,000 salary the result will be like this<BR><BR>id<BR>1<BR>2<BR>3<BR>4<BR>5<BR><BR>I want to use this result in another query which should look like<BR><BR>sql="select name from emp where id in(1,2,3,4,5)"<BR><BR>what I want to get this values comma delimated...<BR><BR>Pls do help<BR><BR><BR>Regards<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: comma delimated output

    I didn&#039;t really understand wht u want.<BR><BR>wht do u mean by "this values comma delimated..."?<BR><BR>when u use sql="select name from emp where id in(1,2,3,4,5)"<BR>the result u get is not seperated by comma....<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Do it like this.

    Use GetString to get what you need<BR>Do it like this<BR><BR>intMyVals = rs.GetString(,,,",", "--NULL--")<BR><BR>This will write all the values of the ID Field as<BR>1,2,3,5,8,9<BR><BR><BR>Make sure in your Query You are only selecting the ID Field only...<BR><BR>If you select any other field it will get mixed into the values<BR><BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts