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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:08:28+00:00 2026-06-09T04:08:28+00:00

I have to get the records from a table field where Length of record/data/string

  • 0

I have to get the records from a table field where Length of record/data/string is greater then 8 characters. I cannot use any string function as the query has to be used on (MySQL, MSSQL, Oracle).

I don’t want to do the below EXAMPLE:

List<String> names = new ArrayList<String>();
String st = select 'name' from table;

rs = executeSQL(st);
if ( rs != null )
{
    rs.next();
    names.add(rs.getString(1));
}

for(String name : names)
{
    if(name.length() > 8)
    result.add(name);
}

Any idea other then the one coded above? A query that can get the required result instead of processing on the retrieved data and then getting the required result.

Thank you for any help / clue.

  • 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-09T04:08:30+00:00Added an answer on June 9, 2026 at 4:08 am

    JDBC Drivers may implement a JDBC escapes for the functions listed in appendix D (Scalar Functions) of the JDBC specification. A driver should convert the scalar functions it supports to the appropriate function on the database side. A list of the supported functions can be queried using ‘DatabaseMetaData.getStringFunctions()’

    To use this in a query you would then either use CHAR_LENGTH(string) or LENGTH(string) like :

    SELECT * FROM table WHERE {fn CHAR_LENGTH(field)} > 8
    

    You can replace CHAR_LENGTH with LENGTH. The driver (if it supports this function) will then convert it to the appropriate function in the underlying database.

    From section 13.4.1 Scalar Functions of the JDBC 4.1 specification:

    Appendix D “Scalar Functions” provides a list of the scalar functions
    a driver is expected to support. A driver is required to implement
    these functions only if the data source supports them, however.

    The escape syntax for scalar functions must only be used to invoke the
    scalar functions defined in Appendix D “Scalar Functions”. The escape
    syntax is not intended to be used to invoke user-defined or vendor
    specific scalar functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table with 300 000 records (MyISAM). I get record from this table
I have 2 tables, and want to get records from 1 table and to
I have such Linq, I would like to get all records from Orders table
I have to get records from my MySQL DB where: sentto = $username OR
I have two employee lists that I want to get only unique records from
I have a couple hundred records in a table and I need to get
I have a view that basically just returns all records from a table, and
I want to be able to use a varable table to delete records from
I have some database table and need to process records from it 5 at
I have a table:'Categories' which has two fields:Category_ID and Category. Data in Category_ID field

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.