How can i get my scrpit to overwrite or rebuild objects already created?

I am a student studying database design so please bare in mind i am a beginner.
Basically i want my script to be able to be run again and again on the same system. When it does this i want it to overwrite or rebuild the objects already made by the script before(in this case a number of tables with PK and FK).
At the moment if i do this it just says the objects and referential integrity already exists? Is there a way i can do this so it overwrites them? By the way the tables contain no data.
Thanks in advance!
Edited by: Jay on 04-Nov-2010 04:25

You can individually write a series 'drop table' and 'drop constraint' statements in to your script for each table in your schema, which is fine for a small number of fixed tables/constraints. When your schema expands (as they are wont to do), it might become a little laborious to copy them all out.
Jarola's procedure references two special system views named "USER_TABLES" and "USER_CONSTRAINTS" which contain information about the relevant types of user-owned database objects in your schema (there's another view called "USER_OJBECTS" as well which covers similar territory) and generates the 'drop' statements dynamically (i.e 'on the fly'), which is significantly easier and less prone to error or omission.
You only need to run his code "create procedure" code once and you can reference the procedure anywhere in your script (or other scripts). It also means that you could potentially re-use his code in another schema for the same purpose.

Similar Messages

  • How can i get the value stored in the session object using its sessionid

    how can i get the value stored in the session object using its sessionid by running stand alone java application

    myforum wrote:
    how can i get the value stored in the session object using its sessionid by running stand alone java applicationThis does not seem to make sense! You need at least to give a lot more detail of what you are doing.

  • How can I get rid of shimmer effect in videos that I create in iMovie?

    How can I get rid of shimmer effect in videos that I create from photos in iMovie?

    Well, not sure - so exactly what resolution do you use to shoot? Go in your camera settings and check. And, is there a settings to choose for regular/extra/fine/superfine quality? I shoot at the highest quality - period. My size/resolution is either widescreen or larger than what I need for the movie. My TV is HD 720p - that means the screen will display 1200 x 720 pixels in HD; if you have a 1080p, it'd be 1920 x 1080. So shoot in a size a bit larger than that because they can be adjusted down without any quality loss, but can't be made larger without significant loss of quality.
    But,again, the problem usually doesn't start until you add movement, but camera quality has something to do with it as well. I know that a previous camera I had was not as good and a lot of my slideshows/movies didn't come out as perfect as I would have liked. So I bought a more expensive camera - shoots in full 1080 HD and I haven't had a problem since.
    As for exporting a slideshow: finish it in Photo to Movie and export to desktop at highest quality (will take a while). Here is a screenshot of my export settings:
    Once done, you can simply choose that movie by going to "import movies" in iMovie and navigating to the location (I usually save to desktop - easy to find).

  • How can I get iCloud to quit overwriting my contacts?

    Hi all, I had a problem with iCloud and my contacts.  Luckily I made an archive of my contacts.  I ended up deleting all of my contacts in icloud as a mehod of clearing the slate.  I am turning off iCloud synching, importing the address book backup to my local address book, then turning on iCloud synching.
    The result is that I lose all of my contacts on my local machine.
    How can I get my local machine to simply push the contact info to iCloud (rather than have iCloud overwrite my contacts on my local machine)?
    Thanks, matt

    iCloud will not back up your computer. Only documents you can save in iCloud is photostream photos and documents created with Apple Applications within iCloud itself (pages, numbers, keynote), your Address Book contacts and Calendars. You can also back up iPhone & iPad settings.
    iDisk was part of MMe and is going away or has gone away. I'm not sure of the exact date, but the deadline may have expired. If you have documents in iDisk and you did not save them to another location, they may be lost.
    In addition check this discussion out:
    https://discussions.apple.com/thread/4079949?start=0&tstart=0
    Also:
    http://www.apple.com/mobileme/transition.html

  • How can I get gridlines to print on my template that I created in Numbers?

    I am trying to create a template in Numbers and I want the gridlines to print.  The drop downs for x-axis and y-axis under Chart inspector are shaded gray and are not able to be clicked on.  How can I get those gridlines to print?

    Suzy1107 wrote:
    Its a spreadsheet that looks like excel, has two columns at the top and 49 rows at the left side
    You seem to be looking in the Chart Inspector for formatting options for the table. Use the Table Inspector, or the Format Bar for Table Cell Border format options.
    I have circled the border format controls in the Format Bar in the attached screen shot:
    Regards,
    Jerry

  • How can I get SD pricing conditions list as in VA01 without creating SO?

    Hi Guys,
    I have searched a lot of posts for this answer but only found that it's not possible to do through function 'PRICING' without creating SO document.
    My initial input is: sales organization, distribution channel, customer, material number, pricing date. Can I find relevant pricing conditions based on this info? I need to make a report, which would display all pricing conditions with values based on the selection parameters mentioned earlier. Thanks for any help.

    Use function module 'PRICING'
    This is a pretty big task interms of collecting all the required data.
    Check where used list for pricing. This is used in 2 places. Put a break point on them and run your sales order transaction. See what are the fields passing through.
    You can also determine from KOMK and KOMP . One for customer and the other for material. Make sure you pass all the data that is required.
    You will get results of conditions in importing table. (may be konv)
    Using simulate will actually creates a document number (i believe). Even though this will not be available in VBAK, VBAP... the number will be taken off from the sales order number range.
    I have used PRICING function module in of my work.

  • How can I get a rescue email for an account that already exists. I don't remember my security questions either .

    I don't remember my security questions,
    and I'm trying to get a rescue email,because I don't have one. Help I don't know how to do this.

    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID

  • [Q] How can I get OS X to remember the adhoc network I created?

    I created an adhoc airport network on my Mac Pro running 10.5.6 and that works just fine until I reboot and the system forgets it, and I have to recreate it.
    So apparently it's not getting saved to disk perhaps because the relevant file is corrupted. Does anyone know which file it is?
    keywords: ad hoc, internet sharing, Devices, wireless.

    I also have this problem. I work at an educational institution, and we're trying to create this ad hoc network between 4 iMacs to transfer files to one of them designated as a print station for a photography class. We want it to be like this all the time so it is easy for students to use. Is there any way for these network settings to be saved and used upon startup?

  • How can I get all my data back after erasing my iPad from find my iPhone?

    What happened is that I have 2 iPads . So I deleted the two from "find my iPhone" so  one already got deleted but the other one is still awaiting to get delete. What I want to know is that the one that is not deleted yet is using the same ID as the other one... So I have the one that got deleted and I had to put my ID again and all those stuffs and I wanted to get all my photos back but I couldn'. So the other one has the same ID but already did the backup therefore it's supossed to get all its inforMarion back with the ID but the other one has that ID so how can I get my data back and the one that already got deleted?

    Howdy Axelbm01,
    Welcome to Apple Support Communities.
    It sounds like you want to know how to restore one iPad from the backup of another iPad. Take a look at the article linked below, it’ll walk you through the restore process which will prompt you to choose the backup that you would like to restore from.
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support
    Cheers,
    -Jason

  • HT4098 I have a subscription to The Telegraph which I purchased before changing my email and apple ID.  How can I get iTunes to transfer this purchase and put it under my new apple ID?

    have a subscription to The Telegraph which I purchased before changing my email and apple ID.  How can I get iTunes to change it to current ID

    Did you create a NEW Apple ID or did you change the email address for your OLD Apple ID? This will affect how you update apps in the future.
    Anyway, go to Settings/iTunes&App Stores, log out, then log in with the new ID.

  • When I am home, calls to my iPhone 5 also go to my other family members' iPhones.  How can I get this to stop happening?

    When I am home, calls to my iPhone 5 also go to my other family members' iPhones.  How  can I get this to stop happening?

    Or better yet, create and use new Apple IDs for others in your household. You could always use different Apple IDs for iCloud services (like iMessage and FaceTime) and iTunes and App Store., but it's even easier to share purchased content now with Family Sharing.

  • How can I get a mail icon on toolbar that will take me to "Mail"?

    Just downloaded version 3.6.11 and noticed that my mail icon on toolbar is no longer. Used to click the icon to get to my mail program (which is Mac's "mail") while running Firefox. How can I get the icon back on the toolbar (have already set preferences for "mail"?

    https://support.mozilla.com/en-US/kb/Creating%20a%20desktop%20shortcut%20to%20a%20web%20page
    You need to keep in mind that Gmail works differently than how Outlook works. Gmail is web mail that is accessed through a web browser, where Outlook is a locally installed email program that communicates directly with an email server.

  • I cannot open a pdf file on my Mac because i don't have the segue UI font. How can I get it for my Mac?

    I cannot open a pdf file on my Mac because i don't have the segue UI font. How can I get it for my Mac?

    The user already has an identical topic https://forums.adobe.com/thread/1468166 in the Reader forum.

  • When I move a RAW file from IPhoto to my desktop or Photoshop it changes to a jpeg and reduces in size. How can I get the Raw file across?

    When I move a RAW file from IPhoto on my macbook pro to desktop or Photoshop it changes to a jpeg and reduces in size. How can I get the Raw file to move across?

    I create separate folders based on the year and then the actual date of when I take images. You can make those folders anywhere on any hard drive that is connected to your Mac whether internal or external. I also use the Photoshop Photo Downloader that is included with Photoshop/Bridge and it will create the date folder so all I do is create a Year folder.
    Open Bridge or click on the Bridge icon in PS and in the File menu item in Bridge select "Get photos from Camera". It can be a camera connected to your Mac or a memory card from a camera. A window will open and you then select the camera or memory card. Set the location they will be downloaded to, just the folder and you can Browse to a folder that you created, then in the "Create  Subfolders drop down select what date stamp you want to use or or custom name or not to create subfolders at all.
    I've never cared for iPhoto one bit. I tried it but found it way to restrictive. It likes to have full control over how you interact with your images.

  • How can I get Flash Player for Android 4.1.2?

    How can I get Flash Player for Android 4.1.2?

    Hello,
    First of all many thanks for your prompt reply.
    This morning I tried with other versions and unfortunately after installation I couldn’t use them.
    Best regards,
    Josep M. Salvador
    Technical Office Manager
    ESTAMP S.A.U,
    Aire, 33; 08227 Terrassa (Barcelona) Spain
    Phone No: +34 937363131 (ext. + 256)
    [email protected]<mailto:[email protected]>              www.estamp.es<http://www.estamp.es/>
    DISCLAIMER: This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited.
    De: VikramGaur [email protected]
    Enviado el: martes, 10 de septiembre de 2013 16:17
    Para: Josep Salvador
    Asunto: How can I get Flash Player for Android 4.1.2?
    Re: How can I get Flash Player for Android 4.1.2?
    created by VikramGaur<http://forums.adobe.com/people/VikramGaur> in Installing Flash Player - View the full discussion<http://forums.adobe.com/message/5668781#5668781

Maybe you are looking for