Professional Web Applications Themes

UPPER & LOWER don't work in UDF - MySQL

Hello, I had a pretty decent Google for this, so apologies if this has been answered many times before. I am trying to make a UDF to change case. What troubles me though is that I can't seem to get either LOWER or UPPER to change the case, when it's called inside a UDF. If the UPPER or LOWER is called outside, it works brilliantly, as expected. I got desperate in the end & took the doco example, as detailed below: CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ', UPPER(s), '!'); When I call this function as detailed ...

  1. #1

    Default UPPER & LOWER don't work in UDF

    Hello,

    I had a pretty decent Google for this, so apologies if this has been
    answered many times before.

    I am trying to make a UDF to change case.

    What troubles me though is that I can't seem to get either LOWER or
    UPPER to change the case, when it's called inside a UDF.

    If the UPPER or LOWER is called outside, it works brilliantly, as
    expected.

    I got desperate in the end & took the doco example, as detailed below:
    CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)
    RETURN CONCAT('Hello, ', UPPER(s), '!');

    When I call this function as detailed in the doco (SELECT
    hello('world')), I would expect:
    Hello, WORLD!

    I don't, I get plain old:
    Hello, world!

    I'm running MySQL 5.0.17 through Uniform Server.

    I've tried everything I can think of, so be interested in what
    suggestions people have to offer.

    Thanks,
    Peter.

    pandpp Guest

  2. #2

    Default UPPER & LOWER don't work in UDF

    Hello,

    I had a pretty decent Google for this, so apologies if this has been
    answered many times before.

    I am trying to make a UDF to change case.

    What troubles me though is that I can't seem to get either LOWER or
    UPPER to change the case, when it's called inside a UDF.

    If the UPPER or LOWER is called outside, it works brilliantly, as
    expected.

    I got desperate in the end & took the doco example, as detailed below:
    CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)
    RETURN CONCAT('Hello, ', UPPER(s), '!');

    When I call this function as detailed in the doco (SELECT
    hello('world')), I would expect:
    Hello, WORLD!

    I don't, I get plain old:
    Hello, world!

    I'm running MySQL 5.0.17 through Uniform Server.

    I've tried everything I can think of, so be interested in what
    suggestions people have to offer.

    Thanks,
    Peter.

    pandpp Guest

  3. #3

    Default Re: UPPER & LOWER don't work in UDF

    "pandpp" <com> wrote in
    news:googlegroups.com:
     

    http://bugs.mysql.com/bug.php?id=12903

    --
    felix
    Felix Guest

  4. #4

    Default Re: UPPER & LOWER don't work in UDF

    Thanks Felix, absolutely perfect.

    Peter.


    Felix Geerinckx wrote: 
    >
    > http://bugs.mysql.com/bug.php?id=12903
    >
    > --
    > felix[/ref]

    pandpp Guest

Similar Threads

  1. Replies: 2
    Last Post: April 17th, 05:51 AM
  2. [newbie] upper to lower first letter of a word
    By Yvon Thoraval in forum Ruby
    Replies: 27
    Last Post: September 29th, 03:29 AM
  3. String formatting function - First char Upper, rest lower
    By James Johnson in forum PHP Development
    Replies: 1
    Last Post: September 6th, 09:48 PM
  4. Regexp help - upper to lower ONLY matching this pattern
    By Patrick in forum PERL Miscellaneous
    Replies: 4
    Last Post: August 27th, 06:16 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