Is it feasible to make Oracle decides and thinks !!
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Is it feasible to make Oracle decides and thinks !!

  1. #1
    Join Date
    Nov 2000
    Posts
    416

    Wink

    I guess this is an interesting question came to my mind:

    Assume that we have a big table of all emplyees, let's say one million record and we actually forgot to implace the gender field in the table. Now we alter the table and do:

    SQL> alter table employee
    add (gender VARCHAR2(1) NOT NULL);

    but the puzzle is I need oracle somehow start thinking and go throught all 1 million records and find out if the employee is man or women ( depends on their first name ) and populate this new feild with M or W.

    How it can be a reality and implemented?


    An ounce of prevention is worth a pound of cure

  2. #2
    Join Date
    Feb 2001
    Posts
    163
    , I will wait for chrisrlong and sambavan to handle this question.

    uday

  3. #3
    Join Date
    Mar 2001
    Posts
    635
    Hi

    If you really want to implement a mistake which was on the whole the fault of the designing team who designed the schema and maybe some extent on the part of the developers who did not get to understand the user's requirment it is tremondous effort you are aking on the part of oracle to do

    It is not easy to change the design of the schema after 1 million records have been added.

    Allthough if you change the design I dont know any such option as to make oracle make a guess work of the gender depdening on the first name taking into consideration the Global naming convention used to Name a person thru the whole World.

    Regards
    Santosh

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    update employee set gender='W';

    (At least 1/2 the records will be correct )
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  5. #5
    Join Date
    May 2001
    Posts
    3

    another source?

    Don't you have that information in another system? Maybe the old system they use to use and you can update hopefully most of the info.

    Otherwise, code some name recognition system (NRS :-) ) that uses some AI and makes a decision base on firstname/lastname :-)

    --nick

  6. #6
    Join Date
    Nov 2000
    Posts
    416
    Wow, Are you serious? Do we have such thing as " Global naming convention used to Name a person thru the whole World. " ?? where is it ? Where can I dind something like AI agent to handle this schema designers terrible job.

    An ounce of prevention is worth a pound of cure

  7. #7
    Join Date
    Mar 2000
    Location
    Kanab, Utah, 84741
    Posts
    10
    Direct Mail houses (for example, MetroMail) use software that will make a guess as to a person's gender.

    Cliff

  8. #8
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    There you go the answer had already been provided. Use the softwares of that order or you could contact some datacenter who would be willing to work with you, then you can provide the name list to them and then they might be able to get you a possible gender matches to those names. But this would be more close and predictable, but wouldn't full fill all the genders. One of the other best sorce would be any library/university database to do the possible matches.

    Would look more into this concept.


    Waww!!!

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  9. #9
    Join Date
    Mar 2000
    Location
    Chennai.Tamilnadu.India.
    Posts
    658

    Investigation

    Hi, 25th May 2001 20:08 hrs chennai

    http://www.oracle.com/oramag/oracle/...ml?o60sql.html

    Try Using dynamic SQL you can try to build a Package which can alter a table have a decode function for the column based on which you have to insert M or F.I dont know whether alter table command an be included in Dynamic SQL too check it.

    There can be other turn arounds other than what i have put above but the way you tell to work on its own intelligently based on first name no chance to update.It can do based on substitute condition.

    Cheers

    Padmam
    Attitude:Attack every problem with enthusiasam ...as if your survival depends upon it

  10. #10
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    SQL> alter table employee
    add (gender VARCHAR2(1) NOT NULL);

    wont work if you have 1 million records in the table anyway

Posting Permissions

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


Click Here to Expand Forum to Full Width