• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Oracle question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Supplementary question.

    Given that I have gone for the "CREATE TABLE..." option, what code would I need to write to copy them back into the original table from the backup table, after deleting them from the original table?

    I'm going to have a go at writing it...please don't laugh if I get it wrong.

    INSERT INTO original_table
    SELECT * FROM backup_table

    Is it that simple?

    Comment


      #12
      It looks okay to me....unless of course there is a sequence counter and you need to preserve the sequence number. In which case you'll need to turn that off.

      Otherwise looks good...but I'm not a guru.
      McCoy: "Medical men are trained in logic."
      Spock: "Trained? Judging from you, I would have guessed it was trial and error."

      Comment


        #13
        Originally posted by Moose423956 View Post
        Supplementary question.

        Given that I have gone for the "CREATE TABLE..." option, what code would I need to write to copy them back into the original table from the backup table, after deleting them from the original table?

        I'm going to have a go at writing it...please don't laugh if I get it wrong.

        INSERT INTO original_table
        SELECT * FROM backup_table

        Is it that simple?
        I guess it didn't go well

        Yes, that code should do it.
        Best Forum Advisor 2014
        Work in the public sector? You can read my FAQ here
        Click here to get 15% off your first year's IPSE membership

        Comment


          #14
          Originally posted by TheFaQQer View Post
          I guess it didn't go well
          It was a "just in case" question. Just done the delete, and it went okay.

          Comment


            #15
            If no constraints, then, after CTAS:

            "DROP TABLE orginal_table PURGE;"
            then:
            "ALTER TABLE backup_table RENAME TO original_table;"

            Comment

            Working...
            X