Delete if "export" is successful?!

Hi there!
I've got something special which is driving me mad at the moment :-)
What I want to do is the following.
# "export" records (append) into a file on the filesystem via a select-statement ( select ... WHERE datetime < SYSDATE - 90;) in the format "insert into <table> values (...);".
# If this is done correctly (without any errors, 0 affected rows doesn't count), delete these lines via a delete-statement (delete ... WHERE datetime < SYSDATE - 90;)
# I want to pack these Oracle instructions into wrapper-shell scripts like
#! /bin/sh
ORACLE_HOME=/oracle/ADM/920_64; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin; export PATH
sqlplus /nolog <<EOF
connect <user>/<password>@<system>
@/oracle/ADM/admin/ADM/scripts/<sqlstatements>.sql
EOF
Any help is appreciated (especially ways how to "export" data to the filesystem)

To export your data to a file you can either use SQL*Plus to "spool" the data out view select statements. You can use the formatting options to produce comma-delimiteres (set colsep ,) and you can mess around with setting to eliminate headings, feedback etc. Have a look at the sql*plus docs for all the options available. You can also use UTL_FILE package to write out to a file. THis would need some form of PL/SQL loop to go through a format your result sets (i.e. in a Cursor FOR LOOP).
The PLSQL loop may be better as you would have better control over what data was succssfully exported, you can delete through a collection of ROWIDs which have been "exported", and you can control your commits etc.
Rgds
Dave

