Move posts from one tabel to another with checkboxes in HTML DB

I wish to replace the checked rows from one table to another with a PL/SQL statement.
When I wish to replace one row, there is no problem. But when I wish to replace two or more I get an error ORA-00001: unique constraint (HTMLDB_ERASMUS.SYS_C0042823) violated.
The only unique constraint in my table is the primary key ID, witch is generated with a sequence, so normally there is never twice the same value for an ID.
Can someone help me here, please?
Here is my code
DECLARE     
lv_i NUMBER :=1;
lv_ID add_post.ID%TYPE;
lv_auteur add_post.auteur%TYPE;
lv_titel add_post.titel%TYPE;
lv_community add_post.community%TYPE;
lv_rating add_post.rating%TYPE;
lv_description add_post.description%TYPE;
CURSOR move_posts iS
SELECT ID, auteur, titel, community, rating, description
FROM add_post
WHERE ID = HTMLDB_APPLICATION.G_F01(lv_i);
BEGIN
FOR lv_i IN 1..HTMLDB_APPLICATION.G_F01.count LOOP
OPEN move_posts;
FETCH move_posts INTO lv_ID, lv_auteur, lv_community, lv_titel, lv_rating, lv_description;
INSERT INTO wouter_published_posts VALUES (lv_ID, lv_auteur, lv_community, lv_titel, lv_rating, lv_description);
DELETE FROM add_post WHERE ID = HTMLDB_APPLICATION.G_F01(lv_i);
--EXIT WHEN move_posts%NOTFOUND;
COMMIT;
CLOSE move_posts;
END LOOP;
END;

That should not be necessary because I get the value of ID out of another table, where I generate ID with a sequence..
So normally it should just tranfer that row from one table to another. But it doesn't !
Knowing that I cannot create a row in the table wouter_published_posts(I can just move rows from the add_post table to the wouter_published_posts table), It should be inpossible that twice the ID appears. But yet he keeps trowing errors...
help me, please

