PDA

View Full Version : Oracle question



Wibs
6th November 2002, 23:36
I've been given the job of creating a table in Oracle (I believe the version is 9.2, but can't say for sure), but I'm from an AS400 background and haven't used Oracle before, so have got myself a little bit stuck on something....

I created the table fine, but my colleagues would like each column to have two different names....
For instance, column named M_COID they would also like to be able to use CORRELATIONID as another name. I know that I can do this in a Select using AS, but how about when updating or inserting?

This is for an app that's getting ported from the AS400 where we are currently able to do this without any probs, but I just can't figure it for Oracle.

Any suggestions would be most welcome.

PerlOfWisdom
7th November 2002, 17:21
Something like this will work. Make sure you include all the fields from the base table in the view if you want to update the table.

create view viewname (M_COID, CORRELATIONID) as
select M_COID, M_COID
from tablename

Wibs
7th November 2002, 17:31
Thanks, I'll give it a go