Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: oracle 8.1 "expression must have same datatype as corresponding expression"
"tk72" <t_karlsson72_at_hotmail.com> a écrit dans le message de news: 1147222277.868852.218010_at_j33g2000cwa.googlegroups.com...
|I have been developing for Oracle 9i a bit, and there I can do a select
| like this:
|
| SELECT F1, F2, NumField
| FROM TBL1
|
| UNION
|
| SELECT F1, F2, NULL AS NumField
| FROM TBL2
|
| This query doesn't make much sense, but it illustrates my problem. As
| I said, it works in 9i, but in 8.1, I get the "expression must have
| same datatype as corresponding expression" error. NumField is a
| numeric field, and it can be any number, so I can't just make up a
| number for the field in the second part of the UNION. In queries where
| the "real" field is a string, the made up filed can be NULL. I hope
| this makes sense to someone. Any idea how I can accomplish this in
| Oracle 8i?
|
| Thanks in advance,
|
| TK
|
to_number(null)
Regards
Michel Cadot
Received on Wed May 10 2006 - 00:09:16 CDT
![]() |
![]() |