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!

Comparison in Select Statement using Substring

1031988Dec 11 2013 — edited Dec 11 2013

Hi,

Based on the business requirement, I m trying to get geography_element4  from hz_geographies  table that matches with parameter p_city  value.

Here I should take p_city value starting from 4th character to 8th character.

For below query, I m not getting correct result. Is the statement right ?   ge.geography_element4 like substr(:p_city,4,8);

SELECT UPPER(ge.geography_element4)

FROM  apps.hz_geographies ge 

WHERE ge.geography_type     = 'POSTAL_CODE'

AND   ge.geography_name     = SUBSTR(:postal_code,1,5)

AND   ge.created_by_module = 'EBTAX_CONTENT_UPLOAD'

AND   ge.country_code      = 'US'

AND   ge.geography_element4 like substr(:p_city,4,8);

Thanks.

This post has been answered by Solomon Yakobson on Dec 11 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2014
Added on Dec 11 2013
6 comments
792 views