Similar Messages

  • ICal move events from one calendar to another with AppleScript

    I made an AppleScript to clean up my calendars and thought I would share. My iMac had a calendar called "Home" and my iPhone had a default calendar "Calendar" so I ended up with all of my events spread across two calendars. Decide to clean up and move everything to one calendar.
    This script is admittedly not very efficient. The nested repeat loops means it takes a while to run. Feel free to take this as a start point. I have it checking each property for missing value before adding it to avoid errors. I could have added a line to delete the old event after creating the copy, but I was just deleting the whole old calendar after the script ran.
    I hope this is helpful to someone. Oh, this was created under Snow Leopard so if you are in Lion you might need to tweak things. I don't know how much the scripting library has changed.
    tell application "iCal"
              set thisCalOld to calendar "OldCalendarName"
              set thisCalNew to calendar "NewCalendarToMoveEventsTo"
              set cntrMatch to 0
              set cntrCopied to 0
              repeat with thisEventOld in events of thisCalOld
                        repeat with thisEventNew in events of thisCalNew
                                  set isOKtoProceedWithCopy to true
                                  if (start date of thisEventNew = start date of thisEventOld) and (summary of thisEventNew = summary of thisEventOld) then
                  --Don't copy
                                            set cntrMatch to cntrMatch + 1
                                            set isOKtoProceedWithCopy to false
                                            exit repeat
                                  end if
                        end repeat
                        if isOKtoProceedWithCopy then
                                  set theStamp to stamp date of thisEventOld
                                  set theAllDay to allday event of thisEventOld
                                  set theURL to url of thisEventOld
                                  set theRecur to recurrence of thisEventOld
                                  set theEndDt to end date of thisEventOld
                                  set theClass to class of thisEventOld
                                  set theStartDt to start date of thisEventOld
                                  set theDesc to description of thisEventOld
                                  set theSummary to summary of thisEventOld
                                  set theLoc to location of thisEventOld
                                  set theExcludeDt to excluded dates of thisEventOld
                                  set theSeq to sequence of thisEventOld
                                  set theStatus to status of thisEventOld
                                  tell thisCalNew
                                            set thePropList to {}
                                            if theStamp is not equal to missing value then
                                                      set thePropList to thePropList & {stamp date:theStamp}
                                            end if
                                            if theAllDay is not equal to missing value then
                                                      set thePropList to thePropList & {allday event:theAllDay}
                                            end if
                                            if theURL is not equal to missing value then
                                                      set thePropList to thePropList & {url:theURL}
                                            end if
                                            if theRecur is not equal to missing value then
                                                      set thePropList to thePropList & {recurrence:theRecur}
                                            end if
                                            if theEndDt is not equal to missing value then
                                                      set thePropList to thePropList & {end date:theEndDt}
                                            end if
                                            if theClass is not equal to missing value then
                                                      set thePropList to thePropList & {class:theClass}
                                            end if
                                            if theStartDt is not equal to missing value then
                                                      set thePropList to thePropList & {start date:theStartDt}
                                            end if
                                            if theDesc is not equal to missing value then
                                                      set thePropList to thePropList & {description:theDesc}
                                            end if
                                            if theSummary is not equal to missing value then
                                                      set thePropList to thePropList & {summary:theSummary}
                                            end if
                                            if theLoc is not equal to missing value then
                                                      set thePropList to thePropList & {location:theLoc}
                                            end if
                                            if theExcludeDt is not equal to missing value then
                                                      set thePropList to thePropList & {excluded dates:theExcludeDt}
                                            end if
                                            if theSeq is not equal to missing value then
                                                      set thePropList to thePropList & {sequence:theSeq}
                                            end if
                                            if theStatus is not equal to missing value then
                                                      set thePropList to thePropList & {status:theStatus}
                                            end if
                                            set theNewCopy to make new event at end with properties thePropList
                                  end tell
                                  set cntrCopied to cntrCopied + 1
                        end if
              end repeat
    end tell
    display dialog ("Exists(not copied):" & cntrMatch & "  New Copied:" & cntrCopied)

    That should not be necessary because I get the value of ID out of another table, where I generate ID with a sequence..
    So normally it should just tranfer that row from one table to another. But it doesn't !
    Knowing that I cannot create a row in the table wouter_published_posts(I can just move rows from the add_post table to the wouter_published_posts table), It should be inpossible that twice the ID appears. But yet he keeps trowing errors...
    help me, please

  • File move from one dir to another with SXPG_COMMAND_EXECUTE

    Hi all,
    Need some help in using UNIX COMMAND with SXPG_COMMAND_EXECUTE.
    I need to move files from one directory to another with MV command,so anybody have any idea regarding the same?
    If any sample code then that will be really gr8.
    Its urgent requirement so pls do the needful
    Thanx in advance

    Hi
    You will have to create external operating system command in SM69 to use with SXPG_COMMAND_EXECUTE. Pass the command name that you create in sm69 to this FM .
    You would need authorization objects S_LOG_COM, S_RZL_ADM to be able to successfuly use this FM.
    Regards
    Kalpana

  • Move VM from one server to another using Local Repositories

    There is the following structure:
    ovhost-01 with first_repo
    ovhost-02 with second_repo
    Oracle VM version: 3.1.1
    Both first_repo and second_repo are Local Repositories.
    On ovhost-01 I have VM named "TestOVM" with status Stopped .
    Task:
    Move VM from ovhost-01 to ovhost-02 using "Clone or Move" section from VM Manager ( http://docs.oracle.com/cd/E27300_01/E27309/html/vmusg-vm-manage.html#vmusg-vm-move )
    Whenever I try VM moving virtual disk stays on the first_repo.
    With shared NFS-storage this feature working well.
    Question:
    Is it possible to move VM from one server to another with Local Repositories ?

    Neither ovhost-01 nor ovhost-02 have access to each other. It move or copy... the admin server that is connected to the local repository would have to have access to the target repository.

  • Are there any APIs to move funds from one project to another?

    Hi,
    Are there any Project/Budget APIs to move funds from one project to another with in the same grant or different grant in R12?
    Thanks,

    Hi
    There are API's to load or update budget line amounts, PA_PROJECT_PUB.
    There are API's to load or update agreements and allocate funds to projects, PA_AGREEMENT_PUB
    Dina

  • Move Itunes from one computer to another

    does anyone know how I can move my Itunes from one computer to another with out losing any of my library content. Also, is it possible to copy music from Ipod to Itunes library?

    Have a look at this article in the Apple Knowledge Base and Hudgie's User Tip . Post back if you need any clarification.

  • I want to move ebooks from one computer to another.

    I want to move ebooks from one computer to another.  Both have Digital Editions installed.  Older one 2.0 ver has books installed.  Newer one has ver 3.0 no books installed.  Both are authorized with the same user id.  Do I have to upload from older machine to cloud first?  How do I do that?  Do I have to manually transfer files?  How do I do that?  Can I get pointed to online directions someplace?

    Figured it out.  Copy files to new computer and add to library from digital additions.  duh.  Why was it some much easier to figure out answer once I posted the question?

  • Can ypou move songs from one ipod to another?

    Is there a way to move songs from one way to another, if so can you tell me.

    Be very careful when connecting an iPod full of music to an empty iTunes library.There is very real risk of permanently losing all the music.
    To prevent auto sync, connect the iPod whilst holding down the 'control+shift' keys and do not let them go until your iPod appears in iTunes.
    If you see a message that your iPod is associated with a different library and asks if you want to link to a new one, make sure you press "Cancel".
    If you should click on "Erase and Sync" will erase all the content currently on your iPod and it will be replaced with the content of the iTunes library you just connected to.
    When you've pressed cancel your iPod should appear in the iTunes source list under "devices" and allow you to change the update setting to manage the iPod content manually, and that will let you use your iPod for the time being without the risk of accidentally erasing the contents.
    Then do any of the following to transfer your music from iPod back to the computer/iTunes.
    For iTunes version 7 or later, then you can transfer purchased iTunes store music from the iPod to an authorized computer by using the "file/transfer purchases from iPod" menu. Note that the maximum of 5 authorized computers applies here.
    Find out how to do that here.
    How to copy iTunes purchases from an iPod or iPhone to a computer.
    For all other non purchased content (your own CDs etc), check out the instructions/suggestions here.
    Music from iPod to computer (using option 2). This a manual method using "hidden folders" and although it works, it is a little more involved than other methods.
    Much easier ways are to use one of the many 3rd party programs that copy music from the iPod to the computer.
    One of the most recommended is Yamipod. This is a free program that transfers music from iPod back to the computer. However, it does not transfer playcounts/ratings etc.
    Other free programs are Pod Player, SharePod and Floola and iDump and iPodRobot.
    If you want to recover just the structure of playlists from the iPod (and not the actual song files themselves), there's iRepo for Windows. which I understand has this feature along with all the standard features for these programs.
    iPodRip also has the feature enabling you to reconstruct playlists.
    There is also CopyTrans. This does preserve ratings/playcounts etc if those are important to you but this program is not free. It also supports video transfer.
    More information is contained here.
    Copying content from your iPod to your computer - The Definitive Guide.

  • How do I move clips from one Event to another?

    How do I move clips from one Event to another?
    As soon as I got the new iMovie, I started importing clips and making video's. Unfortunately, I hadn't fully understood the Events feature, so all of my clips are in a single "New Event" Event. I have now created several other Events and named them properly and would like to sort all of my clips into their proper "Event" folders. How do you do that?

    Ahh, Ok. I actually had to go to Lynda.com to watch a training video of this highly bassackwards maneuver, but now I have it. In other words, while the intuitive thing is to make a new event to hold the clip you want and then open the old event and drag the clip into it's new event, the only way to accomplish this maneuver is to NOT create a new event, but rather, go to the clip AFTER the one you want to move, select it and then Right-Click on it and select SPLIT EVENT BEFORE SELECTED CLIP (or go to FILE>SPLIT EVENT BEFORE SELECTED CLIP). Then you wait a few seconds while the program thinks a bit (no feedback it is doing this - just a pause) and then it automatically creates a new event with the clip you wanted. Now just double-click the new event and name it something meaningful.
    Thanks for your help!

  • How do I move pictures from one library to another?

    How do I move pictures from one library to another?

    For just a few export them out of Library A via the File ➙ Export ➙ File Export menu option with Kind = Original and import them into Library B.
    However, this will not include any edits or metadata (keywords, titles, etc.) that you've added.
    To get the original image, any edits and all metadata, keywords, titles, descriptions, places, etc., you'll need the paid version of  iPhoto Library Manager.  It can copy albums or events from one library to another and keep those items I mentioned earlier with the photos.
    OT

  • How do i move pictures from one iphone to another?

    How do I move pictures from one iphone to another?

    Photos in the Camera Roll are included with the iPhone's backup. You can transfer the backup from one iPhone to another which will include all data included with the backup.
    Photos and videos in the Camera Roll can be imported by your computer. After importing from one iPhone, the photos can be transferred to another iPhone via the iTunes sync process.
    Photos in the PhotoStream on one iPhone running iOS 6 can be made available on another iPhone running iOS 6 by creating a shared PhotoStream album, or if the same iCloud account is accessed on both iPhones, the PhotoStream album will be identical on each iPhone.

  • How do I move apps from one page to another?

    How do I move apps from one page to another?

    From a previous thread:
    Touch and hold any icon for a couple of seconds. They'll all start to wobble. Touch and drag the one you want to move to the side of the screen and the next screen will appear; drop the icon on whatever screen you want it on.
    You can also do it quicker in iTunes - connect the phone and click the Apps tab in the main window. You'll see a picture of your phone with the apps laid out. Just click and drag

  • Move files from one folder to another

    I am brand new to the application and have spent a ton of time googling various topics, but need some additional help. Seems easy enough, but I can't figure out how to do it...
    I would like to move pics from one folder to another. I can drag files from one folder to another, but they still reside in the original folder as well. Is there a way to cut and paste or a similar function to accomplish this move?
    Thanks.

    Hey, HawaiianHaole, as a multidecade Mac user, let me tell you, Aperture is about the worst example of Mac-iness one could imagine. Ironic, as it's (of course) made by Apple. But it is so inflexible, and insists so vociferously on making the user learn its peculiar interface conventions it reminds me most of something out of that famous company in Redmond.
    Want your Projects in an order you choose? Sorry! Want to arrange your windows so you can see your list of chat buddies while you're working in Aperture? Nope, can't do it! Aging eyes have trouble reading tiny grey type on a grey background? Hey buddy, it was your choice to grow old, don't blame us!
    But all is not lost. Aperture has gotten considerably better of late (versions up to 2.0 were fundamentally unusable in many ways) and will hopefully continue to improve. (ie Maybe they'll fix the printing thing...)
    Please don't make Aperture the basis for your judgement of the Mac OS. Many long time Mac users are having as much trouble with Aperture as you. Mac OSX has significantly reduced customizability but at the benefit of much improved stability and indeed usability. Old school Mac users had to learn to accept this, which most did. You'll hear people talk about the "Way of the Steve". As irksome as Aperture can be, you'll actually have a better time of it if you adopt the Way of the Steve, and accept that you can't do things the way you might want to. This is imho antithetical to the original Mac many of us knew and loved, but it's the way things are today, so we mostly shut up and take it. You can fight with your software all day, or just accept that there are ways you have to adopt and adapt to them.
    Welcome to the Bright Side, hope your Mac experience improves.

  • Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.

    Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.
    Is there any way to re-number them in the order I have chosen so that they can then be sorted by number? The scans are all from pre-digital images that I wish to move to a photobook and I don't want to have to organise them twice!
    Thanks for any suggestions.

    I was a bit short, Chris, sorry. It is limited, what can be posted, when typing on an iPad.
    Now I am back on my Mac. I meant the following:  Batch Change the date for a large range of photos, that should have a date stepped in increments.
    Select all Photos at once and use the command "Photos > Batch Change".
    Then set the date for the first photo and select an increment, e.g. one minute.
    Now all photos will get a new date assigned, incremented by one minute, in the sequence you have selected. So you will be able to sort them by date.  This way it will be unnecessary to change the titles or filenames.

  • Is there a way to move files from one folder to another without copying and pasting and then going back to delete the original?

    Is there a way to move files from one folder to another without copying and pasting and then going back to delete the original?  The cut and paste function is not available and there's no "move to" function.  Am I missing something?  It was so easy with Windows.

    Drag the files, or press Option when pasting them; this accesses the Move To function.
    (124070)

Maybe you are looking for