Magnus Titho schrieb am 08.06.2012 um 08:24 (+0200):
> Am 08.06.2012 02:51, schrieb ehaerim:
> > SQL>  select substring(data_feed_name from 1 for 10) dfn from test;
> >
> [...]
> > I want the ============================= to be shortened to 15 so
> > that it looks like
> >
> > DFN
> > ===============
> > InvestWare

> Anyway, you could use cast to shorten the field. Note however, that
> the seperating line is always at least 6 characters long.

I think ehaerim is referring to the row separators in ISQL, not to any
data items. There's a special SET instruction for that:

SQL> help set;
…
SET WIDTH <col> [<n>]  -- set/unset print width to <n> for column <col>

SQL> set width abc 5;
SQL> select * from T; -- now column ABC displays with a width of five

This won't cast the data, but rather truncate it for display, including
the ============== row separator.

One thing to note is that the display width depends on the character set
chosen for the ISQL session. See below.

Michael
-- 

D:\temp :: isql eins
Database:  eins
SQL> show table kader;
NAME                            VARCHAR(12) CHARACTER SET UTF8 Not Null
SQL> select * from kader;

NAME
================================================
Müller
Özil
Höwedes
Götze
Schürrle
Gündogan

SQL> set width name 10;
SQL> select * from kader;

NAME
==========
Müller
Özil
Höwedes
Götze
Schürrle
Gündogan

SQL> quit;

D:\temp :: isql -ch win1252 eins
Database:  eins
SQL> select * from kader;

NAME
============
Müller
Özil
Höwedes
Götze
Schürrle
Gündogan

SQL>

Reply via email to