Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query on strings

546215Nov 17 2006 — edited Nov 17 2006
hi

I have a 83 character string, i am using this query to split it in two strings

select substr(s_string, 1, trunc(length(s_string) / 2)) || ' ' ||
substr(s_string, trunc((length(s_string / 2))) + 1) from dual;

it will split in two strings of one with 41 characters,space and the remaining characters.

suppose if i am having 183 characters this query will split in two strings one with 91 characters,space and remaining characters.

but i want the length of the two strings should be less than 80 whatever be the I/p string length.i/p string length can be greater than 200 also but it should split in such a manner that o/p strings must have length less than 80.

kindly helme with this issue
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2006
Added on Nov 17 2006
3 comments
291 views