Similar Messages

  • Function module names to delete the Export Datasource

    Hi Experts,
    Can anyone please let me know what function modules are while deleting the export datasource. So far in my research i have found only
    RSB1_DELETE_EXPORT_DATASOURCE. -- This fm does not deletes the export datasource, I want to know which fm is used exactly to delete the datasources.
    To delete the virtual infocubes, the fm used is RSDG_CUBE_DELETE. Similarly there must be a fm to delete the export datasource.
    Please help.
    Thanks,
    Prashant.

    Hi Reddy,
             I hope there is no specific function module to delete the entries ( as of version 4.0). So you need to code a delete statement to perform the task.
    Thanks,
    Siva.

  • How to: Deleting a Exported Datasource

    Hi Guys,
    Does anyone know how I can delete an export datasource in BWdev.  I have deleted the source system (BW system) and the trans rule, comms structures and infosource for exported data source.  However the original source cube still shows the green 'maintain export datasource' icon next to it.  How can this be reomoved?
    Thanks
    Depesh

    Hi Depesh,
    go to transaktion SBIW and delete the datasource.
    Postprocessing of DataSources -> Edit DataSources and Application Compponent Hierarchy -> BW -> DM -> Find your datasource.
    hope that helps,
    Michael
    Message was edited by: Michael S

  • Export terminated successfully with warnings.

    Hi,
    I have a 9i database (9.2.0.8.0) running on a HP Unix machine (B.11.11). The database size is 170GB.
    When I run a full database export, I get couple of ORA-01403 error.
    EXP-00008: ORACLE error 1403 encountered
    ORA-01403: no data found
    But the end of it, it shows Export terminated successfully with warnings.
    Is my export backup valid or do I need to solve the ORA-01403 issue? And how do I solve that?
    Request your quick help on this1
    thanks!

    I checked the Oracle Support notes, but it says that the cause is due to the FILESIZE parameter. But we have not used the FILESIZE parameter in our environment.
    And there are enough space in the file system too. So I dont think the spacing is an issue here.
    userid=dba_backup/xxxxxx
    file=xxxxxx.dmp
    compress=n
    consistent=y
    full=y
    rows=y
    direct=yThe solution mentioned in the note is:
    Solution
    -- To implement the solution, please execute the following steps::
    Add more files to the file= list to make sure there is enough space available for the export.How do I do that? file=xxxxxx.dmp, yyyyyy.dmp is it?
    Thanks!

  • Can i delete my exported bookmark html file after i have re imported it and merged it with my restore of my old bookmarks? Same with the json file?

    I have recently reinstalled my OS on a new drive and have just successfully restored my old bookmarks and imported any new bookmarks I had saved since the OS install. I just want to know know if it is safe to delete the json file i restored from since this was on the old drive I want to format and can I also delete the html file i created by exporting my new bookmarks before i started this process?
    Marc

    You can keep a backup copy of that old file or make backups of the JSON backups on the new computer.<br />
    You can decide for yourself if you would have a usage for that file.<br />
    If all bookmarks have been restored successfully then you won't need this backup and you can create a new backup regularly if you have modified or added bookmarks.
    *http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • Exporting slideshows successful but no audio

    I exported a slideshows from iPhoto 09, but the resulting file has no audio in it. The problem started to occur after I downloaded and run the latest iPhoto update (version 8.0.4).
    The slideshows itself can play well (with audio) during "preview" and "play" inside iPhoto. Can someone help resolve this issue? Thanks!
    Note: Before the update, I have successfully exporting various slideshows using various themes.

    I found a solution to this issue. It is possible that deleting certain preferences fixed it, but the Cache for iPhoto was not allowing the "fix" to work.
    So here's what I did (and all of it might not be necessary, but I don't know which fix actually work since I deleted the Cache info in the user folder and it started working again).
    Macintosh HD --> Users --> Home Folder --> Library --> Preferences
    Deleted the following:
    com.apple.iPhoto.plist
    com.apple.quicktime.plugin.preferences.plist
    com.apple.quicktimeplayer.plist
    Macintosh HD --> Users --> Home Folder --> Library --> Caches
    I'm assuming you could just dump the com.apple.iPhoto folder BUT I dumped the whole thing (because at this point I was quite frustrated).
    It works like a charm now. I wanted to share this with you so that you would know that it has been fixed by someone who had the some problem. I do hope this works for all of you.

  • Need help on deleting after exporting to IDML

    Hi Forum,
    I have a script to export all the "indesign files" found inside the folder... and then remove all the indesign files...
    Instead, Can i have a help to delete....
    the indesign file after exporting to IDML and then
    continue opening the next indesign file, exporting to IDML and deleting it...
    then continue file3....
    The below is the script open indesign files and export to idml and then remove all the files inside the folder Desktop/GENERAL_CS6-IDML/IN_CS6
    var mySourceFolder = Folder("Desktop/GENERAL_CS6-IDML/IN_CS6");
    var myOutFolder = Folder("Desktop/Completed");
    //var Indd_files = get_Files(mySourceFolder,[], ".indd");
    var Indd_files = mySourceFolder.getFiles (/\.indd|\.INDD/i);
    //var Indd_files = get_Files(mySourceFolder,[], ".indd");
    if(Indd_files.length>0)
        for(var w=0;w<Indd_files.length;w++)
            try{
                 app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
                myDoc = app.open(File(Indd_files[w]));
                 app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
                 var myDocNam = stripExt((Indd_files[w].name).replace(/%20/g," "))+"idml";
                 myDoc.exportFile(ExportFormat.INDESIGN_MARKUP, (File(myOutFolder+"/"+myDocNam)));           
    //          myDoc.save(File(myOutFolder+"/"+myDocNam));
                app.activeDocument.close(SaveOptions.no);
            }catch(E){}
    try {
    var copyFolder1 = Folder("Desktop/GENERAL_CS6-IDML/IN_CS6");
    var myFiles2 = copyFolder1.getFiles(/\.indd|\.INDD/i);
    for ( i = myFiles2.length-1; i >= 0 ; i-- ){
    myFiles2[i].remove();
    } catch (e) {}
    Many thanks for the support..

    I hope this is what you expected.
    You can try the following code:
    var mySourceFolder = Folder("Desktop/GENERAL_CS6-IDML/IN_CS6");
    var myOutFolder = Folder("Desktop/Completed");
    //var Indd_files = get_Files(mySourceFolder,[], ".indd");
    var Indd_files = mySourceFolder.getFiles (/\.indd|\.INDD/i);
    //var Indd_files = get_Files(mySourceFolder,[], ".indd");
    if(Indd_files.length>0)
        for(var w=0;w<Indd_files.length;w++)
            try{
                 app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
                 var myFile = File(Indd_files[w]);
                myDoc = app.open(myFile);
                 app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
                 var myDocNam = stripExt((Indd_files[w].name).replace(/%20/g," "))+"idml";
                 myDoc.exportFile(ExportFormat.INDESIGN_MARKUP, (File(myOutFolder+"/"+myDocNam)));          
                app.activeDocument.close(SaveOptions.no);
                myFile.remove();
            }catch(E){}
    Green4ever

  • Script or way to delete or export random pages from pdf...

    hello
    I have many request to export random pages from pdf doc. etc.. 1-3,51,63,78-92...I think that easy way is to have some script which will open dialog box and ask for which pages I want to export or delete from pdf. Anyone have something for this?
    thanks

    I find way for this on adobe blog. I am so stupid that I miss this "choose pages" button!!! You can combine more files and in list select pdf, and choose which pages from individual doc you want. Great
    http://blogs.adobe.com/educationleaders/2008/05/extracting_non_sequential_page.html

  • Deleted clips - exporting?

    Hello,
    during a general iPad cleanup I deleted some old photos. Accidentally, I also deleted an iMovie video (in Camera Roll) and some of its source files. Although I cannot export the project, I am still able to view a fluent preview of the video in iMovie, with the missing clips. Where is the file with the preview, because the clips are gone and They are still visible in the preview. I need to export this preview file so I can view it in Camera Roll again. Where is the preview file (and PLEASE don't tell me Apple doesn't officially support programs like iExplorer if needed)?
    Best regards!

    You know the answer already, so I won't tell you as asked.
    We cannot discuss JB or non apple approved software on this forum.
    I suggest you do a google search.
    You will find no answers here.

  • How do I check the delete database table is successful?

    After delete all the records from the database table, how do I check it is successful?  When do I need to 'commit'?  (after delete table or after insert new data?)
    Thanks,
    Helen

    Hi,
      Check sy-subrc = 0..
      DELETE ZTABLE..OR INSERT ZTABLE...
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'DATABASE DELETE FAILED'.
      ELSE.
        COMMIT WORK...
      ENDIF.
    Thanks,
    Naren

  • Query SQL code gets deleted after export to Excel. "Query must have at least one destination field"

    Hi all,
    I'm getting really frustrated by this Access error. It happens when I export the result of a query through an Access macro to Excel, the first time it runs well but the next time, there is a chance that the query won't run and the error "Query
    must have at least one destination field" will be displayed. After that, I try to check the query SQL code and discover the code has vanished. I'm using simple Select query without joins, only "where", "group by" and "order by"
    statements.
    Thank you in advance for your help,
    Jesus 
    Edit:
    One of these queries are like the following (all of them are of this type):
    SELECT Field1, field2, field3, field4, field5, Sum(Field6) AS SumOfField6, Sum(Field7) AS SumOfField7
    FROM Table1
    WHERE Field6 is not null
    GROUP BY Field1, field2, field3, field4, field5
    Order By Sum(Field6) desc

    Hi Peter, 
    Thank you for your response, I updated the original question with one of the codes.
    Thanks,
    Jesus

  • Message not deleting from Topic after successfully dequeue

    Hi All,
    Help please..
    I need to design a process where message have to produce into a AQ JMS topic and later i have to consume the message from the same topic and publish to a Queue.
    In order to move on this i have created a sample My_Topic1 and My_Queue1 with below syntax
    Topic:-
    EXEC dbms_aqadm.create_queue_table (queue_table=>'MY_Topic1', queue_payload_type=>'sys.aq$_jms_text_message', multiple_consumers=>true );
    EXEC dbms_aqadm.create_queue(queue_name=>'MY_Topic1', queue_table=>'MY_Topic1');
    EXEC dbms_aqadm.start_queue(queue_name=>'MY_Topic1');
    Queue:-
    EXEC dbms_aqadm.create_queue_table (queue_table=>'My_Queue1', queue_payload_type=>'sys.aq$_jms_text_message', multiple_consumers=>false);
    EXEC dbms_aqadm.create_queue(queue_name=>'My_Queue1', queue_table=>'My_Queue1');
    EXEC dbms_aqadm.start_queue(queue_name=>'My_Queue1');
    Now i created Foreign server and create local and destination topic of queue.topics name and also created Data source of XAType.
    Now my bpel process getting a message(which as one element of sting type) from a web service and i am producing the same message to Topic. Once the message published to topic in a separate composite my JMS Adaptor dequeue/Consume the message from the topic and subscribe it to queue.
    The Above scenario working as expected but here what my observation on this
    1)When i dequeue message from a topic using bpel process successfully i am able to subscribe the message to queue but the message still remain in the topic i think it suppose to get of the topic once successfully dequeued.
    Even i check the subscriber topic table and one subscriber is listening to the topic.
    2)If in case any error generated at the time of subscribing to the queue the message should rollback( because i am using XA Transaction) but i think it is not happening as i can see in my topic view aq$my_topic1 MGS_STATE changed to PROCESSED.
    Can some one please let me know where i am going wrong.
    Thanks in advance.
    Regards,
    Tarak.
    Edited by: Tarak on Sep 9, 2012 8:47 PM

    The behavior should be the process consume a message from the topic and will try to do its job. If this process fail, {code]
    But in this message not there in topic even it is failed in soa process.....i am very much interested how this XA is  working that the reason i am trying all this.What to do with a failed/expired message is usually configurable, but doesn't make sense to place it in the same topic again... If the messages are failing too quickly better to adjust the max_retries and retry_delay...I agress in real senario we will move to error queue. But in that case also some how we need to read the message from queue and publish to the end system.
    I am just trying to understand the behavior and what i came to know is after all the retire fails message not going to topictable _E. But when i pass Expire time property or time to live then it is moving to error table.What do you mean? What server was restarted, the database or the soa server? Messages that still didn't reach the max retry number will still be retried...Wheni am bouncing my managed server soa_server1 i can see the invoke activity is trying to publish the message into queue... this is happens after server restart and suppose not to happen....
    But thanks alot for the inputs...
    Regards,
    Tarak.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Export terminated successfully with warnings, warning is ignoreable

    Is this waring ignorable?
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production
    Export done in US7ASCII character set and AL16UTF16 NCHAR character set
    server uses WE8ISO8859P1 character set (possible charset conversion)
    Note: table data (rows) will not be exported
    About to export the entire database ...
    . exporting tablespace definitions
    . exporting profiles
    . exporting user definitions
    . exporting roles
    . exporting resource costs
    . exporting rollback segment definitions
    . exporting database links
    . exporting sequence numbers
    . exporting directory aliases
    . exporting context namespaces
    . exporting foreign function library names
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions
    EXP-00097: Object type "SYSTEM"."ValidateTravelBookingRS102_T" is not in a valid state, type will not be exported
    "q17alsn.log" 622 lines, 32848 characters
    EXP-00097: Object type "SYSTEM"."ErrorType100_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."TravelSegmentType99_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."Address98_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."ValidateTravelBookingRQ96_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."TravelSegmentType95_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."Address94_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."ValidateTravelPlanRS92_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."ErrorType90_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."TravelSegmentType89_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."TravelSegmentType87_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."MemberInfoRS85_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."ErrorType83_T" is not in a valid state, type will not be exported
    EXP-00097: Object type "SYSTEM"."MemberInfoRQ81_T" is not in a valid state, type will not be exported
    . exporting system procedural objects and actions
    . exporting pre-schema procedural objects and actions
    . exporting cluster definitions
    . about to export SYSTEM's tables via Direct Path ...
    . . exporting table AQ$_INTERNET_AGENTS

    The object type"s status is invalid which may be caused by a dependant type"s modification without cascading the change. You must have the type recompiled using ALTER TYPE COMPILE prior to performing the export operation.
    ~ Madrid

  • DATA Export not success

    Hi,
    Below is the script I am using to export...the problem is that it is generating the log file but not generating the txt file in the same path.
    I tried with the database->Rightclick->export->filename......it is showing succeeded but not generating file.
    What I am missing here? Please help.
    spool on to '\\Meta\CubeRef\data_EXPORT.log'
    LOGIN testuser ****** ON testmach;
    export database 'TEST_AP'.'TEST_CU' level0 data to data_file '\\Meta\CubeRef\data_EXP.txt';
    Thanks in advance

    You might want to try the following per the tech ref:
    A file name or an absolute path to a file. If the string contains special characters, it must be enclosed in single or double quotation marks. Double quotation marks allows variable expansion; single quotation marks does not. If the file path contains a backslash ( \ ), it must be preceded with another backslash ( \\ ) to be interpreted correctly by the MaxL Shell.
    Examples:
    file01
    'D:\\filename'
    "$ARBORPATH/errors.txt"
    "$ARBORPATH\\app\\sample\\basic\\calcdat.txt" (double quotation marks to expand the variable)
    '/homes/fiona/scriptfile.msh' (UNIX file path)
    Double back slashes....
    You may find the export file "\\Meta\CubeRef\data_EXP.txt'" has been created in the app folder.

  • Viber on iPad not working - icon is there but when I tap it it opens for a few seconds and then closes.  Have deleted and reloaded withoutr success

    Viber on iPad not working although it was fine last time I used it.  When I tap on Viber icon the Viber page opens but after a few seconds disappears and I'm back where I started.  Have deleted Viber and reloaded but it hasn't solved problem

    There have been number of threads over the last few days about Viber no longer working e.g.
    https://discussions.apple.com/message/22663682#22663682
    https://discussions.apple.com/message/22669304#22669304
    https://discussions.apple.com/message/22653073#22653073
    The first one of those has a reply from somebody who says that they are from Viber and that they are working on a fix

