Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Looks like Magic
I was loading a table from a database with VARCHAR(3) Type Code and VARCHAR(50) Type Description only, there were several codes, for example: 001, 002, 032, C01, G44, R32, 055;
I noticed that while loading some codes they disappeared and others got duplicated, take the test below and draw your own conclusions.
Make the Script:
Table:
LOAD * Inline [
ID , TEXTO
'032','TEXTO 32'
'A32','TEXTO A'
'C32','TEXTO C'
'H32','TEXTO H'
'M32','TEXTO M'
'R32','TEXTO R'
'S32','TEXTO S'
];
After loading note that Code R32 turns to 032, leaving my code duplicated.
If code R32 was before 032, it would turn into R32.
From the Data Model Viewer we can see that it changed at the time of loading.
This occurs if the code is already loaded, in my example '032'.
The only help item I found was this one, just because it's just the letter "R":
Correcting:
To prevent this from happening use the TEXT Function:
Table:
LOAD
text(ID) as ID,
text(TEXTO) as TEXTO
Inline [
ID , TEXTO
'032','TEXTO 32'
'A32','TEXTO A'
'C32','TEXTO C'
'H32','TEXTO H'
'M32','TEXTO M'
'R32','TEXTO R'
'S32','TEXTO S'
];
Viewing:
I wonder if anyone came across this as it took me a few hours to sort it out?
Thanks