Skip to Content

Functions in SQL query

Hello Xperts,

I need to write a select query which will give me the length of the string value stored in the field.

At present I have to read all values from the table and then loop at each value into workarea to find length of each field.

Is there any alternative to this? I am querying a table with more than 300K records and I do not want to loop at 300K records to find the desired field.

Any help is highly appreciated.

Ashutosh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Feb 24, 2009 at 01:57 PM

    I guess loop is mandatory to check each field....

    loop at itab assigning <fs>.
    
    assign components sy-index of structure <fs> to <fs_fied>.
    
    find string length...
    
    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.