Sending DELETE query from C++ scheduled program

hi all,
new Oracle user here (experiementing with 10g XE), can anyone help me with how to delete some records from a table from a C++ program? the records to be deleted will all have an expiry date in one column that has a date value older than the current system date
any help will be much appreciated!
jusef

As Vinendra pointed out you'll probably have to use PRO*C and invoke it from C++.
In PRO*C you'll use a SQL block to execute the delete statement. You can find examples if you search OTN and the internet.
Edited by: riedelme on Nov 24, 2009 5:23 AM

Similar Messages

  • How to call a BW Query from an ABAP program?

    How to call a BW Query from an ABAP program?

    hi
    check this link
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    hope this helps
    cheers

  • Sending an email from within a program

    Hi,
    I am using SO_DOCUMENT_SEND_API1 to send an email from a program. Everything works fine, but the users don't want to see the popup message titled 'SAPconnect Send Process - List of Sent Objects'.
    Is there anyway I can supress this message from the program, or is it a setting in SAPconnect?
    Thanks
    Lindy

    If your are calling RSCONN01 after your function module then remove the submit of RSCONN01. This program will run scheduled every 1 to 5 minutes anyway as background job by the basis .

  • How to send a file from a java program to a servlet and get a response

    Hi,
    How can I call a servlet from a standalone java program and send a file to a servlet using POST method and in return gets the status back from the servlet. Any help is appreciated any small sample will help.
    Thanks.

    Hi,
    I am trying the following sample I got from net and am getting the following error. Any help what I am doing wrongs:
    06/12/24 02:15:58 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
    06/12/24 02:15:58      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:294)
    06/12/24 02:15:58      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
    06/12/24 02:15:58      at mypackage9.Servlet1.doPost(Servlet1.java:38)
    06/12/24 02:15:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    06/12/24 02:15:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    06/12/24 02:15:58      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    06/12/24 02:15:58      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    06/12/24 02:15:58      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
    06/12/24 02:15:58      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    06/12/24 02:15:58      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    06/12/24 02:15:58      at java.lang.Thread.run(Thread.java:534)Here is the sample client code:
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.methods.PostMethod;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    public class PostAFile {
        private static String url =
             "http://192.168.0.17:8988/Vulcan_Materials-ServletPost2-context-root/servlet/Servlet1";
        public static void main(String[] args) throws IOException {
            HttpClient client = new HttpClient();
            PostMethod postMethod = new PostMethod(url);
            client.setConnectionTimeout(8000);
            File f = new File("C:\\load.txt");
            System.out.println("File Length = " + f.length());
            postMethod.setRequestBody(new FileInputStream(f));
            int statusCode1 = client.executeMethod(postMethod);
            System.out.println("statusLine>>>" + postMethod.getStatusLine());
            postMethod.releaseConnection();
    }Here is the sample servlet code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import org.apache.commons.fileupload.DiskFileUpload;
    import org.apache.commons.fileupload.FileItem;
    import java.util.List;
    import java.util.Iterator;
    import java.io.File;
    public class Servlet1 extends HttpServlet
      private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
      public void init(ServletConfig config) throws ServletException
        super.init(config);
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
        try
          response.setContentType(CONTENT_TYPE);
          PrintWriter out = response.getWriter();
          java.util.Enumeration e= request.getHeaderNames();
            while (e.hasMoreElements()) {
              String headerName=(String)e.nextElement();
              System.out.println(headerName +" = "+request.getHeader(headerName));
           //System.out.println("Content Type ="+request.getContentType());
            DiskFileUpload fu = new DiskFileUpload();
            // If file size exceeds, a FileUploadException will be thrown
            fu.setSizeMax(1000000);
            List fileItems = fu.parseRequest(request);
            Iterator itr = fileItems.iterator();
    System.out.println("***************************");
            while(itr.hasNext()) {
              FileItem fi = (FileItem)itr.next();
              //Check if not form field so as to only handle the file inputs
              //else condition handles the submit button input
              if(!fi.isFormField())
                System.out.println("\nNAME: "+fi.getName());
                System.out.println("SIZE: "+fi.getSize());
                //System.out.println(fi.getOutputStream().toString());
                File fNew= new File("C:\\", fi.getName());
                System.out.println(fNew.getAbsolutePath());
                fi.write(fNew);
              else
                System.out.println("Field ="+fi.getFieldName());
            out.println("SUCCESS123456: ");
          out.close();
        catch(Exception e)
          e.printStackTrace();
    }Any help on what is wrong.
    Thanks

  • Issues while sending automatic email from job scheduled via sm36

    Dear basis guys,
    We are on Netweaver 2004s, ERP 6 .
    I am scheduling (in SM36) a standard report output as background job, send its output to a pdf device and send this pdf automatically to email address. Everything is working fine except that I am not able to do the following:
    1. Cannot change the email title (APR****-spool request no.) and body from "The Mail Attachment Contains the Print File Created by User..."
    2. I need to send the email to several people.  Cannot use the distribution list with the pdf device. IF I use in sm36 "spool list recipients"  instead,  the attachment sent as pdf will result truncated. Not all report lines will show.
    Could someone help on any of the above?
    Thank you in advance for any input.

    Dear basis guys,
    We are on Netweaver 2004s, ERP 6 .
    I am scheduling (in SM36) a standard report output as background job, send its output to a pdf device and send this pdf automatically to email address. Everything is working fine except that I am not able to do the following:
    1. Cannot change the email title (APR****-spool request no.) and body from "The Mail Attachment Contains the Print File Created by User..."
    2. I need to send the email to several people.  Cannot use the distribution list with the pdf device. IF I use in sm36 "spool list recipients"  instead,  the attachment sent as pdf will result truncated. Not all report lines will show.
    Could someone help on any of the above?
    Thank you in advance for any input.

  • I can't send deleted files from i movie to the trash and delete them.

    I can't delete files. I bought a Lacie big quadra 4T and allmy project are saved there (mode raid1). When I’m trying to delete files theydoesn’t go to the trash bin but they are not longer in I movie. Apparently  they are still in the hard drive using space.How can I delete them or send them to the trash bin of my Macbook Pro?

    Okay I had the same problem but I figured it out.  When you go to choose file, all the links are greyed out.  Use two fingers simulatiously and click down on the file you want, then choose "quick look" from the option menu.  This will open a preview of your document and make the open button usable.  Close the preview, and then select the open button. 
    The site I was trying to use says it only supports IE, so maybe that is what causes the problem.
    Hope it works for you!

  • How to run a delete query from JSC

    There is a simple way to run this:
    delete from some_table where condition
    this statement will delete from 0 to n rows, depending on condition.
    Regards.

    There is a simple way to run this:
    delete from some_table where condition
    this statement will delete from 0 to n rows,
    depending on condition.
    If you want to first
    select ... from some_table where condition
    then delete one or more of those rows, the
    "Accessing databases: Performing Inserts, Updates, and Deletes" tutorial has some hints.
    If you just want to just execute a statement , such as
    any delete or update, then just use standard JDBC.
    For example:
    // Obtain a connection
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/<CreatorDataSourceName>");
    Connection conn = ds.getConnection();
    // make and execute the statement
    Statement stmt = conn.createStatement();
    stmt.execute("delete from xxx where ...");
    // find out how many rows were deleted.
    int rowsAffected = stmt.getUpdateCount() ;
    // Don't forget to close() in a finally clause!!!
    conn.close() ;

  • Execute a Query from a report sending it parameters and capture the result

    Hello everybody,
    Greetings from Peru, I want your help, Do you know how to execute a query from a report sending parameteres and capture the result in a internal table?
    The attached imaged has in red square the parameteres I want to send from a report.
    The idea is to have a JOB that executes everyday and parameters like DATE PERIOD will change automatically.
    Thanks for your time.

    Hi Enrique,
    You can call a query from a report by using submit statement.
    Every query has a corresponding program associated with it.
    Execute the query from SQ01. On te selection screen of query, goto SYSTEM  from menu and then click on STATUS, you will get program name (In this case aqzzzent_struct=zmm_ent_struc1). Use this program to call the query from your custom program.
    Also populate the rspar int table as per the selection criteria you want to pass to query.
       DATA: rspar     TYPE TABLE OF rsparams,
        wa_rspar  LIKE LINE OF rspar.
          wa_rspar-selname = 'SP$00001'.
          wa_rspar-kind = 'S'.
          wa_rspar-sign = 'I'.
          wa_rspar-option = 'BT'.
          wa_rspar-low  = s_cmp_cd-low.
          wa_rspar-high = s_cmp_cd-high.
          APPEND wa_rspar TO rspar.
       SUBMIT aqzzzent_struct=zmm_ent_struc1 WITH SELECTION-TABLE rspar AND RETURN.
    Thanks,
    Sachin

  • URGENT:Deletion  of Query from QA

    I want to delete query from Quality system.
    Proposed solution is deleting query in dev and then transporting same to QA.
    I am confused little bit if i use RSZDELETE command will it ask for request or i should simply delete query from query deisgner after assigning it to one request.
    Please provide me inputs regarding same as soon as possible.
    Rahul

    Rahul, you cannot Delete the already deleted Object again in Dev. SO, you are getting that error.
    You may have inconsistencies between Dev and  QAS. Look at the transport log of the Query. In the Log, it will state if the Query is deleted in QAS or it couldn't.
    If you need to re-transport the deletion, don't try to collect the deleted Query again. It won't work. Instead, talk to BASIS and COPY the Transport Request (the already released one with the Query deletion) into a new transport request and move it to BQ3 again.
    Also, sit with basis if neede dand analyze the transport log carefully. It will tell you what you need to know.
    NOTE: IF you are using the same query in workooks, etc in BQ3, it cannot be deleted. This is a problem, so also go to BQ3 and see a where else you are using the that Query different from DEV.
    Good luck
    Uday Chamarthy

  • Cannot delete files from batch file

    This is a test case.
    If  have the following in a .bat file. If I run it from CMD box, it works fine.
    forfiles /P c:\scripts\ /S /M u_ex*.log  /C "cmd /c del @PATH" > c:\scripts\output.txt
    But If I run it from a scheduled task, it generates the output.txt file which contains a list of the files it SHOULD have deleted, but nothing gets deleted.
    The scheduled task runs as a user who is member of administrators group, so has full permissions.
    I have also checked the box "run with highest privileges" 
    anyone know why it wont delete files from a scheduled task ?
    Snake

    Hi Snake,
    I'm glad the issue has been worked out, Please feel free to ask us if there are any issues in
    the future.
    If you have any feedback on
    our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • Sending RTF Emails from PLSQL To Outlook

    Hi,
    I am currently attempting to send an email from a plsql program to a Microsoft Outlook program in rtf format as I need the email to be in a particular format. I am using utl_smtp to do this along with rich text format codes. Unfortunately Outlook does not recognise the fact that the resulting email file is in rtf format and displays the item as plain text (i.e. it displays the codes).
    Is there any way that Oracle can force Outlook to accept this format ? I've tried adding application/rtf as the mime type in the connection string but all this does is send the email as a word attachment when really what we need is for the email body to be in rtf format.
    Thanks in advance,
    Paul.

    Hi,
    I think you will find this is not an Oracle problem. Outlook uses the mime type to decide which application to open it with. The associations between types and applications are buried somewhere in the registry. And if it's not the mime type, it's the 3 letter extension that's used (but you didn't say what extension you were giving the attachment).
    If you just open a .rtf file on this computer, the one with Outlook on, by double clicking it, what application does Windoze use to open it? I bet you will find it's Word.
    HTH
    Chris

  • Sending output generated to some other program all together

    Hi all,
    Is it possible to send the output, which will be the string normally to some other program alltogether.
    Say there is a java program which outputs a normal string and i have to send this string to a textbox
    in a webpage through this java program itself, I dont have any control on the webpage coz its
    just a page displayed on my browser, but i have to send this string from my java program to the
    textbox which is placed in some location on the webpage say ( x, y ) .
    Do any body have the idea how this can be achieved
    plzzzz do help
    One way is to copy paste but it becomes manual but i want it to be automatic.
    Thanks in advance

    import java.io.*;
    public class Two
      public static void main(String args[])
       System.out.println("hello");     
    public class One
      public static void main (String args[]) throws Exception
        Process proc = Runtime.getRuntime().exec("java Two");
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        System.out.println("value obtained:"+br.readLine());
    }if you run as java One you can get the value 'hello' written to the stream by another process i.e. class Two
    Instead of class One you can do teh same from a jsp......
    Would that help:

  • Send BW query results as HTML email from ABAP program

    I have published a code sample for sending BW query results as HTML email from ABAP program. if you have any questions or clarification, please post them here.
    the same can be accessed from this link.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b7658119-0a01-0010-39a9-b600c816f370
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

    OK forget about my earlier post.
    do the following changes.
    declare the following variables:
    data: xtext type standard table of solix .
    DATA: atta_sub TYPE sood-objdes .
    after the call of FM SCMS_STRING_TO_FTEXT add the following code.
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
      EXPORTING
        ip_solitab        = text
    IMPORTING
       EP_SOLIXTAB       = xtext .
    and after the following statement
    document = cl_document_bcs=>create_document(
                              i_type    = 'HTM'
                              i_text    = text
                              i_length  = conlengths
                              i_subject = subject ).
    add the following code
    CALL METHOD document->add_attachment
                EXPORTING
                  i_attachment_type    = 'htm'
                  i_attachment_subject = atta_sub
                  i_att_content_hex    = xtext.
    now you will have results both in the body as well as attachment. (this is for test you can remove one of them )
    Regards
    Raja

  • Schedule program in background & send output list as group email

    Hello all,
    I have a requirement where I have to schedule a job in background. If there happen to be an output, this output needs to be sent to the email id's stored in a Z Table.
    Please let me know how to proceed.
    Regards,
    Salil

    Hi ,
    yes you can do that..
    see the belwo steps...
    if sy-batch = 'X'.         "this means report is running in Background
    NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params.     "creating spool request
      WRITE : / text-s32.
      ULINE.
      LOOP AT t_ouputdata INTO wa_ouputdata.
        WRITE : /  wa_ouputdata.
      ENDLOOP.
      WRITE : / text-s33.
      NEW-PAGE PRINT OFF.                                        "closing spool request
    * To fetch the spool number from TSP01 table
      SELECT rqident
             FROM tsp01
             INTO w_rqident
             UP TO 1 ROWS
             WHERE rq2name = wa_pri_params-plist.
      ENDSELECT.
    * Function Module to Convert Spool to PDF file
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid     = w_rqident
          no_dialog       = 'X'
          dst_device      = 'LP01'
          pdf_destination = 'X'
        TABLES
          pdf             = t_pdf.
    "Call function and send the t_pdf data which contains output to email...
    "SO_NEW_DOCUMENT_SEND_API1 - Sending express mail ( SAP office )
    "RS_SEND_MAIL_FOR_SPOOLLIST - Send message from ABAP/4 program to SAPoffice.
    "SO_NEW_DOCUMENT_ATT_SEND_API1 - SAPoffice: Send new document with attachments via RFC
    ELSE.
    "call alv or normal display if you run report foreground..
    endif.
    Regards,
    Prabhudas

  • I received a "junk" email that I attempted to dispose of by sending it to "trash" and then deleting it from "trash". At that point, instead of deleting, it simply rotates back into "junk"--and over and over. How do I delete this unwanted email?

    I received a  "junk" email and attempted to dispose of it by sending it to "trash" and the deleting it from the trash file (the way I always do). This particular spam, however, instead simply rotates back into the "junk" file-- ad infinatum. How do I eliminate tis unwanted pest?

    Try logging on to your email via the web browser (assuming the email account is gmail, yahoo, etc) and deleting the email from there. It could just be that the email program on the iPad is not properly synching with the web server so the email keeps re-downloading.

