Re: To force type CHAR in a view

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 07 Oct 2002 16:30:23 GMT
Message-ID: <3DA1B4A2.FF91C5B5_at_exesolutions.com>


cf wrote:

> (excuse me, my inglish is not very good)
>
> When i create the view V1 I will want to create a column NEW_COL1 CHAR(10)
> and not VARCHAR2(10)
>
> Because I have a utility which at the time of the joint of the view V1 and a
> table with a column in char(10),
> detects the difference in type.
>
> SQL> create table t1 (col1 varchar2(8));
>
> SQL> desc t1
> Name Type
> ---------------------- -----------------
> COL1 VARCHAR2(8)
>
> SQL> CREATE OR REPLACE VIEW V1 AS
> select col1,
> rpad(col1,10,' ') new_col1
> from t1
> /
>
> SQL> desc v1
> Name Type
> --------------------- -----------------
> COL1 VARCHAR2(8)
> NEW_COL1 VARCHAR2(10)
>
> I will want to create a column NEW_COL1 ==> CHAR(10)
>
> Thanks in Advance..
> With My Best Regards...
> Christophe

Try this:

CREATE VIEW vtest AS
SELECT dummy, ' ' X
FROM dual;

But I can't imagine a tool that could possibly know, or care.

Daniel Morgan Received on Mon Oct 07 2002 - 18:30:23 CEST

Original text of this message