NAV 5 blank is not equal to NAV 6 blank???

beno.pulver
Member Posts: 31
Hi friends,
I detected following code in our vertical solution (look at the ' '):
CAG := "Customer Status" + "Address Class";
CASE CAG OF
'KA': ...
'KA': ...
' ': ... <<<===
ELSE ...
END;
This works perfectly with a NAV 5 Client (native database).
But if you upgrade the NAV 5 database to NAV 6 and do the same thing with a NAV 6 Client, then the result differs.
The ' ' (two blanks between the appostrophs) must be changed to '' (no blanks between the appostrophs):
CAG := "Customer Status" + "Address Class";
CASE CAG OF
'KA': ...
'KA': ...
'': ... <<<===
ELSE ...
END;
Otherwise a blank value will not be identified by the case and will go to the ELSE Statement.
Do you know the reason for that? Is NAV 6 checking a blank as SQL NULL value and a ' ' as an empty value???
For me it is strange, especially because it is a native database!
Thank you for your Information, Beno
I detected following code in our vertical solution (look at the ' '):
CAG := "Customer Status" + "Address Class";
CASE CAG OF
'KA': ...
'KA': ...
' ': ... <<<===
ELSE ...
END;
This works perfectly with a NAV 5 Client (native database).
But if you upgrade the NAV 5 database to NAV 6 and do the same thing with a NAV 6 Client, then the result differs.
The ' ' (two blanks between the appostrophs) must be changed to '' (no blanks between the appostrophs):
CAG := "Customer Status" + "Address Class";
CASE CAG OF
'KA': ...
'KA': ...
'': ... <<<===
ELSE ...
END;
Otherwise a blank value will not be identified by the case and will go to the ELSE Statement.
Do you know the reason for that? Is NAV 6 checking a blank as SQL NULL value and a ' ' as an empty value???
For me it is strange, especially because it is a native database!
Thank you for your Information, Beno
0
Answers
-
are all variables of type code or some are code and some text?0
-
the case statement in nav 6 is CASE sensitive, in nav 5 it was not case sensitive0
-
-
change the case statement to uppercase
CASE UPPERCASE(CAG) OF
0 -
Hi again Rashed,
thank you for the advice. But... UPPERCASE would only help, if it would be a textfield.
I would be astonished, if that would help in my case with blanks!?!
In my case it is a code field and contains values like 'AA', 'BB', 'CC' and as well blank.
The Problem is/was, that an empty field was compared with two blanks.
So instead of comparing it with "" it was compared with " " (two spaces in between).
NAV 2009 seems to make a difference between a compare with "" or a compayre with " ".
NAV 5.0 doesn't make a difference.
Best regards, Beno0 -
ok change the case to the following
CASE DELCHR(UPPERCASE(CAG),'<>',' ') OF
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions