How can I write to a (external)file from a stored procedure

I want to write some data to a (external) file. I have it working with the function UTL_FILE.
My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
Does anyone know a way to build this.
Please send your responses to [email protected]
Many thanks,
Alex Nagtegaal

an extraction out of expert one-on-one from Thomas Kyte
<quote>
when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
To change the default logon for the Oracle services go to (in Windows NT):
Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
In Windows 2000, this would be:
Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
* Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
* Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
You will of course need to stop and restart Oracle after changing the properties of the service.
<\quote>
I want to write some data to a (external) file. I have it working with the function UTL_FILE.
My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
Does anyone know a way to build this.
Please send your responses to [email protected]
Many thanks,
Alex Nagtegaal

Similar Messages

  • How can I write relative path in File, ImageIcon objects

    I have downloaded examples from
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-swing/index.html
    but for some reason images are invisible until I write absolute paths?(I use windows) How can I write relative path in File, ImageIcon objects?

    Hello;
    I've found a lot of complaints about this through the Forte forum as well as on Dejanews. I'm just curious as to whether any of you ended up finding a solution to this problem.
    There was one posting about setting up the subdirectory as a URL rather than a String and then using that as the source of the ImageIcon ... but this didn't work for me.
    Any help whatsoever would be appreciated.
    Thanks!

  • How can i export a 24bit avi file from photoshop for mac?

    how can i export a 24bit avi file from photoshop for mac? i have a client that specificly needs the files to be avi and in 24bit what are the settings that i need to use to export the video using photoshop on a mac?

    Hello,
      To make a 24-bit AVI file in Photoshop, go to File>Export>Render Video. Then, under File Options, choose AVI from the Quicktime Export drop-down menu. Click the Settings button. Click the Settings button in the AVI Settings window. Change Compression to None, and then choose "Millions of Colors" from the Depth drop-down under Compression.
      The Millions of Colors option is for 24-bit video (8-bit R+G+B channels, 8x3=24). Millions of Colors+ is for 32-bit video (24-bit video plus an 8-bit alpha channel).
    -Brett

  • How can I copy programs (iWorks) and files from Time Capsule to my HD manually? The problem is that the migration assistant does not recognize my backup file and the user on the TC. (If I open the TC on finder, it it there though)

    How can I copy programs (iWorks) and files from Time Capsule to my HD manually? The problem is that the migration assistant does not recognize my backup file and the user on the TC. (If I open the TC on finder, it it there though)

    How can I copy programs (iWorks) and files from Time Capsule to my HD manually? The problem is that the migration assistant does not recognize my backup file and the user on the TC. (If I open the TC on finder, it it there though)

  • How can I clean all the junk files from my iMac so that it can run faster?

    How can I clean all the junk files from my iMac so that it can run faster? Its been slowing down ever since I started using it.

    Before doing anything, we might be able to help with your iMac issues here.
    Please download, install and run Etrecheck.
    http://www.etresoft.com/etrecheck
    Copy/paste its report here in another reply thread so that we have a complete profile of your Mac's hardware and installed software.

  • How can I transfer all of the files from my old iPhone 4S to my new iPhone 5?

    how can I transfer all of the files from my old iPone 4S to my new iPhone 5?

    Download the media content from an iTunes library or the iTunes Store, and follow these instructions to transfer your personal settings and data.
    (83108)

  • How can i transfer the radio recording files from my Ipad to Computer

    how can i transfer the radio recording files from my Ipad to Computer ?

    I was hopeful I could use home sharing to sync my iTunes libraries,
    Unfortunately, you can only stream content to your iOS devices via home sharing (not sync it).
    I'd have a check through the following user tip instead:
    Recovering your iTunes library from your iPod or iOS device

  • HT1382 how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    What backed up files?
    Available backups for an iOS device can be found in Edit > Preferences > Devices.

  • How can I keep my RAW photo files from converting to JPEG???

    How can I keep my RAW photo files from converting to JPEG???

    Hello briggiebunny
    If iTunes can read the movie files, then you will need to create an iPad version by going to the drop down menu File > Create New Version > Create iPad or Apple TV Version and then syncing that newly created file.
    iTunes: Videos may be unable to sync to iPhone, iPad, or iPod
    http://support.apple.com/kb/ts1497
    Regards,
    -Norm G.

  • How can i make sure the graphic file from my subcontract create is really llegal?

    how can i make sure the graphic file from my subcontract create is really llegal?
    They have creat the PNG file which creat from Adobe Illustrator CS5.
    I have try checking on Metadata In Adobe Bridge, and it seem to be blank.
    So i would likt to know how can i make sure the graphic file from my subcontract create is really llegal?
    Thanks

    I have try checking on Metadata In Adobe Bridge, and it seem to be blank.
    So i would likt to know how can i make sure the graphic file from my subcontract create is really llegal?
    shoo: if i had to do that for every file i get  i would go insane, as scott said, post contract: files that they (sub contractor) supply you, presume them ok unless you KNOW otherwise, or a copyright flag pops up contradicting ownership.
    G

  • HT4007 I have just transferred all my raw, jpeg & tiff files into LR4 and using to opportunity to delete old raw files to free up disc space. How can i completely remove a raw file from my msc disc??

    I have just transferred all my raw, jpeg & tiff files into LR4 and using the  opportunity to delete old raw files to free up disc space. How can i completely remove a raw file from my mac disc??

    I'd be careful here: LR references files. It can copy them, like from an SD card to your hard drive, but it doesn't necessarily make duplicates. So when you say you "transferred" those files "into" LR it just means you referenced existing files. And if you delete those they're gone, unless you've made copies. LR does not import files by copying them into a managed library like Aperture does.

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '&lt;&lt;ALL FILES&gt;&gt;', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • How can i write an image to file

    hi everybody,
    How can i write a java.awt.Image object to a file.I want to write it to file as a jpg image.Is ther any jpegencoder which can write an Image object to file.
    any tips or suggestions
    Thanks in advance

    This may be only of limited use but it shows an encoder in use.
    http://forum.java.sun.com//thread.jsp?forum=5&thread=140954
    http://forum.java.sun.com/thread.jsp?forum=48&thread=446603&tstart=0&trange=15
    rykk

  • Running ".sh" file from a stored procedure

    Hi,
    I need to call a file.sh linux bat file whit arguments from a stored procedure.
    How can I do?
    Thanks in advance...

    Hi rajni,
    I've tryed your solution but it doesn't work, for the same reason that yuo can see here:
    Re: questions about dbms_scheduler.create_job (ORA-27371)
    I've also tryed the solution of the "user534897", but it doesn't work too.
    At execution time Oracle give me this error:
    ORA-29540: class djv_osCommand does not exist
    ORA-06512: at "CICCSV.DPK_OSCOMMAND", line 5
    ORA-06512: at "CICCSV.DPK_OSCOMMAND", line 28
    ORA-06512: at "CICCSV.DFN_mkdir", line 5
    ORA-06512: at line 8
    If you have any other idea or suggestion you're welcome. At the moment I've no solution for my problem.
    Thanks in advance.

  • Calling external servlet from java stored procedure

    Hello,
    I need to call an external servlet which is in 9iAS server ( unix box) from Java Stored procedure in oracle database.
    Can anybody give me an idea? is it possible?
    Thanks,
    Viswa

    I am trying the same. Here is URL which will help u.
    http://otn.oracle.com/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    Let me know when you run servlet successfully.
    Regards
    Satish

Maybe you are looking for

  • Error: xulrunner version 1.9.2.1o not compatible with firefox 3.6.12 min/maxVersion 1.9.2.12

    Loaded firefox 3.6.12 from scratch. It won't start, popping up an XULRunner dialog box that says :Error: Platform version '1.9.2.10' is not compatible with minVersion >= 1.9.2.12 maxVersion <= 1.9.2.12. How do I get proper version of XULRunner so Fir

  • HLOC Chart: How to use different stroke for different items in a HLOCSeries?

    I want to use different color for the stroke in a HLOC chart based on the openfield, closefiled value. It's just like the fillFunction in a ColumnSeries. Anybody got any ideas to make this? And I would also like to know which class is responsible for

  • Measure file-transfer speed?

    Hello to all of you! I would like to know if there's a way to monitor the speed during a file transfer (either from the internal disk to an external, or from an internal folder to another internal folder). I'm not referring to online file tranfers (e

  • What dvd burner app is the best?

    I bought the macbook with Imovie and I love it but can't burn a DVD of football games.  HELP!  What app do you recommend?

  • Profile consistency check when operation mode change

    If the number of work processes in the profiles is changed, the system can no longer switch operation modes until after a restart of the instance. It's therefore necessary to adjust the configuration of the operation modes after a change to the profi