Skip to Main Content
  • Questions
  • REGARDING copy an table from existing table

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, mano.

Asked: February 23, 2017 - 9:53 am UTC

Last updated: February 25, 2017 - 12:59 am UTC

Version: 11g

Viewed 1000+ times

You Asked

How to create an table from existing table and vommiting particular columns with the data from the table

and Connor said...

You want to vomit some columns ? :-)

VOMIT

I assume you want to "omit" some columns. That's easy to do. Just do

create table NEW_TABLE as 
select [columns you want to keep]
from OLD_TABLE



You can use SQL Developer or the DBMS_METADATA package to obtain things like grants, indexes, constraints etc on the OLD_TABLE if you need to transfer them over to the new table as well.


Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

good picture

Rajeshwaran, Jeyabal, February 23, 2017 - 2:52 pm UTC

Can't stop laughing by looking at this picture.

It was a good picture to illustrate "Vomit".

BTW - where did you got this Pic? (been with this forum since 2008, and this is the first time I see a Pic in the "response")
Connor McDonald
February 25, 2017 - 12:57 am UTC

When we relaunched AskTom, I made some changes to allow our answers to include

- inline images
- youtube video
- downloadable attachments

This gives us the ability to give better answers (eg screen dumps etc).


12c feature

Steve Jelfs, February 23, 2017 - 4:07 pm UTC

Which version is vomiting columns available in? I can't seem to find it in my 7.3.4 version.
Connor McDonald
February 25, 2017 - 12:59 am UTC

You need the Serialized Performance Engine Writer option (SPEW)

:-)

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library