3 Replies Latest reply: May 21, 2012 2:53 PM by Jason_(A_Non) RSS

    Retrive xml from a xmltable to local file

    938233
      How can retrive data from xmltable.
      I do this client side.
      Retrive data from a table to a local file but do not want use sqlplus but utl_file.
      I have not sysdba user, how can create directory.
      It's possibile create directory under my schemas's.
      Thanks.
        • 1. Re: Retrive xml from a xmltable to local file
          Jason_(A_Non)
          [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/u_file.htm#ARPLS70896]utl_file
          UTL_FILE provides file access both on the client side and on the server side. When run on the server, UTL_FILE provides access to all operating system files that are accessible from the server. On the client side, as in the case for Forms applications, UTL_FILE provides access to operating system files that are accessible from the client.
          [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5007.htm#SQLRF01207]CREATE DIRECTORY
          You must have CREATE ANY DIRECTORY system privilege to create directories.
          SQL*Plus runs server side so you cannot use utl_file to write files to your local drive unless the server itself can see your local drive.

          What is your goal for this?
          • 2. Re: Retrive xml from a xmltable to local file
            938233
            I make a bat file that permit to connect to db from cmd and launches sql script but i don't like that.I want use utl_file from client but i have problem with path. What do i (step) for for do that?
            And if you have alredy used clob2file it's possibile use this function from client side.
            Thanks.

            Edited by: user11688764 on 18-mag-2012 13.01
            • 3. Re: Retrive xml from a xmltable to local file
              Jason_(A_Non)
              In regards to clob2file, the second parm is a DIRECTORY name, as far as I know. This means the DB can only write to locations the machine running the DB has network access to.

              Why do you feel you need to use utl_file for whatever purpose you need?