Best way of recreating type

Hi,
I have an object table. The table contains data. I need to alter an object type the table is based on. I could'nt simple recreate the object with CREATE OR REPLACE because the table is dependent on it. What do you suggest?
I need the data in the table to be safety, of course.
Thanks in advance...
JackK

JackK wrote:
I have an object table. The table contains data. I need to alter an object type the table is based on. I could'nt simple recreate the object with CREATE OR REPLACE because the table is dependent on it. What do you suggest?
I need the data in the table to be safety, of course.The simple answer is to alter the type and cascade the change to dependent objects. But it is not always that straight forward when dealing with complex class hierarchies.
The basic approach is demonstrated below:
SQL> create or replace type TFoo as object(
  2          id      number,
  3          name    varchar2(30)
  4  );
  5  /
Type created.
SQL>
SQL> create table testtab of TFoo(
  2          id primary key,
  3          name not null
  4  ) organization index;
Table created.
SQL>
SQL> insert into testtab select rownum, object_name from user_objects;
139 rows created.
SQL> commit;
Commit complete.
SQL>
SQL> select * from testtab where rownum < 6;
        ID NAME
         1 PK_PARTC_CUST_ID
         2 IDX1_CHILD_CUST_CODE
         3 IDX1_INC_EX
         4 INDX_CHILD_CUST_ID_001
         5 INDX_INC_ID_001
SQL> --// changing the type and cascading the change to the table
SQL> alter type TFoo add attribute(
  2          create_date     date
  3  ) cascade;
Type altered.
SQL>
SQL> select * from testtab where rownum < 6;
        ID NAME                           CREATE_DATE
         1 PK_PARTC_CUST_ID
         2 IDX1_CHILD_CUST_CODE
         3 IDX1_INC_EX
         4 INDX_CHILD_CUST_ID_001
         5 INDX_INC_ID_001

