-
Force column width
Hi,
I need to copy data from tables.
I'm trying with this:
select cod_art as itemid, ;
alltrim(des_art) + " " + alltrim(des_art1) as itemname, ;
tipo_articolo as itemgroupid, ;
cod_umisu as bomunitid;
from articoli;
into cursor cur_articoli
des_art is C(50)
des_art1 is C(50)
on the target table, itemname is C(100)
on the cursor, itemname is C(19)... the lenght of the first des_art..
Can I force the lenght of the column?
thanks
Fabio
-
I guess
left(alltrim(des_art) + " " + alltrim(des_art1)+space(100),100) as itemname
would do the job.
-
-
thanks to all..
on the while I've foud also
select cast(cod_art as Char(20)) as itemid, ;
cast(rtrim(des_art) + " " + rtrim(des_art1) as char(60)) as itemname, ;
cast(tipo_articolo as char(10)) as itemgroupid, ;
cast(cod_umisu as char(10)) as bomunitid;
from articoli;
into cursor cur_articoli
-
but rpad() is better.
the cast function give strange data result.