Maybe you are looking for

  • After updating my Ipad Mini to IOS 8.02 videos keep on crashing and getting constant lag

    I have recently updated my Ipad Mini to ios 8 and it has not been cooperating. Whenever I try to watch a video on netflix or youtube it will crash after like 30 seconds or so. Also, when I try to click some buttons its super laggy to work. Thanks Ipa

  • Foreign character sets in a database

    I am developing a site where people in many countries (mainly Scandinavian) can log on and update their pages. The information, (including passwords and usernames) is stored in an access database. I am using Access because I have no knowledge of PHP

  • SQL Server Configuration Tools Disappeared

    I know I used to have Server Configuration Tools, but when I just looked for it, it seems like it has disappeared.  I'm looking at this. I'm getting this login error. I used to be able to reset SQL Server using the Configuration Tools, but now I can'

  • Deactivate option grayed out

    We recently purchased 2 RoboHelp licenses.  I am working on an automated install using the Adobe Application Manager Enterprise Edition and have done a test install and uninstall several times to a test PC.  Now that I am ready to deploy to the end u

  • Photoshop elements-Editing not opening

    When I open Organizer & access a folder of photographs to which I need to add text, I can only add only edit 5 or 6 and Elements 9 fails to open.  I then have to close the computer (not just Photoshop) down in order to start up again & then I can onl