Create a new table from another table which are ussing a stored procedure

Hello

I want to know if it is posibble to create a new table from another table which are ussing a stored procedure. This new table is created from another table that exists in the DB.
(in the following code the table tbl1 exist in the schema of the DB, but temp_tbl1 does not exist, it must be created by the procedure)

create or replace procedute temp is
temp_tbl1 tbl1% TYPE; the temp_tbl1 will have the same type of tbl1
Start
create the table temp_tbl1 as (select * from tbl1);
time of the end;
\


Thank you very much

Yes, it is possible to create a table using a procedure.
Do everything that use dynamic SQL is

Try this:

==================================================
create or replace PROCEDURE Create Table as
BEGIN
EXECUTE IMMEDIATE ' CREATE TABLE testtable in select * from testingtable';
END createtable;
==================================================

Kind regards
Ankur

Tags: Database

Similar Questions

  • How to create the new table by using the pertioned table

    Hello
    I use a partitioned table, now I want CPDR a new table with the same structure of my existing partitioned table.
    so can I use this syntax

    create the table abc_new as
    Select * from my_partitioned_table
    where 1 = 2;

    If I use this syntax, he would do the same my existing partitioned table structure?

    and

    When
    We use a syntax such as

    create the table abc_new as
    Select * from my_partitioned_table
    where 1 = 2;

    so he would also make the indexing on the new table if old table exists? If this isn't the case, then how can we create this indexing too at the time of execution of this syntax?


    regards

    N °

    Although the command would create a new table with the same column names and data types, it is NOT a partitioned table. You must explicitly specify the PARTITION BY clause and definitions of Partition when creating the table.

    Similarly, index definitions are not automatically copied. You must explicitly run the CREATE INDEX statements (which you can generate source using DBMS_METADATA. GET_DDL or by using any other tools/utilities).

    (However, if you use Export-Import - for example import to another schema, or to another database, it would create a table partitoned bearing the same name and with the same index definitions).

    Hemant K Collette

  • steps to create the new table using existing metadata

    Hi all


    That's what I want to achieve,

    I want to create a procedure that will take an input parameter as a table name lets say 'EMP ',.
    This procedure checks if this table exists or not?
    If they don't exist
    It will create a new table with the name _dummy join the existing table name (ex: new table will be EMP_DUMMY).
    and new table should have the same structure of the table, indexes, and constraints on the EMP table.


    NB: It should not be created using select as create table EMP_DUMMY select * from EMP where = condition false;



    Can someone help me please how to achieve this?

    Please, don't post duplicate discussions.

    Check your thread previous stored procedure to create a new table with the existing table structure to further discussions

  • How to create a new Table in AOF?

    Hi all

    I want to do a simple application. And why should I create a personalized with 4 columns. Is it necessary to create a new scheme or I can add it with the existing schema.

    and please tell me the steps to create the new table.

    Thanks in advance.

    Published by: fsl on November 28, 2010 22:37

    Hello

    Forget the new schema.

    -Create table in the existing schema.
    -In jdev to create eo and vo.

    Concerning
    Meher Irk

  • Character style strange applied when you create a new table

    Hi all

    I have a table style. This is controlled using the cell styles. Cell styles is controlled using paragraph styles. Nothing complicated here.

    When I create a new table by using the style, it seems. Accept that all of the text in the cells have an applied character style. So when I start to insert text in a cell, the text is formatted different style of paragraph, that I defined in the table style.

    If I remove any character hairstyle for all the text in the table, it seems just as expected.

    Any ideas on how to move forward with this? It's pretty annoying to have to select the table and remove all style characters before you can start using the table.

    Thank you!

    Martin

    Check that a character style is not selected by default before you create your table.

  • Create the new table with the new calculated entries

    Hello
    I had a little problem.
    I have a table which includes the employee vacation time. Vacation time was periodic, so I divide them into days. Now, I want to calculate the exact days. Sometimes ago weekends included I need to subtract. I have flaged everyday, I know exactly what day is a business day and that one is not. Is it possible that I have only the sum of the days without weekends?

    Table Vacation_Times:

    EMPL - V_Start_D - V_End_D - Date-day - D_Name
    Mr.A---01.05.11---06.05.11---01.05.11---6---mercredi
    M.-a---01.05.11---06.06.11---02.05.11---6---jeudi
    Mr.A---01.05.11---06.05.11---03.05.11---6---vendredi
    M.-a---01.05.11---06.06.11---04.05.11---6---Samedi
    Mr.A---01.05.11---06.05.11---05.05.11---6---dimanche
    M.-a---01.05.11---06.06.11---06.05.11---6---Lundi

    NEW table:

    EMPL - V_Start_D - V_End_D - Date-day - D_Name - Actual_Days
    Mr.A---01.05.11---06.05.11---01.05.11---6---mercredi---4
    M.-a---01.05.11---06.06.11---02.05.11---6---jeudi---4
    Mr.A---01.05.11---06.05.11---03.05.11---6---vendredi---4
    M.-a---01.05.11---06.06.11---04.05.11---6---Samedi---4
    Mr.A---01.05.11---06.05.11---05.05.11---6---dimanche---4
    M.-a---01.05.11---06.06.11---06.05.11---6---Lundi---4


    THX

    Hello

    VR;

    SELECT Empl ,V_Start_D ,V_End_D ,Date ,Days ,D_Name , count(*) as Actual_Days
    FROM vacation v
    JOIN datelist d ON d.day between  V_Start_D and V_End_D and d.is_working_day='Y'
    GROUP BY Empl ,V_Start_D ,V_End_D ,Date ,Days ,D_Name 
    

    Kind regards
    Carsten.

  • Update or create a new table of contents

    Here a strange-

    Attempt to create a table of contents for a catalog-57pages... I created a specific paragraph style I used to categories of label on the top of each page of the catalogue. Then, I created a table of contents using the style of paragraph worked as advertised... Well I went through an edition almost all categories on each page I want to make it a little more accurate. I clicked on "update the table of contents" and I get: "the destination you have chosen is a hidden and already used by a different hyperlink." A hidden destination cannot be shared by multiple hyperlinks... I checked ALL categories and ensured that all text fit in the frames. I've removed the table of contents and has tried to create a new one and got the same error. Really don't know what I'm missing here as it was the ONLY thing that I did edit the categories some... In addition, I don't know of any other information that I provide here to show you the whole. I thank in advance for any help, you may be able to provide!

    Try to move pages (without the table of contents) in a new document.

  • Create a new record from an existing record

    Hello

    -----------------------------
    Scenario of
    -----------------------------
    Block H-> table header has an identifier of main text field called 'ID' (field ID is generated only after registration)
    D1 block multi retail-> table B
    Details of multi block D2-> table C and who is a child of the Table B.

    Table C is filled in the post - insertion of table B and reviews of D2 are read in a view / read only the form by clicking a block
    -----------------------------
    Requirement
    -----------------------------

    The user wants the ease of copying the entire feature. The requirement is to create a new record to be created with the original values of the existing record and the recording of a new value should be generated in the field ID.

    We have a copy button.

    We wonder what is the approach to be taken for this. A create_record and duplicate_record will work in the copy button

    Please suggest... pointers on what other things need to be supported, so that the final result a new record successfully. Would appreciate an approach of details here...

    Concerning
    SR

    Take a look at the DUPLICATE_RECORD() built into the forms help system. It will create a new record and copy all values from item in table of basis of registration that has focus and copy the values to the new record.

    Craig...

  • Why am I forced to constantly create a new project from an old project name?

    Everytime I open a project I worked on, say yesterday, GarageBand requires me to create a new name with a number attached to the current name. So, I have to remove my old project and rename the a new back to the old.   Is there a way I can work on a project that I have already created without being obliged to give him a new name over and over again?  It's so frustrating and so it seems useless.

    Everytime I open a project I worked on, say yesterday, GarageBand requires me to create a new name with a number attached to the current name.

    Which should occur only if the projects that you open have been created by a different version of GarageBand, for example, GarageBand iOS on iPad. In this case, GarageBAnd needs to create a converted version and record the original, because the new version is more readable by the other version of GarageBand. Or, if the project you are trying to open is write protected.

    Have you created projects on another device or another user account?

  • BlackBerry Smartphones how can I create a new contact from an unknown SMS/text?

    Hey.  When I receive an SMS to a number, I don't know how easily I add them as a contact, while in my Inbox, it shows me their names and not their number?  I tried to look on the forums but cannot find an easy solution.  There must be a quick way to do it, no?

    oilersrock99 wrote:

    Really?  Because you can easily do it with the curve.  You have to pull up the menu while in the text and select "create a new contact."

    Thanks for the attempt if.

    OK, so my OS has been upgraded last night (at v5.0.0.743 v5.0.0.862) and I now have the ability to add SMS numbers as contacts.

    So, to add the SMS number as a contact, simply do the following:

    In the SMS of the person you want to add, click on the BB button, and then select Add to Contacts. Fill in the details required for the person.

    If you do not have this option, then you can upgrade the operating system on your BB. RIM sometimes falls options from version to version of the OS, but return them to the successive versions.

  • If you delete the free partner site, you can create a new one from scratch?

    Hi all

    So I just saw that a free partner site has been created for me and she seem to include all the features of BC on it (which is great!), the problem is it seems to have a default value of site of BC he likes when you publish your site regardless of the host, and they put their index by default on this subject until you load you own site. Then I tried to chat with a customer representative on this live chat option and he said I could not change the default template that comes to this subject. SO, what is the point to get this free site, if you cannot customize to your taste? THEN I thought, maybe if I delete the site it will give the possibility to create a new free site parter, but this time I'll be that choose the model and other configs. However, I'm afraid that if I delete the site, that's all, I won't be able to create a new partner free site and it and all of its features will be gone forever, that why I post here. Everyone how you can change an existing model does not place, or if you delete the free partner site that is given to you, you are able to create a new?

    Thank you

    Alex.

    Currently, there is not any way to assign a model on the partner site (for example, a model of BC) or one of the sites that sale models BC.

    The best method is to create a test site with the model you want to use, then copy the code on your partner site. You can easily change the files in the site to make it look like you want to only it.

  • How can I create a new form from scratch online?

    I'm unable to create a new online starting from scratch as the software asks me to use a template, but when I click the link it says page not found. I use Adobe Acrobat X Standard. Help, please

    Hi michellem44243306,

    You can view the following link to create a form on Adobe Acrobat X Standard: Adobe Acrobat X Pro * create forms using Acrobat

    It contains the steps and the video tutorial for a better understanding.

    In the case where you are still having a problem please lets us know.

    Kind regards

    Nicos

  • Firefox creates the new icon from the taskbar when already pins. How to return to activate the pinned icon?

    After the 4.0.1 update, Windows now creates a new icon in the taskbar instead of activate one who is already pinned there. This does not happen on other computers I've used.

    Hi, a bit of googling solved the problem, this article eplains,
    http://www.gHacks.NET/2010/10/12/fix-pinned-items-opening-as-new-icons-in-Windows-7-taskbar/
    It worked for me, so I hope it'll work for you too.

  • create a new partition from a system partition encrypted with bitlocker

    Hello

    I have the following problem.

    My new notebook come to me with a very large single drive (C :) and use bitlocker.) I shrunk drive (C :) to create a new drive (d) just to store my personal data.) The new drive does not use bitlocker encryption.

    Now the problem is that whenever I restart the pc, I need to insert the recovery bitlocker (a very long key) key.

    How can I avoid starting the system whenever in bitlocker recovery mode?

    Thank you very much

    Hello

    Wewould recommend to turn off or temporarily suspend BitLocker. See the section, "to stop or temporarily suspend BitLocker" on this link: http://windows.microsoft.com/en-us/windows7/help-protect-your-files-using-bitlocker-drive-encryption.

    Let us know how it goes.

  • Creating a new document from existing pages

    It must be a feature in InDesign that allows you to create a new document using the selected pages in an existing document without having to remove unwanted, pages as when you create a document "save under".  And also the possibility to create existing master pages.

    It is already there. At least somehow.

    Create a new document of the same dimensions of the former, with a blank page. Then, in the old document, select them pages you want and in the Pages menu, choose move Pages.  You can then select the new document to move pages to and make sure to remove Pages after that moving is not selected.

Maybe you are looking for