
August 20th, 2003, 10:46 AM
|
|
Junior Member
|
|
Join Date: Aug 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
several ways to get fullname form Oracle database
We have a fairly straightforward normalized table in Oracle that contains a FirstName, LastName, and MiddleInitial in each record. One of the developers came to us and sugested we create a standard FullName field in the format "LN, FN MI.", so that they will not have to do a SELECT containing LastName || "," || FirstName || MiddleInitial || "." all the time. I can think of several ways to do this (see below), but wanted to know what other people have done.
1) I could put an additonal field in the database table called FullName and use an Oracle trigger to populate it automatically. I see the downside of this as redundent data in the database.
2) I could put a view on the table with a single field called FullName which does the concatenation. I thnk this might be messy becuase the user now has to look at both the view and the table to get all the fields.
3) I could put all the fields in a view with this new concatenated field. However, everytime the table changes, I have to go and modify the view also. I'm not sure the admin headache is worht this approach.
Once again, I'm looking for some advice as to what others have done in similiar situations.
Thanks,
Gerald Wright
|