Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: View with different datatype ?
In article <36caec41.6306858_at_news2.mm.com>,
johng_at_nospam.mm.com wrote:
> I would like to create 2 views and then create a view based on a union of
those
> views...The problem I am facing is that the dataypes ( actually the size part,
> one table has a field defined as number(38) the comparable field in the other
> table is number(3)) of the underlying tables differ ; is there a way to
create a
> view that does not use the underlying datatype ( or create with a datatype
> parameter ) ?
>
> Thanks for any info....
>
> Email to john.greco_at_dot.state.mn.us
> or post here; I check it daily....
>
> John Greco
> MnDOT Human Resource Office
>
> To reply please remove the 'nospam' part of the address
>
given: string VARCHAR(38) in table A
value number(3) in table B
try:
SELECT string FROM A
union
SELECT TO_CHAR(value,'nnnn') FROM B;
I'm far from my ORACLE, so chect the format string ('nnnn') in the conversion function, but that's basically it. You just need them both in a compatible form, so at least one of them has to change. Remember, behind DECODE() the conversion functions are about the most powerful in Oracle.
Ed Prochak
Magic Interface, Ltd.
ORACLE services
440-498-3702
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Feb 19 1999 - 13:45:15 CST
![]() |
![]() |