Some examples in saving the output into memory

After running the class file i would like to save the results into memory, and then update the results in memory every time the program runs including the number of times it checked whatever it is going to check with the result of that checking. Then saving the results into a .txt file every time the program goes to sleep for an hour, as it has while(ture) loop.
Will storing data in a variable save it into memory?? (example if u can please)
I will be gratefull if you could tell/show me how to to save the results into memory and then update these results (i will need examples please). As having the program in a while(ture) loop and saving the result into a .txt file has been done.
Thanks a lot in advance.

i am sorry if i did not make myself clear, but i dont know how to do that, if there r any examples so I could understand it, i am sorry again. What i am trying to do is to store some information to memory and then update and retrieve these information later on and write it into a file, and do the same every hour.
I am sorry for not understanding it and for not making anyone to understand it.

Similar Messages

  • Need to split the output into files

    Hi,
    I have a query regarding splitting the output into different files. Please help to resolve that.
    I have have select query query...
    SELECT INDEX_NAME FROM DBA_INDEXES WHERE TABLE_NAME=<Table Name>;
    If it returns less than 4 indexes then we have create one table and have to move those into the files.
    For example...
    File_1.sql
    ====
    index1
    index2
    index3
    If select statement returns more than 4 indexes then we have create 4 files and have to splict those indexes and has to move to those 4 files.
    For example....
    If select statement returns 13 records then...
    File_1.sql File_2.sql File_3.sql File_4.sql
    ===== ====== ======= =======
    index1 index4 index7 index10
    index2 index5 index8 index11
    index3 index6 index9 index12
    index13
    Index no need to be in order in any file and any file can I extra index in it.
    Can be ok if we have any procedure or shell script. Please help me on this?
    We are using 10.2.0.1 oracle db. Please let me know if you need any thing else?
    Thanks
    Pathan

    Are you trying to put the output from SQL reports in different files?
    Some reporting tools can do this.
    You have a couple of options to do this.
    Some reporting tools support the functinality to write to different files.
    Another way is to write a PL/SQL procedure using UTL_FILE, which can open multiple files based on your conditions and to write to them as you need to.
    An older, less elegant solution is to write nested SQL*PLUS scripts spooling to different files with the queries you need. A top level script would invoke the others, something like (untested)
    --in first script
    @subscript1
    @subscript2
    --in subscript1.sql
    spool whatever.lst
    select *
       from dual;
    ...

  • Saving the output of a .sql file in .csv format

    Hi,
    I am saving the output of a .sql file in .csv format. But the problem is , the record of few columns have "new line" character in it, so when it is getting saved in .csv format, those records are coming in multiple rows, but they should come in one single row in single block. Please advise how to overcome this problem.
    Regards,
    Niraj

    Hi Guys,
    I guess, there is a misunderstanding.
    He is talking about the issue caused as a result of the data containing a "CRLF" ( Carriage return Line feed ) .
    That is mainly a data issue.
    The query i presume, must be right.
    I guess you should be able to fix it using some string functions.
    Some thing similar to this
    CREATE TABLE ASH (NAME VARCHAR2(10))
    SELECT REPLACE(NAME, CHR(13)||CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(13), 'ISH') FROM ASH;
    depending on the type of new line whether it is CR or LF. or CRLF.
    Regards
    Ashish/-

  • Update LIKP table while saving the output type in VT02N transaction

    Hi All,
    I have a requirement where i have to update Delivery Priority(LPRIO) field in LIKP table while saving the output type in VT02N transaction. I am not able to use the BAPI "BAPI_OUTB_DELIVERY_CHANGE" or FM "WS_DELIVERY_UPDATE" because, when we save the output type the programs that are configured in NACE are triggered in update mode and hence i will get a roll back error.
    Let me know other ways of updating the table at the time of saving output type for shipment transaction VT02N.

    This could be a result of one of the following reasons:
    1: Incorrect smart form/routine assigned in the output configuration (NACE)
    2: Serial number range of the delivery expired
    3: The default settings of the user (SU01) processing the delivery is missing the default printer name.
    Hope this is helpful
    Manish

  • Download the output into Excel...(List- export- spreadsheet)

    Dear friends,
    I want to download the output into Excel...
    I am using all SAP standards and using the ALV Block list
    Ex: List->export->local file.. is anable from here i can download to excell .....but the same there is anothere option : List->export->spreadsheet...( this one inactive.)
    I want to activate the List->export->spreadsheet option.
    how to do this???
    Thanks,
    Sridhar.

    Hi
       Use the Function Module:
    EXCEL_OLE_STANDARD_DAT
    For your purpose.
    But by default you can get the option to download into several formats including your desired one.
    Regards,
    Sreeram

  • I am looking at buying a new iMac but not sure if I need the Nvidia Geforce GTX 680 MX 2GB or put the money into Memory I will not be gaming

    I am looking at buying a new iMac but not sure if I need the Nvidia Geforce GTX 680 MX 2GB or put the money into Memory I will not be gaming
    New to the iMac and apple

    Welcome to the Apple Support Communities
    If you aren't going to use your Mac for anything special (Final Cut, Aperture, Photoshop, games...), you don't need that graphic card and you will save money.
    Also, as it looks like you are going to buy the 27-inch iMac, I recommend you to buy the Mac with 8 GB of memory, and then, buy the memory that your iMac needs in OWC or Crucial (the iMac supports 32 GB of RAM) > http://eshop.macsales.com/shop/memory/iMac/2012_27/DDR3L
    Doing this, you will save a lot of money. Also, it won't void the warranty of the Mac. If you need help installing the RAM, see > http://support.apple.com/kb/ht5540

  • Problem in saving the image into SQL database..

    Hello,
    In my application I have to save image file (say jpg) into the database and retrieve back and display it on the applet. I am through with grabbing the pixels of the image & sending the pixel array to the servlet but I am struck in how to store the image into the database and retrieve the same.
    Can anybody please help me in this regard... its really urgent...
    Thanks in advance
    Swarna

    Hello.
    I've been researching this problem (saving images in a MySQL database) in order to accomplish a task I was assigned to. Finally I was able to do it. I'd be glad if it will be of any use.
    First of all: the original question was related to an applet. So, the post from rkippen should be read. It says almost everything, leaving the code job for us. Since I managed to write some code, I'll put it here, but I'm not dealing with the byte transferring issue.
    To obtain a byte array from a file I'd open the file with FileInputStream and use a loop to read bytes from it and save them into a ByteArrayOutputStream object. The ByteArrayOutputStream class has a method named �toByteArray()� which returns an array of bytes (byte [] b = baos.toByteArray()) that can be transferred in a socket connection, as said by rkippen.
    My problem was to save an image captured by a web camera. I had an Image object, which I converted into a byte array and saved into the database. Eventually I had to read the image and show it to the user.
    The table in the MySQL database could be:
    CREATE TABLE  test (
      id int(11) NOT NULL auto_increment,
      img blob NOT NULL,
      PRIMARY KEY  (id)
    )I had problems trying to use the �setBlob� and �getBlob� methods in the Statement object, so I used the �setBytes� and �getBytes� methods . In the end, I liked these methods most because they where more suitable to my application.
    The database operations are:
        public int insertImage(Image image) throws SQLException {
            int id = -1;
            String sql = "insert into test (img) values (?)\n";
            PreparedStatement ps = this.getStatement(sql);  // this method is trivial
            byte [] bytes = this.getBytes(imagem); // * see below
            ps.setBytes(1, bytes);
            ps.executeUpdate();
            id = ps.getGeneratedKeys().getInt(0); //Actually I couldn't make this line work yet.
            return id;
        public Image selectImage(int id) throws SQLException {
            Image img = null;
            String sql = "select img from test where id = ?\n";
            PreparedStatement ps = getStatement(sql);
            ps.setInt(1, id);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                byte [] bytes = rs.getBytes(1);
                img = this.getImage(bytes); // * see below
            return img;
        }* If the bytes are read directly from a file, I think it is not necessary to convert it into an Image. Just send the bytes to the database method would work. On the other hand, if the image read form the DB will be written directly into files, the bytes obtained from rs.getBytes(1) would be enough.
    The image operations are:
        public byte [] getBytes(Image image) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                ImageIO.write(this.getBufferedImage(image), "JPEG", baos);
            } catch (IOException ex) {
                throw new RuntimeException(ex);
            return baos.toByteArray();
        public Image getImage(byte [] bytes)  {
            Image image = null;
            ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
            try {
                image = ImageIO.read(bais);
            } catch (IOException ex) {
                throw new RuntimeException(ex);
            return image;
        public BufferedImage getBufferedImage(Image image) {
            int width = image.getWidth(null);
            int height = image.getHeight(null);
            BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2d = bi.createGraphics();
            g2d.drawImage(image, 0, 0, null);
            return bi;
        }That's it. I hope it is useful.

  • How to  send the  output into separate file..(from spool)

    Hi  friends,
       i was create a  executable program  .. it was executing fine.. imagine.. my program is just  fetching  the data from MARA  table based on some conditions..  every thing is fine.. and i'm getting the output also..
           but i want to save this output in a separate file.. that means..  what can i do.. my program is  executing background... so, i want to save this out put in a file... so, can any one plz provide me the  coding steps...
            i dont know coding.. I'm learning ABAP... so, can you plz provide the exact coding..for storing these data into separate file from spool..
    help ful answers will be rewarded
    Thanks
    Babu

    hi
    if you want the o/p data in the seperate file in-addition to the spool
    call FM : 'GUI_DOWNLOAD'
    pass file name as
    w_localfile = 'C:\fite.txt'
    itab
    = the final o/p table                                                                               
    CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                = w_localfile
            filetype                = 'ASC'
            write_field_separator   = 'X'
          TABLES
            data_tab                = itab
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            OTHERS                  = 22.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    thanks & regards
    vinsee

  • Saving the data into the tab limited text file

    Dear Friends ,
    please help me at the earliest possible , i want to store the data into an text file which is tab limited ,previously i was able to the same into the excel sheet using the jakarta HSSF POI , an open source library to store the data into the EXCEL sheet , now friends please tell me whether is there any other open source to store the data into the tab limited text file what i mean by tablimited is the data is to be saved as
    Name        Email-id        phone          streeet          city
    sri            @some.com     9434           jahdui          hye
    asdf         @.com           3455           sdgsdf         retlike this so please suggest me
    thank you in advance,
    bye
    sriharsha

    Consult the docs for BufferedWriter and from there.
    regards
    Christian
    import java.io.*;
    public class Test
         public static void main(String[] args)
              BufferedWriter writer;
              String[][] s = { {"Name","Email-id","phone","streeet","city"},
                        {"sri","@some.com","9434","jahdui","hye"},
                        {"asdf","@.com","3455","sdgsdf","ret"}};
              try {
                   writer = new BufferedWriter(new FileWriter("out.txt"));
                   for (int j=0; j< s.length; j++) {
                        for (int i = 0; i < s[j].length; ++i) {
                             writer.write(s[j]+"\t");
                        writer.newLine();
                   writer.close();
              } catch (IOException e) {
                   e.printStackTrace();

  • Saving the output from a JSP request

    I have developed a decision support web site that amongst other things generates a "report" page. Now my client would like to add the ability for users of the site to have that report emailed out to them.
    Sending the email obviously isn't a problem, but getting the content into it is. I really don't want to have to duplicate all the JSP code from the report page (there's a lot, including calls to beans etc), and reformat the entire thing with hundreds of out.write("<table>") like statements, or nasty plain-text formatted equivalents.
    So...is there a way to "save" the output generated by the server before it gets sent back to the user - ideally to a local file that I can then just dump straight into the email message. I can't just call the page (internally on the server) to see its output, as it's user-specific and uses a lot of session-related information.
    Cheers for any advice...
    Iain

    It's actually possible to do what I want to do by getting the server to call the page internally (I didn't think it was).
    A simple URLConnection to the appropriate page with the jessionid appended gives me back the page as the user would see it. I can then just stream the response from that to file/email/whatever.
    When the user clicks on their "email" link, I just call a jsp file (or a servlet) with the following code:
         URLConnection uc;
            BufferedInputStream fin;
         BufferedOutputStream fout;
         String location = "http://localhost:8080/blah/report.jsp"
              + ";jsessionid=" + session.getId();
         String filename = "C:\\output.html";
         try
              uc = new URL(location).openConnection();
              fin  = new BufferedInputStream(uc.getInputStream());
              fout = new BufferedOutputStream(new FileOutputStream(filename));
              int byteRead = fin.read();
              while (byteRead != -1)
                   fout.write(byteRead);
                   byteRead = fin.read();
              fout.close();
              fin.close();
         catch (Exception e) {}Now all I have to do is go learn how to write multipart emails using JavaMail...

  • Please show me some examples for using the carray type fields in FML buffer

    How to use Fget and Fchg to access and modify the carray type fields in FML buffer?
    please show me some examples?
    Thanks!

    How to use Fget and Fchg to access and modify the carray type fields in FML buffer?
    please show me some examples?
    Thanks!

  • Saving the output of java programs in files

    How I do save the output of a program to a MS - DOS file ?

    import java.io.*;
    use FileOutputStream /BufferedOutputStream class.....
    read tutorials or books about JAVA on these technology
    U can find many examples in this site too

  • Without using applets geting the output into a javascript variable

    Hi,
    I'm not using executeCommand applets in my webpage,but with the url
    i'm running the transaction. I'm passing the url to iframe as a <b>src</b> in the same page itself. like
    <b>document.getElementById("<iframe>").src="http://localhost/Lighthammer/Runner?Transaction=<Transaction_Name>&<Input_params>=<value>&OutputParameter=*"</b>. It will take 10 seconds to execute the transaction and load into the iframe.
    So I'm giving the
    <b>SetTimeout("alert(document.getElementById('<iframe>').docuemnt.body.innerHTML",10000);</b>
    In the iframe i'm able to see the output as "<u>oktransaction executed</u>" in <u>xml format</u>.
    But in the alert I'm not able to see the same content. <i>In the alert I'm able to see</i>
    <u><iframe id="<id of iframe>" src="<Which i set in the script>"></iframe></u>
    Help me to get the OutputParameter value into a javascript variable.

    Rakesh,
    A couple of observations:
    1.  Why are you calling Runner directly?  You should be using an XacuteQuery template, and reference "/Lighthammer/Illuminator?QueryTemplate=Folder/TRX" syntax when changing the URL in the iFrame.
    2.  You are also using "localhost" which is not portable and may also be causing your problem since your parent page will be based upon the server path, whereas you are forcing the browser to load localhost content into the iFrame (which unless you are physically sitting on the xMII server itself will never work).
    Regards,
    Jeremy Good

  • Adding numbers in a file a and saving the output in another file.!

    can any one pls tell me how to add numbers from a textfile and save the output in another textfile. i'm new with java so pls help out..

    Hi Friend,
    your statement is not clear, it's bit confuse
    this is my unserstanding,
    you want to open a file and read the values then add numbers,
    latter save the sum in a new file.let me know if this is the thing, I can help u
    with Cheers
    Prasanna

  • Saving the output of JSTL into a java variable

    Hi All, Apologies if this has been asked before, but i've been looking for an answer to this question for 2 hours and can't find anything..
    I have a simple JSP page which queries a database. The database will only return one value, which is printed out perfectly with:
    <c:forEach var="row" items="${qryPosts.rows}">
    <c:set var="email" value="${row.email}" />
    <c:out value="${row.email}" />
    </c:forEach>
    First question: Do i have to go through all this if I know there will only ever be one value returned from my SQL statement?
    Second question: How can I get the returned value into a JSP variable, so I can use it in my java code.
    Thanks very much to anyone who can help,
    Regards,
    Brett

    First a couple of disclaimers. If you've been looking through this forum, you've probably come across these pointers before.
    - don't use SQL in a JSP page. It should be in a Servlet/Bean.
    - don't mix JSTL and scriptlet code within a JSP. It makes the page even worse than scriptlet alone.
    Those are just recommendations based on my experience, and best practice.
    Having said that, here are the answers to your questions
    1 - No, you don't need to have a forEach loop
    If you know that there will be one and only one result returned, you can get at it via the expression
    ${qryPosts.rows[0].email}
    With regards to getting it out to java code
    <c:set var="email" value="${qryPosts.rows[0].email}"/>
    and then you can use this:
    <jsp:useBean id="email" type="java.lang.String"/>
    or scriptlet code like this:
    <%
    String email = pageContext.findAttribute("email");
    %>
    Cheers,
    evnafets

Maybe you are looking for

  • How to get the number of created document?

    Hi all, My first program in ABAP works very well. Thanks to all who helped me I would like only one function to it. The program read data from excel file and generates document using BDC.  I use this statement: call transaction 'F-65' using bdcdatafi

  • How can I import sibelius  4 midi files to logic

    I would like to be able to import either wav or midi files because I have tons of scores already notated, and why input the notes again? All help appreciated, I'm new to Logic... Scott

  • WebApp Custom Fields with Liquid

    With the liquid rendering engine tags in webapps have changed. For instance in the list layout I could display the name of the webapp item by using the following tag: {tag_name_nolink. With liquid I can use: {{name}} But for custom webapp fields what

  • Unix file

    Hi experts I have a program that create a unix fiel in an sap directory, with AL11 I show the file but not for the entire lenght. How can i see the entire file? also download in .txt format Thank you

  • Forgot my user name & password - how do i find out what they are?

    Hello I think this will be a really simple post for someone. I downloaded oracle and installed it on my pc about 4 months ago for uni - We are now revisiting the suject. I booted up forms designer and then wanted to run an sql script - however I cant