Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8513315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:31:53+00:00 2026-06-11T04:31:53+00:00

I need the functionality of initcap for the region names. Is there any way

  • 0

I need the functionality of initcap for the region names. Is there any way to achieve this in MySQL?

  • Africa
  • India Sub Continent
  • U.S. West Coast
  • Europe / U.K

in this way the results can be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:31:55+00:00Added an answer on June 11, 2026 at 4:31 am

    Sometime back I was looking for a built-in initcap/ucfirst function in MySQL but unfortunately couldn’t find such string functions so decided to write my own.. thanks to the MySQL community member who corrected the bug in my function & posted it back.

    DELIMITER $$
    
    DROP FUNCTION IF EXISTS `test`.`initcap`$$
    
    CREATE FUNCTION `initcap`(x char(30)) RETURNS char(30) CHARSET utf8
    READS SQL DATA
    DETERMINISTIC
    BEGIN
    SET @str='';
    SET @l_str='';
    WHILE x REGEXP ' ' DO
    SELECT SUBSTRING_INDEX(x, ' ', 1) INTO @l_str;
    SELECT SUBSTRING(x, LOCATE(' ', x)+1) INTO x;
    SELECT CONCAT(@str, ' ', CONCAT(UPPER(SUBSTRING(@l_str,1,1)),LOWER(SUBSTRING(@l_str,2)))) INTO @str;
    END WHILE;
    RETURN LTRIM(CONCAT(@str, ' ', CONCAT(UPPER(SUBSTRING(x,1,1)),LOWER(SUBSTRING(x,2)))));
    END$$
    
    DELIMITER ;
    
    
    Usage: 
    
    select initcap('This is test string');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way I can implement functionality which will clear all my data/files/shared_preferences/database
Are there any wizard type controls in WPF? I need functionality where I can
I am working on one project where there is a functionality need to implement
I need some additional functionality added to user_pass_submit. This must be added without changing
LogParser isn't open source and I need this functionality for an open source project
Hey, is there any way to determine is UIPickerView is scrolling currently, I really
I need this functionality in my recent php code many times, So I am
I need scheduling functionality on my .NET MVC website and I came across Quartz.net
I'm writing an application in .NET 2.0 and I need the functionality of a
I am developing an IOS app. I need a functionality that includes undo and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.