Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Repost: Setting view column datatype
Brian Dick wrote:
> Doesn't work. But thanks anyways. Here is the example from my original post
> again. Notice that the column datatype of the view is NUMBER when it should
> be NUMBER(5).
>
> ORA> create or replace view foo
> 2 as
> 3 select cast(1 * rownum as number(5)) an_expression
> 4 from dual
>
> View created.
>
> ORA> desc foo
> Name Null? Type
> ----------------------------- -------- --------------------
> AN_EXPRESSION NUMBER
>
I think this may be generic to the NUMBER data type and views:
CREATE OR REPLACE VIEW foo AS
SELECT CAST(1 * rownum as VARCHAR2(5)) an_expression
FROM dual;
QL> desc foo
Name Null? Type ----------------------------------------- -------- ----------- AN_EXPRESSION VARCHAR2(5)
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Fri Feb 06 2004 - 01:04:14 CST