Batch Updates

Results 1 to 2 of 2

Thread: Batch Updates

  1. #1
    Anju Guest

    Default Batch Updates

    I have an application that should allow batch updates. It seems to be working fine when i have numeric id&#039;s but does not work when i have character id&#039;s.<BR><BR>In my first page i am displaying the records and giving a check box against each record.the user can check any particular record to be updated. The checked values are taken in a comma delimted list.<BR><BR>IN the next page i take all the Id&#039;s and update thhem to a fixed value. If my ids are text then the problem that arises in query statement is something that looks like<BR><BR>UPDATE Monthlytrans SET status = &#039;D&#039; WHERE memberid in (&#039;SB004,SB002&#039;)<BR><BR>I want each of the member to be started and ended with an apostrophe since my ID is text based.<BR><BR>Hope i have been clear in my question. Is there any other way to cope with this problem.<BR><BR>Anju.

  2. #2
    Join Date
    Dec 1969

    Default RE: Batch Updates

    This is how i do it when using queries using IN clause.<BR>The code below would output &#039;one&#039;,&#039;two&#039;,&#039;three&#039;, &#039;four&#039; which you can use in your query.<BR><BR>Dim var, MemberIDS, i, inSQL<BR><BR>var = "one,two,three,four"<BR>memberIDS = split (var, ",")<BR><BR>for i = 0 to ubound(memberIDS)<BR> if i = 0 then <BR> inSQL = inSQL & "&#039;" & memberIDS(i) & "&#039;"<BR> else<BR> inSQL = inSQL & ",&#039;" & memberIDS(i) & "&#039;"<BR> end if<BR>next<BR>response.write inSQL<BR><BR>/Anders

Posting Permissions

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