Thread: Oracle SQL

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    3
    Rep Power
    0

    Post Oracle SQL


    Hi
    can someone help me with this ,,,,,

    I have a table customer with the following fields

    customerID
    custCat
    etc,,

    customerID is of the form Cxxxx, xxxx is numbers 0001-9999
    custCat is string of three letters which specifies the type of customer..like spl(special), ord(ordinary) etc...

    I would like to know if there is any way, I can get a combination of customerID and custCat as customerId when user makes a 'SELECT query.
    I mean when user selects some records, he should see customerID as splC0001 or 'ordC8398' etc...even though customerID on database is Cxxxx....s

    Please suggest any other solutions for this situation
    thanks,
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,777
    Rep Power
    348
    SELECT custCat||customerID
    FROM ...
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    3
    Rep Power
    0
    U didn't understand my question.
    I want to set up on database side such that whenever user queries as
    select customerID etc...
    it should fetch me
    select custCat||customerID etc..


    I hope now it is clear...sorry for confusion
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,777
    Rep Power
    348
    CREATE VIEW user_view
    AS
    SELECT custCat||customerID, ...
    FROM ...

    Then give the user only access to the view
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    3
    Rep Power
    0
    I do not have just one query and more over I lready have an application that is using the select cust||custCat etc type queries...which I do not want to change..so im tryin other solutions...

    please let me know if I am not clear.

Similar Threads

  1. Poor SQL Server Programming, Part 4
    By DavidM in forum MS SQL Development
    Replies: 0
    Last Post: October 21st, 2003, 10:28 PM
  2. SQL statement parsing problem with Oracle
    By bingbing in forum ASP Programming
    Replies: 1
    Last Post: July 27th, 2003, 03:00 PM
  3. Replies: 1
    Last Post: July 10th, 2003, 11:11 AM
  4. Oracle SQL
    By Benahimvp in forum Database Management
    Replies: 7
    Last Post: July 10th, 2002, 07:36 PM
  5. Want to convert Oracle SQL to MySql SQL
    By kurian in forum Database Management
    Replies: 4
    Last Post: April 24th, 2002, 09:39 PM

IMN logo majestic logo threadwatch logo seochat tools logo