saravanakumar
Member
Hi Team,
I am not sure if am missing out something, may be... I have 2 questions;
Question 1:
I have a Division id field which is a character field that would right align if only the numeric characters are available in the input string, others will be left aligned.
The Division Id value is "1" (numeric) and hence it would have been right aligned and stored in DB. Henceforth in our application there is a function that would create an array with size 12 that would substitue the value to the below query as i have done ("1", " 1", " 1", " 1" and so on)
FIND div NO-LOCK WHERE div.custid EQ "X999"
AND (div.id BEGINS "1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1") NO-ERROR.
IF AMBIGUOUS div THEN
DISP "YES".
ELSE
DISP "NO".
Result:
Eventhough a valid division " 1" is available the above query returns "NO" as output. Why?
Whereas if i use FOR..EACH am getting the Division Id...
Question 2:
Consider i have a division "ABC" and another division "ABCD" and if i execute the below query;
FIND div NO-LOCK WHERE div.custid = "X999"
AND div.id BEGINS "ABC" NO-ERROR.
IF AMBIGUOUS div THEN
DISP "YES".
ELSE
DISP "NO".
For the above query i was expecting "YES" as the answer but i got "NO". When i tried displaying the div table details i was able to get the details of div.id "ABC"...
Any suggestions? Thanks in advance!
I am not sure if am missing out something, may be... I have 2 questions;
Question 1:
I have a Division id field which is a character field that would right align if only the numeric characters are available in the input string, others will be left aligned.
The Division Id value is "1" (numeric) and hence it would have been right aligned and stored in DB. Henceforth in our application there is a function that would create an array with size 12 that would substitue the value to the below query as i have done ("1", " 1", " 1", " 1" and so on)
FIND div NO-LOCK WHERE div.custid EQ "X999"
AND (div.id BEGINS "1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1"
OR div.id BEGINS " 1") NO-ERROR.
IF AMBIGUOUS div THEN
DISP "YES".
ELSE
DISP "NO".
Result:
Eventhough a valid division " 1" is available the above query returns "NO" as output. Why?
Whereas if i use FOR..EACH am getting the Division Id...
Question 2:
Consider i have a division "ABC" and another division "ABCD" and if i execute the below query;
FIND div NO-LOCK WHERE div.custid = "X999"
AND div.id BEGINS "ABC" NO-ERROR.
IF AMBIGUOUS div THEN
DISP "YES".
ELSE
DISP "NO".
For the above query i was expecting "YES" as the answer but i got "NO". When i tried displaying the div table details i was able to get the details of div.id "ABC"...
Any suggestions? Thanks in advance!