Copy the table with data and constraints

Hi all

I need to create a stored procedure that creates a table and copy a table with its data and constraints. We use it for backups. Y at - it all stored procedures out there who can do it, im pretty new to this and I need to create a stored procedure that can achieve this.

any help will be much appreciated

Thank you
K

Hello

The procedure that you created is invalid

Recompile it, and then type

show error

Rectivy the error until the procedure becomes valid.

Concerning
Anurag

Tags: Database

Similar Questions

  • Identify the tables with data or not

    Hello

    I want to find the tables with data and containing not data without checking each table. Is there a possible way?

    Like this?

    select
      table_name,
        to_number(
          extractvalue(
            xmltype(
     dbms_xmlgen.getxml('select count(*) c from '||table_name))
            ,'/ROWSET/ROW/C')) count
      from user_tables;
    

    Or may be

    select
      table_name,
       CASE WHEN
           to_number(
              extractvalue(
                xmltype(
         dbms_xmlgen.getxml('select count(*) c from '||table_name))
                ,'/ROWSET/ROW/C'))>0 THEN 'Table Has Data'
        ELSE 'Table is Empty'
        END
      from user_tables;
    
  • Make XY graph from the string with date and time data

    1 all sorry for my English.

    I have files with data. In this array of strings, I have 2 columns with date and time. I want to show these data to the XY Chart with time and date on some of the DBL and X on Y.

    I tried to do it by myself, but cannot add to time on X axis.

    Hi olderon,

    you date string is something like "30.01.2014" but looking for "%d//%m %y. Spot the problem?

  • copy a table with data of type long

    I have a table in which only one column is long. This table also contains a folder.

    How can I make another exactly the same as this (data-structure)?

    Hagrid says:
    I have a table in which only one column is long. This table also contains a folder.

    How can I make another exactly the same as this (data-structure)?

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> help copy
    
     COPY
     ----
    
     Copies data from a query to a table in the same or another
     database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    
     COPY {FROM database | TO database | FROM database TO database}
                {APPEND|CREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    
     where database has the following syntax:
         username[/password]@connect_identifier
    

    LONG data type has been deprecated for at least a decade.
    STOP to use it now!

  • Possible bug: save the table with double and extended precision to the worksheet

    If one concatenates an array of double-precision and an array of precision extended with the 'build' vi table, then recorded using 'Write in a spreadsheet file' vi any digits to the right of the decimal are reset to zero in the saved file. Regardless of the entry of signifier of format (for example %.10f) to the vi 'Write in a spreadsheet file'.

    I'm on Vista Ultimate 32 bit and labview 9.0

    This is a possible bug that is easily circumvented by the conversion of a type before you incorporate arrar in a worksheet. Nevertheless, it's a bug and it cost me some time.

    Hi JL,.

    No, this is not a bug - it's a feature

    Well, if you'd look closer you would recognize the 'save to spreadsheet' as polymorphic VI. As this polymorphic VI does not support the EXTENSION numbers internally (it only supports DBL, I64, and String) LabVIEW selects the instance with more precision: I64 (I64 a 64 bits of precision, DBL that 53...). Your options are:

    -the value of the instance to use as the DBL (by right click and "Select type... »)

    -make a copy of this VI, save it under a different name and make support number of POST (not rework the polymorphic VI like you would break compatibility with other facilities of LV or future revisions)

  • implementation of the table with the scroll bar. (data scrolling)

    Hello

    I want to show the web service data in the table with scroll bar using java script or html or css .actuall I want only a part of the screen is not whole screen scrollable. can you suggest how it is possible.any suggestion? I used phone gap technology. I used iscroll but it does not work in blackberry data are not displayed in the Simulator... Help, please

    Thank you

    ravi1989 wrote:

    Hello

    I want to show the web service data in the table with scroll bar using java script or html or css .actuall I want only a part of the screen is not whole screen scrollable. can you suggest how it is possible.any suggestion? I used phone gap technology. I used iscroll but it does not work in blackberry data are not displayed in the Simulator... Help, please

    According to devices/operating systems that you want to support, you could give bbUI.js a change. It works really well in most of the cases, and I think there are a lot of things you don't need to worry more because bbUI.js is just for you.

    Look more at the scrollPanel example that does exactly what it takes, a part only of the entire screen of scrolling you can configure a height in the HTML source code directly.

  • How to export data from the table with the colouring of cells according to value.

    Hi all

    I use jdeveloper 11.1.1.6

    I want to export data from the table with a lot of formatting. as for color cells based on value and so much. How to do this?

    You can find us apache POI-http://poi.apache.org/

    See this http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

  • Can fill us transitional attribute in the table with no serial like 1,2,3, etc.? And how?

    Mr President.

    Can fill us transitional attribute in the table with no serial like 1,2,3, etc.? And how?

    Concerning

    You want to show serial No. on the page for all the lines?

    Check once-

    Blog of Ashish Awasthi (Jdev/ADF): Add the serial number to the table of the ADF, column to auto-increment in the table to the ADF

    Actually transitional attribute loses its value when page refreshes or viewObject is not appropriate in this case if your use case is different, so please tell us

    Ashish

  • Working with date and time of the request for help from acrobat JavaScript...

    This coming from

    Working with date and time in Acrobat JavaScript (part 1 of 3)

    The following code adds five days to the current date, and then prints the new date in the console window.

    Get the date and time

    var rightNow = new Date();

    Get the value of millisecond

    Article date

    var msRightNow = rightNow.getTime ();

    Calculate in milliseconds, of 5 days

    5 days x 24 hours/day x 60 min / h x 60 s / min x 1000 ms/s

    Challenge of var = 5 * 24 * 60 * 60 * 1000;

    Do the calculation of var CFAbsoluteTime = msRightNow + challenge;

    Create a new Date from the calculated value

    var theNewDate = new Date (finalTime);

    In the actual work on a form code, you'll want to place the

    the object of a field value. But since this is test code, we will

    Print the result to the Console window (great for debugging)

    Console.println ("5 days from now is:" + theNewDate.toString ());

    The foregoing is the exact code (cut and paste)

    The error I get here is;

    ReferenceError: theNewDate is not defined

    1:Console:exec

    undefined

    To get the "undefined" question a lot... it seems to me, learn to distinguish the undefined 'of type' undefined 'variable' and undefined 'value '.

    in this case 'theNewDate' seems to be defined as a variable equal to the current date plus 5 days... BUT I am now "educated" enough to 'see' Why am I getting the error...


    Any thoughts... Any who...

    You need to highlight all the text that you want to run.

    You have not set the rightNow variable before you can apply a method to the variable.

    You can just add a new variable as msRightNow name. Why not use rightNow.

    Executes the code that you provided with a new departure of Acrobat, I get the following error messages:

    rightNow.getTime is not a function

    1:Console:exec

    TypeError: rightNow.getTime is not a function

    1:Console:exec

    undefined

    What you are showing probably works because your previous attempts have left behind them a variable "rightNow" and as long as you do not have the object of time date change too much, you will not notice the error.

    Cleaning of your code:

    get the number of milliseconds of the date object.

    rightNow var = (new Date()) .getTime ();

    define 5 days in milliseconds;
    Challenge of var = 5 * 24 * 60 * 60 * 1000;

    Add 5 days to the value of this moment and assign the result to the last time;
    var CFAbsoluteTime = rightNow + challenge;

    convert finalTime value in a date object.
    var theNewDate = new Date (finalTime);

    display the result;
    Console.println ("5 days from now is:" + theNewDate.toString ());

    Have you tried the code that I provided, it is another way to add days to the date object.

  • Create table with data in the column

    Create a new table, just want to know if there is a way to add a new column to the table with a value in all areas of this column when new rows are added to that this column will always be the same value

    As...

    name | address | zip | assets



    Active will always be Yes.
    I do a trigger?

    Use the default...

    create table (test)
    name varchar2 (20).
    address varchar2 (40),
    zip number (7).
    Active VARCHAR2 (3) DEFAULT NULL NOT 'yes');

  • problems with the table of contents and index

    I do the localization for the Japan, so I'm all nice and good in Japanese (themes, table of contents and index), however, after compilation, only the TOC and India are in a font that does not support Japanese characters.
    Does anyone have any ideas how to solve this problem?
    Thank you

    Thank you Pete, it's part of the solution.
    In fact, what I discovered on a German forum for RoboHelp, is to set the machine to the locale for the country, and the location is made. I installed the language support pack before my problem and so I was able I was translating into topics. The problem appeared when I tried my first compilation. The subjects were still in Japanese, that I translated, but the table of contents and the index and were the only ones who wrote in a totally unknown style (not Japanese English and not another language, I know).
    Now that I've changed the location of my system, it works.
    So, I think that this should be a first improvement for RoboHelp, right? They boast that they support 35 languages, however the support isn't quite... finish, huh?
    Furthermore, the error message continues to come even after all these changes, but I don't like too much about this, I get what I need.
    Thanks again Pete for the solution and the quick response.

  • copy the table labview

    When I go to a table control of labview to wire to a labview table hint and run the program, the column and row headings are moving from one table to the other.  A fix for this is to use the nodes property to the control table column and row headings and their son also to the node property for the column for indicator and row headings.

    The challenge is when I dynamically changes rows in table headers and the column headers for each file that I read and populates the table with.  As I read in another file, I want to collect the tables in a table for later use.  How to collect simple tables with different row headers and column with programming techniques?

    ID says:

    The table is within a cluster that is in a table.  Why can't I have a different table in these clusters of array element?  Because of the attributes of table can be different in each cluster?

    Each control in a table must have the same properties.  This means that all of your tables in the cluster in the table will have the same headers.  Of course, you could just put the header data in the data in the table itself, and then you have all the information.

  • Copy a table with its index of Oracle 12 to another instance oracle 12

    Hello

    I m using 64 bit Win8

    I have a huge table T1 (about 200 million) on user storage space and its index is on different tablespaces on DB1

    I built an other empty DB2 with the same names of storage spaces. I d like copy the table T1 of DB1 with all its indexes in DB2 so that the table will in User tablespace and the index go to their corresponding storage spaces.

    Is it possible to do?

    Currently I T1 to export into a CSV file and re - import to DB2 and build all indexes manually.

    Concerning

    Hussien Sharaf

    1. What is the exact syntax to export and import a table with its index?

    You will need to use the "Table". An export of table mode is specified by the parameter TABLES. Mode table, only a specified set of tables, partitions, and their dependent objects are unloaded. See: https://docs.oracle.com/cloud/latest/db121/SUTIL/dp_export.htm#i1007514

    2 How can I import the indexes in one tablespace other than the table itself?

    You can only export the table first without the index by specifying the EXCLUSION clause in order to exclude from the index (see: https://docs.oracle.com/cloud/latest/db121/SUTIL/dp_export.htm#i1007829) and then manually create the index and specify the different tablespace when you create.

  • I want to change the table with the expression of dangerousness of the virtual columns with her, need advice

    Hi all

    Here is the structure of the table with two expression of virtual columns associated highlighted, now I want to delete these expressions with virtual columns (but must keep my VIRTUAL columns as it is).

    Is it possible the alter or I need to raise the table, make a new structure and copy content back to newly structured table... Pleae help!

    CREATE TABLE TEST_COL)

    SAGE_TRADE_TYPE VARCHAR2 (50 BYTE),

    LOCAL_TZ VARCHAR2 (20 BYTE),

    ACE GMT_CONV_ENTERED_DT_TS (SAGEDBO. FN_CONVERT_TIMEZONE (LOCAL_TZ, ENTERED_DT_TS)) VIRTUAL,.

    ACE GMT_CONV_EXECUTION_DT_TS (SAGEDBO. FN_CONVERT_TIMEZONE (LOCAL_TZ, UPSTREAM_EXECUTION_TS)) VIRTUAL,.

    EOD_IND VARCHAR2 (10 BYTE)

    );

    Thank you very much

    Arpit

    Try this

    ALTER table test_col change gmt_conv_entered_dt_ts (0) virtual;

    ALTER table test_col change gmt_conv_execution_dt_ts (1) virtual;

Maybe you are looking for

  • Is it possible to exchange the US keyboard for a Japanese?

    See title - bought a Macbook from Best Buy American version, but can't seem to locate a cover of keyboard decent/sticker set for Japanese characters. The Apple store would be able to Exchange my English keyboard for a Japanese?

  • Lack of project

    Seems that my project file has deserted a 'crash' of ideas?

  • iOS 9.3.1 messages dissappearing

    My sister put to upgrade to iOS 9.3.1 earlier this week (to enable live streaming of an event), but since the upgrade has been having problems with messages. Main question: messages disappear almost immediately from the conversation, and if she leave

  • All my files are suddenly inaccessible?

    I was sifting through my photos for hours, and then when I try to get a glimpse of some of them in order to determine whether or not I want to keep, I suddenly "do not have permission" in preview mode?

  • Update windows XP SP 3 no success.

    I installed XP SP3, but after cutting system processes, it appears the dialog box: SP3 update canceled. Why?