From: Traci Sumpter <Traci.Sumpter@opus.co.nz>
To: pgsql-sql@postgresql.org
Subject: Defining Field Types with view
Date: Thu, 2 Sep 2004 08:27:14 +1200
Message-ID: <KFEJJKOAGCCGEJFLKCBBKEKPECAA.Traci.Sumpter@opus.co.nz> (raw)
Cheesy one here....
I created a view similar to
Select field1, field2 from table
where field3 = 'Fred'
UNION
Select field1, field2 from table
where field3 = 'Wilma';
When the view contains just one sql statement the field definitions e.g.
charater varying (20) however when both are in the fields turn into
character varying (no size).
this is causing a problem when referring to the fields within Dephi/VB
because they think the varchar fields are memo.
I have got around it by creating another view which selects
field1::varchar(100) , field2 varchar(50) from firstview.
I have tried casting the fields within the first view but to no sucess.
Any way to get over this???
Cheers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: Traci.Sumpter@opus.co.nz
Subject: Re: Defining Field Types with view
In-Reply-To: <KFEJJKOAGCCGEJFLKCBBKEKPECAA.Traci.Sumpter@opus.co.nz>
References: <KFEJJKOAGCCGEJFLKCBBKEKPECAA.Traci.Sumpter@opus.co.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox