Can we  change datatype  without deleting records ?

Hi all ;
Without deleting records in a table  , can we  change datatype in oracle 10g and 11g ?
SQL> desc emp
Name                                      Null?    Type
NO                                                 NUMBER
NAME                                            VARCHAR2(10)
CITY                                               VARCHAR2(15)
DEP_ID                                          NUMBER
SQL> select * from emp;
        NO NAME       CITY                DEP_ID
        1   madhir   calcutta                10
SQL> alter table emp modify(dep_id  varchar2(5));
alter table emp modify(dep_id varchar2(5))
ERROR at line 1:
ORA-01439: column to be modified must be empty to change datatype
SQL>  select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

See 'Modifying an Existing Column Definition' in the DBA Guide
http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables006.htm#i1006645
Use the ALTER TABLE...MODIFY statement to modify an existing column definition. You can modify column datatype, default value, column constraint, column expression (for virtual columns) and column encryption.
You can increase the length of an existing column, or decrease it, if all existing data satisfies the new length. You can change a column from byte semantics to CHAR semantics or vice versa. You must set the initialization parameter BLANK_TRIMMING=TRUE to decrease the length of a non-empty CHAR column.
If you are modifying a table to increase the length of a column of datatype CHAR, realize that this can be a time consuming operation and can require substantial additional storage, especially if the table contains many rows. This is because the CHAR value in each row must be blank-padded to satisfy the new column length.
And the ALTER TABLE statement in the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3001.htm#SQLRF01001
modify_col_properties
Use this clause to modify the properties of the column. Any of the optional parts of the column definition (datatype, default value, or constraint) that you omit from this clause remain unchanged.
datatype You can change the datatype of any column if all rows of the column contain nulls. However, if you change the datatype of a column in a materialized view container table, then Oracle Database invalidates the corresponding materialized view.
You can omit the datatype only if the statement also designates the column as part of the foreign key of a referential integrity constraint. The database automatically assigns the column the same datatype as the corresponding column of the referenced key of the referential integrity constraint.
You can always increase the size of a character or raw column or the precision of a numeric column, whether or not all the rows contain nulls. You can reduce the size of a datatype of a column as long as the change does not require data to be modified.The database scans existing data and returns an error if data exists that exceeds the new length limit.

Similar Messages

  • HT1473 I have two separate iTunes libraries on different computers and I would like to compact into one. But I cannot without completely erasing one of the libraries. How can I do this without deleting anything?

    I have two separate iTunes libraries on different computers and I would like to compact into one. But I cannot without completely erasing one of the libraries. How can I do this without deleting anything?

    Copy the content from one computer to another and import the media into iTunes.
    Any playlists, playcounts, etc on the computer the content is being moved from will be lost.

  • When I was ready to place the order for my iPhoto book, I realized that it was for a soft cover book and I wanted hard cover.  How can I change this without losing my prepared book?

    When I was ready to place the order for my iPhoto book, I realized that it was for a soft cover book and I wanted hard cover.  How can I change this without losing my prepared book?

    Duplicate your book and try to change the theme in the copy.  Chnaging the theme may change the layout  of your text fileds. That is why you need the copy to be able to compare the pages before and after.
    Ctrl-click the book in the Source list and select "Duplicate".
    Click the "Change Theme" button in the upper right corner of the Book pane, make sure, you have the same theme selected and the same size. Click Hardcover.

  • Can we change [maximum number of records per page] property at run time

    can we change [maximum number of records per page] property at run time in report 6i

    Ravi,
    I hope you are already done with this. In the invoice there is a nice example you can use on the xml blogs.
    You limit the number of lines per page when you use the xsl commands like this in your template:
    <xsl:variable name="lpp" select="number(13)"/>
    <?for-each@section:LIST_G_INVOICE?>
    <xsl:variable xdofo:ctx="incontext" name="invLines" select=".//G_LINES[LINE_TYPE='LINE']"/>
    <?for-each:$invLines?> <?if:(position()-1) mod $lpp=0?> <xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>
    and then you have the table where you have the data
    <?for-each:$invLines?><?if:position()>=$start and position()<$start+$lpp?>
    and all your lines
    and then
    <?end if?><?end for-each?>

  • Can't start Photoshop without deleting preferences file

    Hi gang,
    I have a Macbook Pro running Lion, OS X 10.7 that I purchased two months ago so it's relatively new. Just bought Adobe Photoshop CS5 Extended and installed it on the computer a day ago. Software will not operate unless I hold option+command+shift when starting so that the preferences file is deleted. I'm hoping someone knows how to help me reset things.
    I suspect that the problem stems from a plugin that I deposited into the plugins folder, because the software was working at first. I didn't piece this together until after the fact, but once I fired up the software a couple times after installing it, it worked fine each time. I noodled around and checked some things out to see what's new in CS5, then I went ahead and deposited a favorite plugin into the plugins folder. Things stopped working after this. Not positive the plugin is related, but thought I should mention it.
    I removed the plugin of course, to no avail. I've uninstalled and reinstalled the software three times. No difference. When I open the software without deleting the prefs file, it's just buggy and non-responsive. Can't start a new project, and thing just end up crashing every time. The software is useless without deleting the prefs file when firing it up.
    Is there any hope of restoring things to normal? Thanks very much!

    http://kb2.adobe.com/cps/409/kb409112.html
    Boilerplate-text:
    Are Photoshop and OS fully updated?
    As with all unexplainable Photoshop-problems you might try trashing the prefs (after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved and making a note of the Preferences you’ve changed) by keeping command-alt-shift pressed on starting the program or starting from a new user-account.
    System Maintenance (repairing permissions, purging PRAM, running cron-scripts, cleaning caches, etc.) might also be beneficial, Onyx has been recommended for such tasks.
    http://www.apple.com/downloads/macosx/system_disk_utilities/onyx.html
    Weeding out bad fonts never seems to be a bad idea, either. (Validate your fonts in Font Book and remove the bad ones.)
    If 3rd party plug-ins are installed try disabling them to verify if one of those may be responsible for the problem.

  • Adjusting and matching time lapse exposure changes? (without deleting photo's)

    Ok I am fairly sure there is no way around this but to do it manually... but just in case someone else knows a better way...
    What's the best way to compensate for exposure changes captured during a long time lapse? (without deleting any images) (eg. a full day time lapse taken on a cloudy/sunny day)
    Here's some more details...
    I recently set up a 6hr indoor stadium time lapse during a cloudy/sunny day. All the settings were set to manual so that shutter (for motion blur), ISO, aperture (for depth of field) and white balance were consistent. I shot it in raw and it looks good... BUT every time the sun is covered by a cloud the exposure drops way down causing an overall 'exposure flicker' type effect when you put it all together.
    So after searching for a while, I ended up manually adjusting over 1000 photo's, tweaking the exposure and eyeballing the histogram to be consistent (as 'Match total Exposures' didn't work in this manual mode instance). The result is 10x better, BUT I would love to be able to automate this process somehow as it would save me hours upon hours... any ideas? Any simpler ways?
    The only automated solution I can think of at the moment is to set the camera to shutter priority in the future, but I'm not sure if the aperture / depth of field changes would cause problems when doing this.
    Thanks for any ideas! I'm always learning and appreciate any input!

    Codebreaker3 wrote:
    I'm not sure that you will get good results if you try to normalise the exposure when dealing with large changes in luminance e.g. clouds moving in because that's the way the scene is at that time.
    I understand what you mean, but in my case adjusting the overall exposures to be roughly the same made a huge difference and made the overall timelapse much better... 'smoother', less flickery to watch... it was probably because this time lapse was taken in an indoor stadium so the overall environment wasn't changing like it would in a cloud or nature timelapse. The problem was just that the overall stadium exposure would change according to the weather/clouds outside the stadium. I haven't heard of the Granite Bay Software so thanks for that link... I have tried LRTimelapse and it has a great feature to reduce the exposure changes for long term timelapses, but it also involves removing the images which have extreme exposure changes which is not what I wanted in this instance, I needed every image to remain in the timelapse. I think the manual method unfortunately is the best bet for this sceneriao, but I really appreciate all the ideas and suggestions!

  • I would like to edit my PDF file how can i do that without deleting it

    i would like to edit my PDF file, how do i do that without deleting it ???

    Hi Didds,
    Through Acrobat you can edit your PDF file.
    Kindly refer this link:PDF editor, edit text in PDF files | Adobe Acrobat XI
    Regards,
    Florence

  • HT4623 Is there any way I can increase my memory without deleting stuff?

    Is there any way I can increase the memory on my iPhone 4 without deleting stuff?  eg by purchasing extra memory?

    No, there isn't. The amount of storage on an iPhone is fixed and cannot be increased. Your only options are to either delete stuff or purchase an iPhone with larger capacity.
    Regards.

  • I am loaning my Ipod touch 4 to my granddaughter but dont want her t see my messages but still allow her to send messages. Can this be done without deleting the entire acct ?

    How can I allow my granddaughter to use my ipod touch without seeing all of my meesages when I message on my iphone4 ?

    Go to Settings>Messages>Send and Receive and add a new email address for her. Then in same place uncheck your phone number and email address. Als delete any Messages already on the iPod. Then go to Settings>General>Restrictions and turn on the Restrictions that prevent changing accounts.
    iOS: Understanding Restrictions (Parental Controls)

  • If I transfer content from an iPad backup to a new iPad, are they synced, or can I change one without changing the other?

    I have just bought a new iPad mini to use alongside my iPad Air.  They'll be used in much the same ways, just the mini being slightly more portable and the Air having a bigger capacity will have more content.
    I'd like to set up my new mini from a backup of the Air (currently the Air doesn't have too much content that the mini will not have enough capacity), but then I'd like them to go their separate ways.  I'd like the mini to look how the Air currently does, but then I'd like to make tweaks to both of the devices, but in different ways to each other.  So, if I set up from back up and then delete an app or 2 off one, will it delete the apps off the other?
    I assume they show up in iTunes as "iPad" and "iPad mini" or something different so I can use both devices with my Apple ID?
    Or is it better to just set up from new and sync the bits I want to my new mini using iTunes.  That doesn't seem like it'd take so long, so might be easier?
    Thanks!

    You can restore the Air's backup onto the Mini - if not already in your computer's iTunes library then copy them over from the Air via File > Devices > Transfer Purchases (your iTunes downloads aren't included in a backup, the restore picks them up from your iTunes library).
    Deleting an app off one iPad won't remove it from the other, and yes, when connected to your computer's iTunes they will show up as different devices (you can change the names that they show up as via Settings > General > About > Name) and what you subsequently sync to one of them won't be synced to other unless you choose to sync it.
    If you will be using the same iCloud account on both then you can use Settings > iCloud to control whether your Safari bookmarks, contacts, calendars are kept in sync between the two.

  • I used my daughter's itunes account to log into icloud but want to now put in my account information.  How do I change it without deleting her account?

    I used my daughter's itunes id to log into icloud as I forgot my information.  Now I have established my account information and want to remove hers to add mine.  I am afraid to "delete account" as I fear it will delete her information.  How do I change the icloud account?

    Go to iTunes menu, STORE and sign out.  Then you can sign in from there or create a new account which should match the account you have on your iPad and iPhone.

  • I recently purchased a new iPad. I would like to delete my email addresses from my old iPad so I can give it to my grandson. Can I do that without deleting the apps?

    I recently purchased a new iPad. I would like to delete my email addresses from my old iPad so I can give it to my grandson. How do I do that for just the old iPad?

    If you want to remove your Apple ID from the iPad you can just sign out in Settings>iTunes and App Stores>Apple ID. Tap your ID and sign out. That will not delete the apps from the iPad. He will not be able to update the apps without your username and password and he will have to sign in again in order to that.
    If he is going to use his own Apple ID and he begins to switch and back and forth from one ID to the other - and if he downloads anything again using your ID, he will lock himself out of his own ID for 90 days.
    If you are asking how to remove your email account from the iPad go to Settings>Mail, contacts, calendars>your email account>Delete account. That will not cause you to lose any apps either.
    You should probably explain exactly what you want to do in order to clarify.

  • Can't change password or delete a Mac OS X account

    I set up an account for my son (6 years old) so that he could have his own desktop and access to his own 'stuff' w/o getting into my stuff. I'd like to change the password (I just used my password) to something easy for him. But when I go into 'accounts' it doesn't let me change his password. I log on as an administrator but the change password button for his account doesn't lite up. I also thought about deleting his account and starting over, but I can't delete it either. I've clicked the lock at the bottom as well and that doesn't seem to work... Any ideas?

    How do you log out? Is that different from just switching from one account to the other? I use the pull-down tab in the upper right corner with our names on it to switch from one to the other... But never really 'log out.'

  • Can't restore new phone through backup without updating itunes, can't update itunes without deleting those backups.

    I've got a big problem i'm hoping you guys can help with.
    I recently updated my iTunes but now it refuses to open at all. I've googled this and it says that i need to just uninstall and then reinstall itunes, as the new 64 bit version has come out. My problem is this: I NEED the old itunes data that i have to sync contacts with my new phone. I made backup copies before my old iphone 4 crapped out, but i can't sync my new iphone with these copies without updating. however, i can't update without uninstalling everything and deleting my backups. see the problem here?
    please help!

    Hello viclotto,
    Welcome to the Apple Support Communities!
    I understand that you need to update iTunes but you have concern for your information in iTunes. It is unlikely that any of your purchased or uploaded data would be affected affected by uninstalling and reinstalling iTunes, but I would recommend making sure your iTunes library has been backed up. Your contacts are not stored in iTunes but rather in the contacts program of your Windows computer. Deleting and reinstalling iTunes will not affect your contact data that is stored in your computer. 
    Remove and reinstall iTunes and related software components for Windows Vista, Windows 7, or Windows 8 - Apple Support
    Media you've bought from the iTunes Store or songs you've imported from CDs are saved in your My Music folder by default. They won't be deleted by removing iTunes. Although it's highly unlikely that you'll lose any of your iTunes Library when following the steps below, first make sure that your iTunes library is backed up. See iTunes: Back up your iTunes library by copying to an external hard drive for more information.
    Steps
    Remove iTunes and related components from the Control Panel.
    Use the Control Panel to uninstall iTunes and related software components in the following order. Then restart your computer.
    iTunes
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Don't uninstall these components in a different order, or only uninstall some of them. Doing so might have unintended affects.
    Have a great day,
    Joe

  • First podcast uploaded with the wrong logo, can I change it without removing the whole podcast?

    Hi Folks,
    We just uploaded our first podcast but unfortunately, the wrong logo has been uploaded. I was hoping we could change the logo without having to remove the entire podcast? Any help would be sincerely appreciated,
    Thanks in advance!
    Ollie

    Are you talking about the image which appears in the Store page? Just choose a new image and make sure it has a different filename, get it into the feed in the same way as you originally placed an image, and re-upload the feed.
    It will take the Store some days to recognize the change.

Maybe you are looking for