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 8137159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:00:33+00:00 2026-06-06T11:00:33+00:00

I have a database containing user details. I don’t have separate columns for ‘firstname’

  • 0

I have a database containing user details. I don’t have separate columns for ‘firstname’ and ‘lastname’. I have used only a single column: ‘name’. My query is like this:

ps_details=con.prepareStatement("select * from student_details where name=?");  
ps_details.setString(1,name);

The problem is:

In db the name is stored in UPPERCASE. So when the user types his/her name in lowercase or mixed-case, the search is unsuccessful. What is the efficient solution for this problem?

Further, what if ‘name’ are stored in db in lower-case, mixed-case as well as uppercase, i.e., if the case is not known before hand. I also want to use like clause

I am using Oracle 11g Express Editon.

  • 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-06T11:00:35+00:00Added an answer on June 6, 2026 at 11:00 am

    UPPER – the upper function converts all letters in the specified string to uppercase. Use it on both the variable (user input) and table column values, convert them both to the same case for comparison to handle both problems. (You could also use lower – the idea is to convert both to the same case for comparison). *EDITED FOR LIKE with only the postceding wildcard *

    select * from student_details where UPPER(name) like UPPER(?) || '%'
    

    This you have to play with, but I think you can also do the following with the wildcard.

    ps_details=con.prepareStatement("select * from student_details where UPPER(name) like UPPER(?)");  
    ps_details.setString(1,name%);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

quick question. In my user database I have 5 separate tables all containing different
I have a database containing a single huge table. At the moment a query
I have a database with several tables, each one containing columns that may not
Suppose I have a database containing 3 tables in a grails application: User Activity
I have a MySQL database containing a user's country and whether they are an
I have MonetDB database with table containing user table: CREATE TABLE user ( birth_date
I have a staff database table containing staff members, with user_no and user_name columns.
I have a database containing a list of status updates and time stamp. by
Say I have a database containing Books and Users and these users have certain
I have a database table containing dates (`date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00').

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.