Results 1 to 10 of 10
  1. #1
    Join Date
    May 2008
    Posts
    2

    Unanswered: New to Oracle. Column Headings question.

    Hi, great to have found such a great site.


    I'm trying to find out how to specify column headings that differ from the attributes names when displaying query results.

    I have a couple SQL books here, and neither of them mention how this is done.

    If anyone can tell me how you go about this, I'd be extremely grateful.

    Many thanks to all!

    Great to be here.

    Swerve

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Any specific answer might depend upon Operating System name &
    version, Oracle version, and the specific Oracle client software you are (ab)using;
    but you neglected to provide any useful details of your environment.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    May 2008
    Posts
    2
    Oh really, didn't think that would make a difference..
    sorry about that.

    The OS is windows XP SP2. Oracle version is 10g Express Edition.

    Client? I'm using the SQL Command line.

    Many thanks

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    http://www.dbforums.com/showthread.php?t=1031644

    >Client? I'm using the SQL Command line.
    I'll interpret the response above to be "sqlplus" or similar variant.


    Code:
    SQL> SELECT SYSDATE AS NOW FROM DUAL;
    
    NOW
    ---------
    04-MAY-08
    
    SQL> SELECT SYSDATE FROM DUAL;
    
    SYSDATE
    ---------
    04-MAY-08
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by Swerve
    I'm trying to find out how to specify column headings that differ from the attributes names when displaying query results.
    Code:
    SELECT column1 as firstname, column2 as lastname
    FROM mytable

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Shammat, why do you give your columns such a meaningless names as "column1" and "column2" instead of "firstname" and "lastname" so that you wouldn't have to worry about it later?


  7. #7
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    I knew this was coming when I hit "Submit" ...

  8. #8
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Also you could use the column command in SQLPLUS only. See the following link for information.

    http://download.oracle.com/docs/cd/B...htm#sthref1131
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  9. #9
    Join Date
    Apr 2008
    Posts
    28
    We all hope that names are for academic purposes... or are you trying to duplicate SAP naming schema?

    (I know their tables are codified in german, but surely they did that way to hide content and relationships to non-initiated)

  10. #10
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by OracleDisected
    I know their tables are codified in german, but surely they did that way to hide content and relationships to non-initiated
    I have heard the rumour that they have a database "obfuscator".
    During development (and for their internal systems) they are using proper names. When building a release the DB object names are obfuscated (table1, table2, column1, ...) to make reverse engineering harder.
    Don't know if that is true though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •