How to save files on the server?

I want to save a log on the server, how can I do this using Oracle?
In SQL Server I used the "bcp" command.
Thanks.

as forbrich suggested you can use the UTL_FILE built-in package. here is an example code to read and write to a file.
CREATE OR REPLACE PROCEDURE Read_Write_File (pvInFile Varchar2,
                                             pOutFile Varchar2) IS
vInFile   utl_file.file_type;
vOutFile  utl_file.file_type;
vNewLine  VARCHAR2(4000);
x         PLS_INTEGER;
vFlag  BOOLEAN := TRUE;
BEGIN
  -- assuming Your_Directory is $HOME/myTxtFiles in a Unix Platform
  -- to check if definition is existing Select Directory_Name, Directory_Path From All_Directories;
  vInFile := utl_file.fopen('Your_Directory',pInFile,'r');
  vOutFile := utl_file.fopen('Your_Directory',pOutFile, 'w');
  IF utl_file.is_open(vInFile) THEN
    LOOP
      BEGIN
        utl_file.get_line(vInFile, vNewLine);
        x := utl_file.fgetpos(vInFile);
        dbms_output.put_line(TO_CHAR(x));
        utl_file.put_line(vOutFile, vNewLine, FALSE);
        utl_file.fflush(vOutFile);
        IF vFlag = TRUE THEN
          utl_file.fseek(vInFile, NULL, -30);
          vFlag := FALSE;
        END IF;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          EXIT;
      END;
    END LOOP;
    COMMIT;
  END IF;
  utl_file.fclose(vInFile);
  utl_file.fclose(vOutFile);
EXCEPTION
  WHEN others THEN
    RAISE_APPLICATION_ERROR (-20099, 'Unknown UTL_FILE Error');
END;
/

Similar Messages

  • How to save file with the "/" symbol in the name?

    Hi,
    I have Adobe Professional 8.  I need to save files with names that include the symbol /, but Adobe interprets, for example, A/88/6, as file name 6, in a folder named 88, in a folder named A, and sets up new folders to accommodate that.  I cannot substitute another symbol as I already have thousands of pdf files in a database using the / symbol, and I need them in the same folders.
    I would very greatly appreciate any advice,
    thanks,
    Mo.

    Thanks.
    As I said, I'm pretty ignorant about these things.  I wouldn't know how to begin using a "hack".  All I know is that I was able, for over a year, to save .pdf files directly from my browser on several computers, and use the forbidden "/" symbol in every file name.  After saving the files, Adobe will happily open them, and allow me to edit and re-save them, although I now see that it will not allow me to "save as" them under a different name without removing that symbol.
    I may not be tech-savvy, but I can state that everything I have said here and above is entirely accurate.  I would be happy to open a dropbox account to show you countless .pdfs with the symbol "/" in the name.
    This is honestly not that big a deal.  I greatly appreciate this discussion, and you have inspired me to become slightly less computer-ignorant.
    Hope you all had a great New Year.  I am still recovering.
    Cheers,
    Mo.

  • How to save files in the filesystem and remember their position?

    This is a fairly novice question. I'm writing a Java desktop application which executed from the jar (actually a jnlp) will first run a setup creating some files in a directory of user choice.
    When the application runs, it'll requires access to those files. However, if they were not saved in the user home directory, how could the application know where they are located? I hope the problem is clear enough. I cannot permanently save the user choice of location at setup time other than in the user home directory, but then I'd rather just save the files there. The problem is that in my case the user has no writing permissions to the user directory.

    simpatico_gabriele wrote:
    I'll need to look closer at your demo and the API. However from what you suggest it seems my application could still run in the sandbox (without being signed) and access the database without bothering the user (if he chooses always allow the first time). True?No. The PS can be accessed sand-boxed, so you can get the path to the DB in a sandboxed app., but the DB itself will require all-permissions to access. (Actually there are some pure Java DBs that can be launched from sand-boxed code, from classes on the run-time classpath, and so long as the app. does not need to change the data - that would be OK.)
    It is true that the JNLP API provides sand-boxed access to the local file system, but it does so through a FileContents object, a strictly limited type of File that is not usable in exchange for a method that accepts (for e.g.) a File or URL.
    If so, I still have a concern: the application also needs to store an image in a folder the user can reach. Writes to the image occur frequently. So using just the PersistService (as in ur demo) wouldn't do since it would be cached somewhere not chosen by the user (and hardly reachable anyway).
    I could use the ExtensionInstallerService to store along the db this image in the same path, and then write to it in the same way as I do with the db. However, will I need to offer a JFileChooser twice, once for each file,.. I don't understand why. The EIS determines the path for the DB using a JFileChooser, then stores it in the PS. The app. gets the path to the DB and image folder, from the PS.
    If they are to be stored in the same path, why is there a need to show 2 file choosers?

  • How to save files into the application directory

    In Struts..i am using FileWriter to create a new file in struts..
    What path name shd be given for it be saved in Webapps/Application directory?

    You should get the context path first,then you can construct a absolute path for you destination file.To get the context path by the following way:
    public class TestInServlet extends HttpServlet{
         public void doPost(HttpServletRequest req,HttpServletResponse res){
                                               //The getRealPath() is deprecated.
              String ctxPath = req.getContextPath();
    }Regards,
    mauvespan

  • Computer died - how to save files from the iphone?

    My computer died and my iPhone holds all my music and photos. I know how to restore purchasemusic and save Camera Roll photos, but I also have old music that I burned from CDs and photos that are synced with My Photos. Does anyone know have any ideas?

    http://www.wideanglesoftware.com/touchcopy/index.php  PC and Mac versions
    http://www.ecamm.com/mac/phoneview/  Mac only

  • How can I save a file in the server?

    Hello,
    I am writing a Java Web Start program that it will generate a html file, how can I save the generated file in the server, fro example, the directory where I stored my JAR files. Because right now, it will create the html file in the local client mahcine instead of the server. Can anyone tell me how can I do this? Thanks you.

    Yeah, thanks but that's not what I was trying to ask.
    I know that you can save and open a document by performing these three steps:
    1. Confirming to save a file to the Downloads folder
    2. Open the download manager by clicking the temporarily green arrow
    3. Clicking on the downloaded file
    What I would like to know is whether or not it is possible to have Firefox open a saved file ''automatically''. At the moment, if I choose to open it automatically, it is only saved to my temp folder.
    It would be great though if it was saved to my Downloads folder ''and'' opened with the respective program on my pc. Is there a way to do this?

  • How to Save a text file in the server?

    hello
    i just want to save an text file in the server.
    My idea is to load an xml text file maybe make some changes
    and then save it back to the server, so i can avoid all the
    database/php work because i know nothing about it.
    thank you

    hello
    i just want to save an text file in the server.
    My idea is to load an xml text file maybe make some changes
    and then save it back to the server, so i can avoid all the
    database/php work because i know nothing about it.
    thank you

  • Is there a way to open Excell file from the server and display in the UI and save it back on to the

    Hello there,
    Is there a way to open Excell file from the server and display in the UI and save it back on to the server? (like showing xell file as a datagrid - add rows, columns etc.)

    Hi Mike,
    Welcome you to the forum.
    You may try:
    SELECT * FROM MyDBNameHere.dbo.OUSR T0
    Thanks,
    Gordon

  • How can open a html, pdf files from the server (c:\foldername\filename)

    Hi all,
    I am developing an application. in this app i have to implement RMI.
    My problem is this, How can a client open a files from the server.
    all the html, pdf files are stored in the server's directory like C:\audit\filename.
    There is a folder on the server's C directory which contains all the html , pdf files.
    please tell me how can a client open a file from the server using RMI.
    Please send me the solution as soon as possible.
    Thanks & Regards
    Bhavishya

    That's doing it the hard way. Why not use HTTP or FTP?

  • How to download a pdf file from the server from an strut application?

    Hi,
    I wan to download a pdf file from the server side to local system. Please help me how i use the down load option.

    Read up on the Struts download action [1].
    And next time, please post in the relevant forum, one of the web-tier ones [2].
    [1] http://wiki.apache.org/struts/StrutsFileDownload
    [2] http://forum.java.sun.com/category.jspa?categoryID=20
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • How to download a text file from the server

    hi everyone,
    can anyone tell me how to download and read a text file from the server and saved in into resource folder.
    with regards
    pallavi

    its really easy
    To read from server, use something like:
    HttpConnection connector = null;
    InputStream inp_stream = null;
    OutputStream out_stream = null;
    void CloseConnection()
         if(inp_stream!=null)inp_stream.close();
         inp_stream=null;
         if(out_stream!=null)out_stream.close();
         out_stream=null;
         connector.close();
         connector = null;
    public void getResponse(String URL,String params)
      try
         if(connector==null)connector = (HttpConnection)Connector.open(URL);//URL of your text file / php script
         connector.setRequestMethod(HttpConnection.POST);
         connector.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1");
         connector.setRequestProperty("content-type", "application/x-www-form-urlencoded");
         //connector.setRequestProperty("charset","windows-1251");
         //*** If you need to send ("arg1=value&arg2=value") arguments to script use this:
         out_stream = connector.openOutputStream();
         byte postmsg[] = params.getBytes();
         out_stream.write(postmsg);
         int rc = connector.getResponseCode();//in any case here connection will be opened & closed
         if (rc != HttpConnection.HTTP_OK)
              CloseConnection();
              throw new IOException("HTTP response code: " + rc);
         inp_stream = connector.openInputStream();
         int pack_len = inp_stream.available();
         byte answ[]=new byte[pack_len];
         inp_stream.read(answ);
         CloseConnection();
         ProcAnswer(answ);//process received data
      catch(Exception ex)
         System.err.println("ERROR IN getResponse(): "+ex);
    } And you can read from resource file like
    public void loadFile(String filename)
        DataInputStream dis = new DataInputStream(getClass().getResourceAsStream("/"+filename));
        String str="";
        try
             while (true)
                ch = dis.read();//read character
                if(ch=='\r')continue;//if file made in windows
                if(ch=='\n' || ch==-1)//end of line or end of file
                    if(str.length()==0)continue;//if empty line
                    //do some thing with "str"
                    if(ch==-1)break;//it was last line
                    str="";//next line
                    continue;
                 str+=(char)ch;
           dis.close();
       catch (Exception e)
           System.err.println("ERROR in loadFile() " + e);
    }Welcome! =)
    Edited by: MorskoyZmey on Aug 14, 2008 3:40 AM

  • How can I display the front panel of the dinamically loaded VI on the cliente computer, the VI dinamically loaded contains files, I want to see the files that the server machine has, in the client machine

    I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
    Attachments:
    micliente.llb ‏183 KB
    miservidor.llb ‏186 KB
    rdsubvis.llb ‏214 KB

    I down loaded your files but could use some instructions on what needs run.
    It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
    Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
    hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to create a file in the server?

    Hi,
    I'm making a webservice that has to generate a XML file, sign it using another webservice and return this XML. The problem is that i don't know how to create the file in the server throught webservice.
    I use this code in the webservice to generate the XML and after I return the XML to client in a byte[]
         static void outputDocumentToFile(Document myDocument, String path) {
            //setup this like outputDocument
              try {
                   // XMLOutputter outputter = new XMLOutputter("  ", true);
                   XMLOutputter outputter = new XMLOutputter();
                   //output to a file
                   FileWriter writer = new FileWriter(path);
                   outputter.output(myDocument, writer);
                   writer.close();
              } catch(java.io.IOException e) {
                   e.printStackTrace();
        }But the file is generated in the client-side, how can I generate the file in the server-side?
    Thanks very much.

    Well the File object doesn't create a file it's simply an abstract representation of file and directory pathnames.
    You can try something like this:
    <%
    try
    // get the path to the web server root
    // I read somewhere not to use 'getRealPath' for some reason which I
    // can't seem to remember :S Hopefull someone can enlighten us :)
    String path = application.getRealPath("/project/jsp/demo.txt");
    File file = new File(path);
    PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
    writer.println("Hello World!");
    writer.close();
    catch (Exception e)
    System.err.println(e.getMessage());
    %>
    Hope this helps :)

  • How to Upload a File on the Server

    Hi,
    I want to upload a file on the server from Windows Mobile Application. Can anyone please suggest me a way to do so?
    Thanks in advance, 
    Saheli Sur

    Following links should also help
    http://blog.anthonybaker.me/2013/06/how-to-upload-file-from-windows-phone.html
    http://stackoverflow.com/questions/19954287/how-to-upload-file-to-server-with-http-post-multipart-form-data/20000831#20000831
    Gaurav Khanna | Microsoft .NET MVP | Microsoft Community Contributor

  • Since upgrading to Lion, i am unable to take screen shots.  i get the message that i don't have permission to save files to the place where SSs are saved.  how can i regain the ability to save screen shots?  thanks

    since upgrading to Lion, i am unable to take screen shots.  i get the message that i don't have permission to save files to the place where SSs are saved.  how can i regain the ability to save screen shots?  thanks

    First of all, are you using the OS native screen capture?
    If not, make sure the application you're using has been update for Lion.  I was using Snapz Pro for years, but I need to update it for use with Lion. Meanwhile Grab and the keyboard shortcuts are working on my Lion load.
    If you are using the native capture mode unsuccessfully, I would run the Disk Utility and repair permissions on the drive. For some reason, even in past OS Versions, routine maintenance of permissions makes life a lot easier.

Maybe you are looking for

  • Stumped: REP-3000 rwbuilder

    Hi all, Just installed 9iDS 9.0.2 on Redhat 9. But when I try to run $ORACLE_HOME/bin/rwbuilder.sh I get the following: [oracle@wks1 bin]$ ./rwbuilder.sh Error: javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused

  • Hourglass thumbnails in media grid

    I upgraded from pse 9 to 12.  In my media grid the thumbnails are rendered as Hourglass.  Is ther a setting or upgrade that can resolve this display issue?  I do not have this issue in pse 9

  • Firefox keeps switching to newly opened tabs, although the option to do so is turned off. How can I stop this?

    When I open a link in a new tab the browser's focus switches to the tab right beside the one in current use more often than it does the one just opened. I would much prefer it to not switch to tabs automatically unless it is a blank tab being opened.

  • How do I roll back Pages?

    DEAR APPLE.......WE HAVE A PROBLEM!!! I AM A FAN TO THE CORE (last MacBook Pro 17", iPad4, iPhone 5, iPhone 4s) YET I CAN'T UNDERSTAND FOR MY LIFE WHAT YOU'VE DONE TO PAGES!!! THE PROGRAM IS SIMPLY NO LONGER COMPATABLE WITH ANYTHING!!! WHEN I OPEN A

  • What kind of material type i should use?

    Dear all, I am wondering what kind of material type I should use for the following type of material: The material is Chicken used in like KFC- type of eatery franchise store. The eatery franchise store buy the chicken from external party, next, this