How to create a user defined datatype for a column
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How to create a user defined datatype for a column

  1. #1
    Join Date
    Jun 2000
    Location
    Bethel CT, USA
    Posts
    18

    Smile

    How do I create a column to be user-defined datatype?

    restrictions:

    1. The existing applications Insert and Update statements cannot change their format

    2. I can alter existing table modify column to be new type...


    ????


  2. #2
    Join Date
    Jun 2000
    Posts
    417
    well, your first requirement really depends on how the existing application's insert statements were designed in the first place. for example, if your applications all have inserts like

    insert into table values (value1, value2, value3) -- the bad way

    as opposed to

    insert into table (col1, col2, col3) values (value1, value2, value3) -- the good way

    you won't be able to add a column without changing the inserts, and you won't be able to modify a column without changing the inserts unless the same inserts work with the modified column. Eg, changing a char to a varchar shouldn't affect any insert statements, where the contrary might, if some values were too large for the new char field.

    assuming the existing applications are coded correctly, you should just be able to add the column as needed (see oracle docs on user defined types at [url]http://oradoc.photo.net/ora81/DOC/server.815/a67781/c11ordb.htm[/url] ).

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