Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Informix Topics / February 2005

Tip: Looking for answers? Try searching our database.

Creating Views

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Hardy - 24 Feb 2005 11:06 GMT
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. */

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.