Given this extract of code from a CREATE VIEW
The first column, char('SAP107', 10), is returning a VARCHAR.
I thought CHAR returned a fixed length character.
CAST does the same thing.
Is there something I'm missing?
How do I get that first column to be CHAR(10) and not VARCHAR(10)?
(Same with char('REV',3), it's returning VARCHAR too).
Code:
...as select char('SAP107', 10), char(CBGRP, 16), CBCUST,CBYEAR,CBPERC,CBPERN,CBOI,CBTID,CBREG,CBSLSM, char('REV',3), dec(CBREV,13,2) from SAP107 union select 'SAP107',CBGRP,...
The first column, char('SAP107', 10), is returning a VARCHAR.
I thought CHAR returned a fixed length character.
CAST does the same thing.
Is there something I'm missing?
How do I get that first column to be CHAR(10) and not VARCHAR(10)?
(Same with char('REV',3), it's returning VARCHAR too).
Comment