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!

need help with length(string) comparision

AteeqMay 15 2023

Hi,

Oracle forms 6i,

Oracle Database 11.2.0.4

I need to compare length of 2 text fields in tabular detail block and store ‘Y’ if all records are same or store ‘N’ even if 1 record is different. I tried below code, but its not working properly. It shows Y even if 1 record matches.

declare

print_flag varchar2(1);

Begin
go_block('REQUISITION_DETAIL');
first_record;
print_flag:='N';
while (:REQUISITION_DETAIL.part_DESCRIPTION is not null and :REQUISITION_DETAIL.RDTL_QTY is not null)
loop
if length(LTRIM(RTRIM(:REQUISITION_DETAIL.NON_STOCK_ITEM_DESC))) = length(LTRIM(RTRIM(:REQUISITION_DETAIL.LONG_DESC_HOLD)))
then print_flag:='Y';
end if;
next_record;
end loop;
first_record;
End;

This post has been answered by Stax on May 15 2023
Jump to Answer
Comments
Post Details
Added on May 15 2023
2 comments
357 views