I haven't worked with views before, but I have successfully created a view
which looks at a subset of fields in a subset of rows in a table according
to a criteria.
My current view creation would be something like this:
CREATE VIEW view1 (f1, f2, f3, f4)
AS SELECT f1, f2, f3, f5
FROM tab1 WHERE etc etc;
Two of the fields I select for the view fields are both varchar(64,0), I
now want, instead of these two fields, to have one field in the view which
shows up values which are derived by concatonating these two fields in the
table and some other text.
example desired record in table and in view:
tab1
f1 "TheDirectory"
f2 "Word.doc"
f3 1234
f4 ...
f5 5678
f6 ...
view1
f1 "TheDirectory/Word.doc"
f2 1234
f3 5678
Hope this makes sense.
Is this possible and can any one advise how it can be achieved?
Many thanks, in anticipation,
Andrew Hardy.
sending to informix-list
Christian Knappke - 24 Feb 2005 13:17 GMT
From the keyboard of "Andrew Hardy" <Andrew.Hardy@marconi.com>:
> example desired record in table and in view:
>
[quoted text clipped - 14 lines]
>
> Is this possible and can any one advise how it can be achieved?
create view view1 (f1, f2, f3) as select f1 || '/' || f2, f3, f5
from tab1;
HTH
Christian

Signature
#include <std_disclaimer.h>
/* The opinions stated above are my own and not
necessarily those of my employer. */