forcing upper case on insert of record

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default forcing upper case on insert of record

    I'm having trouble figuring out the code to force a form field to upper case
    when it is inserted into the database. This is what I have. What am I doing
    wrong? Thanks.

    <cfquery name = "insdata" datasource = "#application.dsn#">
    insert into accounts
    (fname, lname, hsname, hscity, hsstate)
    values('#form.fname#','#form.lname#','#UCASE(form. hsname)#','#form.hscity#','#form.hsstate#')
    </cfquery>


    D Woods Guest

  2. Similar Questions and Discussions

    1. All text appear in upper case HELP!
      I don't know why but everything I enter appears in upper case. My caps are off and I checked everywhere I could think off to find how to turn off...
    2. automatically change to Upper Case
      Hi All, need a little help from all of u guys. I want to change input to uppercase while user key in. SO how can I make i in the input text...
    3. Forcing text into UPPER CASE???
      Is it possible to force a text members contents into upper case. E.g. 'nik' would be typed into a editable text box, it would then be turned into...
    4. help! forcing form variable to upper case (ASP VB)
      I got the following code help to force a form input to uppercase, but don't know where in the code it belongs. Can someone elaborate? strTemp =...
    5. OCI_ASSOC returns key with upper case string
      Hello, First let me say that I am not sure if this is PHP problem or Oracle. I have a class that contains API for using postgresql, mysql, or...
  3. #2

    Default Re: forcing upper case on insert of record

    Your code looks like the hsname will be inserted upppercase, and everything else will be inserted as entered. Is that what is happening? Is that what you want?
    Dan Bracuk Guest

  4. #3

    Default Re: forcing upper case on insert of record

    Yes...sorry I left that part out of my original post. I just need hsname to
    be forced to upper case.

    "Dan Bracuk" <webforumsuser@macromedia.com> wrote in message
    news:div3vg$qb2$1@forums.macromedia.com...
    > Your code looks like the hsname will be inserted upppercase, and
    > everything else will be inserted as entered. Is that what is happening?
    > Is that what you want?

    D Woods Guest

  5. #4

    Default Re: forcing upper case on insert of record

    Should be fine if hsname is the field that you want to be converted to uppercase.
    redevolve Guest

  6. #5

    Default Re: forcing upper case on insert of record

    And it's not happening? Your code suggests that it should.

    There is always this way:
    <cfset uppercasehsname=ucase(form.hsname)>

    Then use this new variable in your query instead of form.hsname. But I find
    it odd that your code as posted does not accomplish this. Mind you, I don't
    think I have ever used the ucase function inside a cfquery tag so I don't know
    for sure.

    Dan Bracuk Guest

  7. #6

    Default Re: forcing upper case on insert of record

    Check the formatting of the column in your database. That might be causing it.
    jjsand28 Guest

Posting Permissions

  • You may not post new threads
  • You may 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