Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Column alias in a WHERE clause, not referenced in SELECT

User_ZUZ6NJul 1 2012 — edited Jul 2 2012
Hi,

A database I'm working with has relatively small field names, and I'd like to be able to alias the columns everywhere. In this specific situation, there query is something like


SELECT
Mem_Id
FROM
MEMBERS
WHERE
Mem_State = 'CA'


But in the WHERE clause, I'd like to be able to refer to Mem_State as MemberState or Member_State, even though the field is not referenced in the SELECT.

Is it possible, in Pl/Sql, to do something like a c++ #define, so that we can define all of the field names as something more descriptive, and then use the descriptive versions in the code?


Thanks & regards,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2012
Added on Jul 1 2012
4 comments
6,099 views