ehaerim schrieb am 09.06.2012 um 01:16 (-):
ii INTEGER Not Null;
si SMALLINT Not Null;
set width ii 4;
set width si 2;
select ii, si from test;
ii si
== ===
1001 1
ii and si displays 10 chars and 7 chars.
I want them to be 4 chars and 2 chars
thanks for the answer.
Set width works.
However it still does not work when alias is used.
For example,
long_field_name varchar(30);
Set width long_field_name 10;
select long_field_name from test; // = display 10 char
Set width long_field_name 10;
select long_field_name lfn from test; // =
On 08/06/12 10:29, ehaerim wrote:
Is it also possible the latter case print 10 chars only?
Yes:
Set width LFN 10;
select long_field_name LFN from test; // = display 30 char
Cheers,
Norm.
--
Norman Dunbar
Dunbar IT Consultants Ltd
Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
Sorry typo,
Set width LFN 10;
select long_field_name LFN from test; // = display 10 chars
Cheers,
Norm.
--
Norman Dunbar
Dunbar IT Consultants Ltd
Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL
Company Number: 05132767
thx it works again!
but when it comes to INTEGER or SMALLINT type, it won't work again.
for example,
ii INTEGER Not Null;
si SMALLINT Not Null;
set width ii 4;
set width si 2;
select ii, si from test;
ii si
== ===
1001 1
ii and si displays 10 chars and 7