Professional Web Applications Themes

Change the delimiter charater in db - Coldfusion - Advanced Techniques

Hi All, Does anyone know how to change the dlimiter character before it is submitted into a DB?? Right now by default a comma is used, but I want to change it to a pipe character. Is this doable. Thanks in advance Maurice...

Sponsored Links
  1. #1

    Default Change the delimiter charater in db

    Hi All, Does anyone know how to change the dlimiter character before it is
    submitted into a DB?? Right now by default a comma is used, but I want to
    change it to a pipe character. Is this doable.

    Thanks in advance


    Maurice

    Sponsored Links
    EdmondsM Guest

  2. #2

    Default Re: Change the delimiter charater in db

    Convert your varibale or form field using the function ListChangeDelims:

    <CFSET newlist = ListChangeDelims(oldlist, "|", ",")>

    -Paul

    dempster Guest

  3. #3

    Default Re: Change the delimiter charater in db

    DOH! So in my case it would work something like this??

    <cfset NEWSPS = ListChangeDelims(form.SPS, "|", ",")>

    INSERT INTO tbl_something(SPS) VALUES('#newsps#')

    Am I on the right track??

    EdmondsM Guest

  4. #4

    Default Re: Change the delimiter charater in db

    OK, I answered my own question on my last post.

    How would I go about displaying each of the the following items in a
    <cfinput>?? I need one per box.
    John|Mary|Sue

    When I do the following <cfloop> I get the above in three text fields. What I
    need is John to show in one box and Mary to show in the second and Sue to show
    in the third.



    EdmondsM Guest

  5. #5

    Default Re: Change the delimiter charater in db

    Store them as three records instead of a list in one record.
    Dan Guest

  6. #6

    Default Re: Change the delimiter charater in db

    The following code will output your separate cfinput boxes.


    <cfloop index="firstName" list="John|Mary|Sue" delimiters="|">
    <cfinput value="#firstName#">
    </cfloop>
    efecto747 Guest

  7. #7

    Default Re: Change the delimiter charater in db

    This is what I came up with also.

    Thanks for you help.
    EdmondsM Guest

Similar Threads

  1. Delimiter for string..
    By Ajit P Singh in forum PERL Beginners
    Replies: 3
    Last Post: February 5th, 01:16 PM
  2. DBCS Charater sort
    By Colin Johnstone in forum PERL Beginners
    Replies: 1
    Last Post: December 1st, 12:35 AM
  3. Japanese Font problems? (Double Byte Charater sets)
    By smack webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 0
    Last Post: October 17th, 09:25 AM
  4. Delimiter WITHOUT lots of IF's
    By Cesar Aracena in forum PHP Development
    Replies: 2
    Last Post: August 19th, 03:33 AM
  5. Regex help (? as delimiter)
    By Gunnar Hjalmarsson in forum PERL Miscellaneous
    Replies: 2
    Last Post: July 23rd, 06:35 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139