Similar Messages

  • Best way to recreate all live assets in SAP and scrap current assets

    We have a situation where we have to recreate all  (15000) our assets as new assets. We will have to create new assets, provide new acquisition value and new useful life and start depreciating them from scratch. Also we will have to dispose all the current assets.
    What is the best way to accomplish this:-
    1)     I was thinking to write a BDC program for AS01 transaction to create new assets and in the text field, give a reference to old assets. 
    For Balances transfer, use transaction FB01 or F-91.
    *2)     Use BDC to map transaction AS91 and add in value there.  Although this is not transferring from legacy data but only in SAP. Will these current assets be considered as legacy data.   Is this transaction feasible to use.* 
    Also, what transaction can I use for mass asset data scrapping of current assets
    Thanks,
    Tanya
    Edited by: Tanya321 on Jul 6, 2009 7:33 PM

    Tanya,
    You can do a mass retirement of assets. Please check out this link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/4f/71ece8448011d189f00000e81ddfac/content.htm
    For mass creation of assets you can use the LSMW tool.
    Regards,

  • Best way to warp type around a cylinder

    I need to warp type around a bottle to it curves up on the left and right and also condenses slightly at the edges (as it visually does).
    Using the mesh function not only doesn't squeeze the type correctly I can't grab more than one bezier handle at a type so it is very inefficient and difficult.
    Does anyone have a much better idea?
    Illusttrator has slightly better tools but not great.
    Thanks
    alan

    The problem I think if I understand the OP correctly is that they have an illustration bottle and it is not a 3D object of any kind so the best way is to do this is probably still in this case Illustrator, however saying this i have not tried this trick in Photoshop as a 3D object.
    Well actually you can take a text line and turn it into a 3d object by itself without any without any background and much more easily manilpulate it over and existing drawing.

  • Best way to recreate iPhone album in iPhoto?

    My wife's 4S (running IOS6) has about 500 photos in the camera roll. These have over time been synced to iPhoto but she kept them on her phone also. We'd like to organize them in an iPhoto album so it can be managed from the Mac and get them out of her camera roll.
    I selected them all and made an album on the phone, but I don't think that helps. My understanding is that I cannot sync this album structure out of the phone. What's my best recourse here, short of manually selecting all of the same photos in iPhoto? I suppose I could re-import them all, make an album out the 'last import' album, and then erase the duplicates but I'd have to erase the originals which would then take them out of other albums that they are in. Maybe re-import, find duplicates, select the earlier ones into album, then erase the later ones? Sounds a bit scary. Both are somewhat a pain since there is no 'find duplicates' feature in iPhoto; I'd have to do it manually or with some add-on software.

    @GregF-ATL
    Couldn't disagree more with the FM transmitter being the best option. Used to have a car without a cassette player and went through every variation of FM transmitter to get my ipod to play through the car speakers. Took MANY a road trip and a) the sound quality isn't as good as with the cassette adapter and b) when driving, you constantly have to try to find empty bandwidth on the transmitter. In LA, forget about it; there's NOTHING you can tune it to. Originally, I used it on the East Coast, and it was difficult there as well. In the Midwest, it was just ok. In the UK, I don't know.
    But, there is a variation of quality among the cassette adapters as well, albeit even the worst ones sounding better than the best FM transmitter. I've gone through quite a few of them as well, and have found the Sony adapter to work the best for me. The Belkin is supposedly pretty good too, but it doesn't play in all decks.
    Incidentally, for both the FM transmitter and the tape adapter, make sure you're iphone volume is in the correct place -- not full volume.
    Having said that, I went out and bought a DICE system ($150) which was very easy to install (you wire it with your cd player and power source) which charges my iphone and plays my music at whatever quality I encoded it to. And I don't have to fuss with my volume control on the ipod/iphone itself. THIS is the best option for those who don't have the aux jack, but it doesn't meet your expense criterion.

  • /boot Partition was Deleted! What is the best way to recreate?

    My /boot Partition was somehow deleted.
    How can I recreate it?
    I've been trying to boot from a LiveCD then un-archive the Grub and Kernel26 pkgs from a flash drive.
    Then run:
    mkinitcpio -c /mnt/sda3/etc/mkinitcpio.conf -k 2.6.31-ARCH -b /mnt/sda3/ -g /mnt/sda3/boot/kernel26.img
    Everything seems to work except it fails to detect /dev/sda3.
    Error Log:
    :: Loding udev.../init: 11: /sbin/udevd: not found
    /init: 11: /sbin/udevadm: not found
    /init: 11: /sbin/udevadm: not found
    Waiting 10 seconds for device /dev/sda3 ...
    Root device '/dev/sda3' doesn't exist, attempting to create it
    ERROR: Failed to parse block device ids for '/dev/sda3'
    ERROR: Unable to detect or create root device '/dev/sda3'
    You are being dropped to a recovery shell
    And no /dev/* devices show up, except for console, mem, null, and zero.

    Hello o/
    1) Boot on your live CD
    2) Launch fdisk on your boot disk and create a new partition
    3) mkfs.ext3 your new partition
    mkfs.ext3 /dev/your_boot_partition
    4) mount your / partition and /boot
    mkdir /mnt/my_system
    mount /dev/your_system_partition /mnt/my_system
    mount /dev/your_boot_partition /mnt/my_system/boot
    5) Chroot into your system :
    chroot /mnt/my_system /bin/bash
    6) Install grub and kernel26
    pacman -S grub kernel26
    7) Edit your /mnt/my_system/boot/menu.lst to reflect the change
    8) Exit your chroot and umount yours partitions and reboot
    Sorry for my english

  • What is the best way to drop and recreate a Primary Key in the Replication Table?

    I have a requirement to drop and recreate a primary key in a table which is part of Transaction replication. What is the best way to fo it other than remove it from replication and add again?
    Thanks
    Swapna

    Hi Swapna,
    Unfortunately you cannot drop columns used in a primary key from articles in transactional replication.  This is covered in
    Make Schema Changes on Publication Databases:
    You cannot drop columns used in a primary key from articles in transactional publications, because they are used by replication.
    You will need to drop the article from the publication, drop and recreate the primary key, and add the article back into the publication.
    To avoid having to send a snapshot down to the subscriber(s), you could specify the option 'replication support only' for the subscription.  This would require the primary key be modified at the subscriber as well prior to adding the article back in
    and should be done during a maintenance window when no activity is occurring on the published tables.
    I suggest testing this out in your test environment first, prior to deploying to production.
    Brandon Williams (blog |
    linkedin)

  • What is the best way of insertion using structured or binary type in oracle

    what is the best way of insertion using structured or binary type in oracle xml db 11g database

    SQL*Loader.

  • What is the best way to produce different report types out of the same SSRS Report

    So I have a request to produce different report types based on a "Line Of Business" Parameter that is provided. I know that SSRS sometimes struggles with gathering the Metadata based on IF Statements.
    What is the best way to provide multiple different report types with different data based on the "Line Of Business" Parameter that is provided? Can I simply do this via the SQL Stored Procedure? And how so that the Metadata is collected correctly?
    Just don't know what the generally accepted business principle is on this and how to go about doing it.
    Thanks in advance for your review and am hopeful for a reply.

    Hi ITBobbyP,
    Per my understanding that you have create an parameter (Line Of Businiess) to get diffetent types of report, I would like to confirm with you want do you mean about the different report types?
    Is that mean you have table and one column named Report type, you want to filtered on this column? Or the report type you mean is like Parameterized reports,Linked reports,Snapshot reports,Subreports and so on.
    If want you want is through the selection of the parameter to change the report type(Parameterized reports,Linked reports,Snapshot reports,Subreports ..),currently it is impossible to acheive this.
    If you still have any problem, please try to provide more details information about your reqirements, the sampe data in the table, the report structure you have designed and so on.
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Best way to do a Object which holds a collection of another object type.

    I'm writing a caching object to store another object. The cache is only valid for a session, so I want a store the data in a nested table.
    I have try to simplify my example down to its core.
    How do I make this work and what is the best to index the index the items stored for fastest retrieval.
    CREATE OR REPLACE TYPE ty_item AS OBJECT (
    id_object VARCHAR2 (18),
    ORDER MEMBER FUNCTION compare (other ty_item)
    RETURN INTEGER
    CREATE OR REPLACE TYPE BODY ty_item
    AS
    ORDER MEMBER FUNCTION compare (other ty_item)
    RETURN INTEGER
    IS
    BEGIN
    IF SELF.id_object < other.id_object
    THEN
    RETURN -1;
    ELSIF SELF.id_object > other.id_object
    THEN
    RETURN 1;
    ELSE
    RETURN 0;
    END IF;
    END;
    END;
    CREATE OR REPLACE TYPE ty_item_store AS TABLE OF ty_item;
    CREATE OR REPLACE TYPE ty_item_holder AS OBJECT (
    CACHE ty_item_store,
    MEMBER FUNCTION get (p_id_object IN VARCHAR2)
    RETURN REF ty_item,
    MEMBER FUNCTION find (p_id_object IN VARCHAR2)
    RETURN REF ty_item,
    MEMBER FUNCTION ADD (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    CREATE OR REPLACE TYPE BODY ty_item_holder
    AS
    MEMBER FUNCTION get (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    IS
    rtn REF ty_item;
    BEGIN
    rtn := find (p_id_object);
    IF rtn IS NULL
    THEN
    rtn := ADD (p_id_object);
    END IF;
    RETURN rtn;
    END;
    MEMBER FUNCTION find (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    IS
    rtn ty_item;
    BEGIN
    SELECT VALUE (ch)
    INTO rtn
    FROM CACHE ch
    WHERE ch.id_object = p_id_object;
    RETURN rtn;
    END;
    MEMBER FUNCTION ADD (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    IS
    item ty_item;
    BEGIN
    item := ty_item (p_id_object);
    INSERT INTO CACHE
    VALUES (item);
    END;
    END;
    /

    Best way to do a Object which holds a collection of another object type. The best place for data in a database is.. no real surprise.. in tables. If that data is temporary of nature, global temporary tables cater for that.
    Storing/caching data using PL/SQL requires very expensive private process memory (PGA) from the server. This does not scale.
    I'm writing a caching object to store another object. Irrespective of how l33t your haxor skillz are, you will not be able to code as a sophisticated, performant and scalable PL/SQL data cache, as what already exists (as the database buffer cache) in Oracle.
    The cache is only valid for a session, so I want a store the data in a nested table.Not sure how you take one (session local data) to mean the other (oh, let's use a nested table).
    Session local data can be done using PL/SQL static variables. Can be done using name-value pairs residing in a context (Oracle namespace). Can be done using a global temporary table.
    The choice is dependent on the requirements that need to be addressed. However, the term +"caching+" has very specific connotations that say that a global temporary table is likely the best suited candidate.

  • Best way to link queue type to data typdef

    I am using "Obtain Queue" to create a multiple queues from multiple TypeDef formated data clusters. I want to then put these queue references in a cluster of their own so I can refer to them where necessary in my code. When I modify the data types by editing the corresponding typdefs I would like for the queue references to change accordingly. In other words I think I need to link the queue references to the data typedefs.  What is the best way to do this?
    For instance, If I create a cluster of queue rerences using bundle by name I would have to create an input cluster with a format that would update as I change my origianl data typedefs. Can this be done, and if so how?
    Possibly the "problem" is due to my dsire  to have a nice "bundle by name" cluster for clarity in my code. I suppose if I used an array this isn't a problem. That is not as elegant a solutions, but I guess elegance is sometimes in the eye of the beholder.
    Any suggestions?
    Solved!
    Go to Solution.

    Did you replace any constants that you had on the block diagram with the typedefed version? All instances that you ar eusing need to use the typedef.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Best way to load old historical records into sc2 type 2 dimesnion

    Hi,
    We have scd type 2 diemsnion and have history dating form early 2012 in there but wish to add extra older historical episodes of recoprds for 2011 into it.
    What is the best way to do this?
    Thoughts?
    Considering some pl/sql but 5 levels in the dimesnion.
    Can't reload as need existing records due to integirty with facts.
    Thnaks

    Are you using OWB's dimension operator and it's SCD functionality?
    Cheers
    David

  • CF9 - best way to restrict file type for uploads??

    Hello, everyone.
    We're using CF9 in both dev and production environments, with little chance of upgrading to CF10 anytime in the near future (it's my understanding CF10 does have a way of detecting a file mimetype that CF9 doesn't have.)
    What is the best way to restrict uploads to specific file types in CF9?  We just need to limit uploads to primary Office (doc(x), ppt(x), xls(x), etc.), PDFs, and gif/jpg (no bmps, pngs, etc.)
    Obviously, just detecting file extension is fruitless.
    Thank you,
    ^_^

    What about just using the accept attribute? That's what it's there for. Just something like:
    <cffile
    action="upload"
    filefield="fileContent"
    accept="application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, image/gif, application/pdf"
    etc.

  • Best way to edit in audio first for a news story type edit

    Whats the best way to do a news story type edit?
    I want to lay down audio narration ( voiceover track ). Next I want to add picture. I want to have some flexibility to edit and move around parts of the voiceover track. I will also want to be able to move the video clips around. What's the best way to do this?
    Which method would you use? All ideas are welcome.
    So far I hear:
    1. Edit in a text track ( as a placeholder ) the length of the proposed narration
    2. Add audio ( narration)
    3. Add video clips
    Additional questions:
    A) When I add video clips, should I do cutaways? Which offers the greatest flexibility?
    B) If I do use cutaways will I eventually be able to delete the original placeholder text track?
    Thanks everyone. I'm trying to get a handle on iMovie. Your responses are helpful.
    -CraigarJ

    I think I answered in your other thread.

  • Theory - Best way to store this type of data for retrieval?

    Hi everyone,
    So I'm pretty new to databases and I'm trying to figure out an efficient way to retrieve this kind of data:
    an ID that is 36 digits long
    col1 = {option1, option2, option3...}
    col2 = {option1, option2, option3...}
    coln = {option1, option2, option3...}
    I need to be able to perform queries on the data based on some concatenation of 3 digit sequences for the ID
    for example, I may want to retrieve all the records where the ID begins with '123' or where the ID begins with '123123', or '123123200', etc,
    There are going to be close to a billion if not more of these records
    the 3 digit sequences will always be a number between 000-255
    It is not necessary for me to have a 36 digit long ID, I simply chose that because it seemed like the simplest way to associate a record with its combination of 3 digit sequences.
    Like I said, I'm very new to databases. I've been doing a lot of reading on indexing and clustering and nested tables and partitions, but I'm not quite sure which of these I should pursue with this kind of data. Most of the examples that I've read about don't really deal about querying with variable precision.
    Would the best way to get this data simply be to use an 'is like' statement on the ID? If so, are there any kinds of indexing I should take a look at that would benefit from knowing that the is like statements would follow the format of <3 digits,3 digits,3 digits>? Also, at the data level, would it be more efficient to use hexadecimal to store the sequences of 3 digits since they conviently fall in the range of 00-FF? I'm just throwing ideas out there, I haven't found much help browsing the web, but maybe I haven't looked in the right place. If anyone has any ideas or places to redirect me, it would be great!
    Also, I know sometimes it helps to know the main kind of queries on the data that someone is primarily concerned about. In this case, most queries will be selective counts, for example finding the number of records whose ID's begin with '123006011' and col1='option1'.
    Thanks,
    Alex
    Edited by: user9022475 on Jun 23, 2010 9:37 AM

    So I'm starting to rewrite my code. I was shocked at how easy it was to implement the SAX parser, but it works great. Now I'm on to doing away with my nasty string arrays.
    Of course, the basic layout of the XML is like this:
    <result1>
    <element1>value</element1>
    <element2>value</element2>
    </result1>
    <result2>
    I thought about storing each element/value in a HashMap for each result. This works great for a single result. But what if I have 1000 results? Do I store 1000 HashMaps in an ArrayList (if that's even possible)? Is there a way to define an array of HashMaps?

  • Hi just want to know where is the best way to type the statement?

    just to ask you what is the best way to write the statement please

    Could you please explain what the topic and statement is about?
    Helps to narrow the focus, down to a specific hardware or software
    question pertaining to the Apple products involved, where applicable.
    Basic word processing can be accomplished in TextEdit, if you do
    not have Pages or any other software to write with, for example.
    Yet, there is no indication of the purpose, direction, or problem.
    Good luck & happy computing!

Maybe you are looking for

  • Palm Desktop

    I am having two problems that I can't seem to solve w/ Palm desktop. First, I have the problem that when I view month mode in calendar my program quits.  Not every month.  Just some.  I looked on this web site and after that I made sure no appointmen

  • Saving PDF forms in Adobe Reader 8 and below

    Hi everyone, I've created a PDF form for a survey using Acrobat XI Pro, and I've also Save As Other > Reader Extended PDF > Enable More Tools (includes form fill-in and save). I've tried it on Reader 9, X and XI, and I'm able to fill out the form, sa

  • What Apple Firmware do I Need for my MacBook?

    I'm trying to run bootcamp, but when I start the program I get a message: "You must update your computer's Boot ROM firmware before using this assistant". However, when I download the new firmware, my macbook rejects the firmware & says that my compu

  • How do I know if my iPad has a virus

    My iPad has started behaving strangely while I'm using safari. It allows me to open google and then search my chosen point, it delivers the findings and allows me to open the chosen site. However when I try to navigate further on the same page or ret

  • I've got a new computer with windows 7 & i downloaded firefox yesterdayerday. there are no menu buttons/navigation buttons showing up.

    i downloaded firefox yesterday. it is only showing maps4pc and googlechrome. there are no navigations tabs. i don't want the above two features. i only want plain simple firefox with navigation tool bar. everything i tried to fix the issue following