Maybe you are looking for

  • Can't rent/buy a movie in iTunes

    I've been interested in renting or buying a couple of movies recently.  I searched for them in iTunes on my iMac.  They showed up in the search results, but they buy and rent buttons were greyed out.  I've seen this before where the buy buttons were

  • Multi data sources with a mismatch of fields

    Post Author: [email protected] CA Forum: General Hi, I'm writing a crystal report (using crystal XI), pulling data from two different databases.  The first issue is how to display these concurrently - I'm guessing the best option is to build t

  • Wrong aspect ratio in Survey view

    I selected 3 photos and went to the Survey view. Of these photos, 2 were full frame, and 1 was cropped so it has a wider aspect ratio than the full-frame pictures. Survey view showed all 3 the same size, so the cropped one was stretched vertically an

  • Mouse Over Format Control for Series

    I have a combination chart and would like to display the column portion with no digits after the decimal.  I would like to display the line portion with 1 digit after the decimal. Will Xcelsius allow individual formatting of series or only global for

  • NESTED Tables for Sub-types when creating table for Super-type

    If I create the following types, as an example: Person with subtypes: Employee and Customer Appointment CREATE OR REPLACE TYPE Person_OT AS OBJECT ( person#                         NUMBER, personSurname                    VARCHAR2(50), personForename