How to pull all the txt files from an application server to oracle server

hi
i got some 30 txt files on java application server. i have two questions
1) can java guys will be able to move those files to some oracle directory that will be used by create external table command.
2) can oracle do that using a stored procedure ..but then for it i think i have to create ftppkg and ftpbdy and call and connect each time...
which one is better and why?
regards
raj

Hi,
You can create procedure to move file from application server to oracle server.
Code for list all files in directory
ops$tkyte@8i> GRANT JAVAUSERPRIV to ops$tkyte
  2  /
Grant succeeded.
That grant must be given to the owner of the procedure..  Allows them to read
directories.
ops$tkyte@8i> create global temporary table DIR_LIST
  2  ( filename varchar2(255) )
  3  on commit delete rows
  4  /
Table created.
ops$tkyte@8i> create or replace
  2     and compile java source named "DirList"
  3  as
  4  import java.io.*;
  5  import java.sql.*;
  6 
  7  public class DirList
  8  {
  9  public static void getList(String directory)
10                     throws SQLException
11  {
12      File path = new File( directory );
13      String[] list = path.list();
14      String element;
15 
16      for(int i = 0; i < list.length; i++)
17      {
18          element = list;
19 #sql { INSERT INTO DIR_LIST (FILENAME)
20 VALUES (:element) };
21 }
22 }
23
24 }
25 /
Java created.
ops$tkyte@8i>
ops$tkyte@8i> create or replace
2 procedure get_dir_list( p_directory in varchar2 )
3 as language java
4 name 'DirList.getList( java.lang.String )';
5 /
Procedure created.
ops$tkyte@8i>
ops$tkyte@8i> exec get_dir_list( '/tmp' );
PL/SQL procedure successfully completed.
ops$tkyte@8i> select * from dir_list where rownum < 5;
FILENAME
data.dat
.rpc_door
.pcmcia
ps_data
http://asktom.oracle.com/pls/asktom/f?p=100:11:3597961203953876::::P11_QUESTION_ID:439619916584

Similar Messages

  • 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.

  • I have converted a pdf to word. How can I access the Word file from my online account?

    I have converted a pdf to word. How can I access the Word file from my online account? When it says 'download the converted file' I choose a location on my PC and click, but nothing happens. It seems that it can only save the converted file to my online account. I went to my online account but I see no way to look for the file

    Hey Fabrizio,
    You might need to sign up at "https://cloud.acrobat.com/exportpdf" using your Adobe ID credentials to convert your PDF file to Word.
    Do you get the 'download' prompt?
    Also, you can find the converted files by clicking at the 'Files' tab. 
    Please try the same using a different browser and check.
    Hope to hear from you.
    Regards,
    Anubha

  • How can i copy the music files from itunes in mp3 format to my PC

    How can i copy the music files from itunes in mp3 format to my PC

    Dr. P,
    Song files are just files.  You can copy them the way you copy any other files, like photos or documents.
    If any of the files are not already in MP3 format, and you wish to create MP3 versions, then you can convert them using iTunes, by following this guide:  http://support.apple.com/kb/HT1550

  • How to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS

    Dear gurus,
    how to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS
    Arun

    Hi,
    Take a look:
    http://www.morganslibrary.org/reference/pkgs/dbms_audit_mgmt.html
    Regards,

  • If I secure my browser using CISecurity's baseline for Firefox, can I copy all the ".js" files from the hardened system to another?

    I own multiple systems. I have hardened one browser following the guideline provided by CISecurity. Instead of repeating all the configurations performed on that one system, can I just copy all the ".js" files from the secured system to my other systems?
    The ".js" files can be modified using a text editor. Is there a way to lock down these files to prevent modification?

    Dear Joel
    i know two ways to prevent browser from caching your files
    First : The Hard way
    just add ? +Math.random()  in the end of your file
    Like this :
    in HTML :
    <script type="text/javascript">
    (function(){
         var e = document.getElementsByTagName("script")[0];
         var d = document.createElement("script");
         d.src = "index_edgePreload.js?"+Math.random()+"";
         d.type = "application/javascript";
         d.async = true;
         d.defer = true;
         e.parentNode.insertBefore(d,e);
    </script>
    instead of this Line in HTML that created by EA :
    <script type="application/javascript" src="index_edgePreload.js></script>
    Disadvantage : you should do this for all of files you want to prevent from caching
    ===================================================
    Second : The easyest way
    You Should have Access to .htaccess file in your Server
    Open your .htaccess file and paste these codes in it :
    ExpiresActive On
    ExpiresByType application/json "access plus 1 seconds"
    ExpiresByType text/json "access plus 1 seconds"
    ExpiresByType text/plain "access plus 1 seconds"
    ExpiresDefault "access plus 1 month"
    you can type what ever type of file you want to prevent from caching in browser
    Advantage : after do this in your .htaccess file all files with the type you want will not Cache in your browser
    Easy is'nt it ?
    Zaxist

  • How can I work the raw file from Canon 5D MkIII in Photoshop Elements 9?

    how can I work the raw file from Canon 5D MkIII in Photoshop Elements 9?

    You can download the 7.1 DNG converter to make copies of your canon raw files in the adobe dng format, which can then be opened in pse 9.
    As said above the the latest camera raw plugin 6.5 for pse 9 won't open those files directly, but will open the the converted dng files.
    windows:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5389
    mac:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5388

  • TS4147 How to remove all the duplicated contacts from ICloud?

    How to remove all the duplicated contacts from ICloud?

    If your Mac is syncing contacts with your iCloud account, open Contact on your Mac and go to Card>Look for Duplicates, then Merge the found duplicates.  These changes will be synced to iCloud.

  • I used the Nik filter collection as a trial version on Elements 12 on MacOS10.9.  When the trial was up, the purchased version is not allowed to work.  Any suggestions.  I've uninstalled everything aand cleaned out all the NIK files from the libraries.

    I used the Nik filter collection as a trial version on Elements 12 on MacOS10.9.  When the trial was up, the purchased version is not allowed to work.  Any suggestions.  I've uninstalled everything aand cleaned out all the NIK files from the libraries.

    To Mickey: I got the 2 RAR files into one directory, extracted the part1.rar file, and in that new folder there is a file called start.html. I opened this, and followed the links on the right, from "Welcome" to "Getting Started". After all this I had the SAP Management Console, as well as the Database Manager applications created. You will find the specific instructions for setting up the MaxDB under the "Getting Started" link. After setting up the Database Manager you have to start it up with a user-id and password which was created during the set-up, and specifically link the database to the NSP system. I seem to remember that this didn't work at first, because the Database Manager shortcut does not run the program as an administrator. So run it as an administrator! I altered the shortcut's properties under the shortcut/advanced so it will always run the program as an administrator, and haven't had any problems - once you have done the "Add" procedure you may never need to re-visit the database manager.
    Edited by: Paul Wright on Jan 8, 2009 2:03 PM

  • I'm a beginner with iMovie and my hard drive is filling up fast. How do I move the event files from the hard drive to my time capsule?

    I'm a beginner with iMovie and my hard drive is filling up fast. How do I move the event files from the hard drive to my time capsule?

    you should never (ab)use a designated backup-setup for 'ordinairy' storage tasks.
    plus, the wireless connection to TC is too slow for iMovie.
    purchase any ext. usb-harddrive, 500Gigs starting at 50$ ...
    you HAVE to follow advice given here:
    http://help.apple.com/imovie/#mov3ac6d42c

  • HT3678 If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    Also i have reinstalled the reader9 two  times and tried with reader8 also but in both the cases same problem.
    it would be gr8 help if someone can help.

  • Periodic Alert-How to send all the records returned from the SQL in a mail?

    Hello all,
    I have defined a Periodic Alert, my SQL query returns more than one record whenever I run it. I also defined an action to send an email with the message consisting of the output variables from the SQL. Whenever i run this alert, a mail is being sent for every single record returned from the query. But i want to send a single mail containing all the records information that my SQL query returns.
    For Example: My SQL query lists all the users created on current date.
    Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
    from fnd_users where trunc(creation_date) = trunc(sysdate)
    Now i want to send a mail with all the users information from the above query, to SYSADMIN. How can this be achieved?
    Thanks & Regards
    chakoo

    Hi Chakoo,
    If the Periodic Alert is not working as requried. You can write a simple package with 3 procedures to implement the writing output to a out file and simultaneuosly send email to multiple receiptents.
    Example:
    Create Package xx_pac
    Create public Procedure P1
    begin
    Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
    from fnd_users where trunc(creation_date) = trunc(sysdate)
    fnd_file.put_line (fnd_file.output, &OUTPUT1, &OUTPUT2);
    end;
    (Create private Procedure P2
    begin
    ---Write the email package using the UTL_SMTP approch. Using this approch you can send the procedure P1 output file as an attachment to the desiginated receiptents.
    end;
    (Create public Procedure P3
    begin
    ---call the procedure P1 using the "g_request_id = fnd_request.submit_request"
    ---Wait for the above procedure to complete using "l_conc_status := fnd_concurrent.wait_for_request" procedure.
    ---call the procedure P2. (When called you must provide the correct to, from address)
    end;
    end;
    Register the Package xx_pac as a concurrent program and schedule when submit it from the request.
    Regards
    Arun Rathod

  • How XI will read the .txt file

    Experts,
    i AM WORKING ON A FILE BAPI synchrounous scenario.
    Sender will drop the required file on XI directory and XI will pull the file and map it with the BAPI u2013 and crate services  entries in SAP SCM. If errors are encountered during the process they are returned to the client in a report or as erroneous file.
       *I have a .txt file( tab delimitted file)  in the folowing structure
    H                       NAME                        date            ***                 data_txt                         676869*
      C             a                           b             c
      C             d                           e             f
    H                      name                           Account            brat                     abcc                             12333
      C             a                             b               c
      C             d                             e               f                          hjhdkf
    like this  multiple entries, ll be getting .
    Based on H ( indicator), Have to get the data. How will I do in XI file  adapter?  Please help me how should I design the file adapter so that It can read the .txt file.
    I have created the sender data type similarly to the structure of BAPI.
    Note; H indicates teh Header and D indicates teh sublines. Together it is called one service entry. Aagain Next 'H' indicates the strat of next service entry.
    Thanks
    Veeru

    Nutan,
      I want the flat file  data in teh following xml format
    <Records>
        <Header>
             <Item>
                    <data1>1</data1>
                    <data2>2</data2>
              </item>
       </header>
    <Header1>
             <Item>
                    <data1>1</data1>
                    <data2>2</data2>
              </item>
       </header1>
    </Records>
    Records-- o to unbounded
    Header--- 0 to 1
    header1-- 0 to 1
    Item--- 0 to unbounded
    My input .txt file ,  fields are separated by a tab. I mean its a tab delimitted file.
    The main tag Records is 0 to unbounded.
    How to do the content conversion for the  same.
    Thanks
    Veeru
    Edited by: viru srivastava on Dec 20, 2009 2:56 AM

  • HT2548 how do i copy the domain file from OS 10.4 to a lion OS computer?  I made a copy of the domain file and copied it to my new computer, but it doesn't open in iweb when I double-click on it.

    How do I import an iweb domain file from an ibook (OS 10.4) to an imac (OS 10.73)?
    I copied the domain file from my ibook to my imac, but when I double-click on the file, it doesn't open in iweb. 

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.  Then place the domain file in your Users/Home/Library/Application Support/iWeb folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • How to export all the site files to the new computer

    I'll be buying a new computer soon and need to export all the
    site files (usernames and passwords) to that. I know how to export
    individual site information, but the passwords are encrypted. Also,
    is there way to save all sites at once and then just transfer that
    to the new machine?

    This is a multi-part message in MIME format.
    ------=_NextPart_000_0039_01C852A0.8D4985F0
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Choose Site > Manage Sites and then use the Export feature
    in the Site =
    Manager. You'll have an option to export all settings
    (including =
    username and password). DW stores them in .ste files, which
    you can =
    later use the Site Manager to Import.=20
    By the way, the Import/Export features work with multiple
    files, just do =
    a multi-select before clicking the Export button and select
    multiple =
    .ste files when importing.
    Best - Joe
    Joseph Lowery
    Vice President of Marketing, WebAssist
    Author of Dreamweaver CS3 Bible
    "Mikkola" <[email protected]> wrote in
    message =
    news:[email protected]...
    > I'll be buying a new computer soon and need to export
    all the site =
    files=20
    > (usernames and passwords) to that. I know how to export
    individual =
    site=20
    > information, but the passwords are encrypted. Also, is
    there way to =
    save all=20
    > sites at once and then just transfer that to the new
    machine?
    >
    ------=_NextPart_000_0039_01C852A0.8D4985F0
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=3DContent-Type content=3D"text/html; =
    charset=3Diso-8859-1">
    <META content=3D"MSHTML 6.00.6000.16587"
    name=3DGENERATOR>
    <STYLE></STYLE>
    </HEAD>
    <BODY>
    <DIV><FONT face=3DArial size=3D2>Choose Site
    &gt; Manage Sites and then =
    use the=20
    Export feature in the Site Manager. You'll have an option to
    export all =
    settings=20
    (including username and password). DW stores them in .ste
    files, which =
    you can=20
    later use the Site Manager to Import.
    </FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>By the way, the
    Import/Export features =
    work with=20
    multiple files, just do a multi-select before clicking the
    Export button =
    and=20
    select multiple .ste files when
    importing.</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Best -
    Joe</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Joseph
    Lowery<BR>Vice President of =
    Marketing, <A=20
    href=3D"
    http://www.webassist.com">WebAssist</A><BR>Author
    of <A=20
    href=3D"
    http://www.idest.com/dreamweaver/">Dreamweaver
    CS3 =
    Bible</A></FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>"Mikkola"
    &lt;</FONT><A=20
    href=3D"mailto:[email protected]"><FONT
    face=3DArial=20
    size=3D2>[email protected]</FONT></A><FONT
    face=3DArial =
    size=3D2>&gt; wrote=20
    in message </FONT><A =
    href=3D"news:[email protected]"><FONT=20
    face=3DArial =
    size=3D2>news:[email protected]</FONT></A><FONT=20
    face=3DArial size=3D2>...</FONT></DIV><FONT
    face=3DArial size=3D2>&gt; =
    I'll be buying a=20
    new computer soon and need to export all the site files
    <BR>&gt; =
    (usernames and=20
    passwords) to that. I know how to export individual site
    <BR>&gt; =
    information,=20
    but the passwords are encrypted. Also, is there way to save
    all <BR>&gt; =
    sites=20
    at once and then just transfer that to the new=20
    machine?<BR>&gt;</FONT></BODY></HTML>
    ------=_NextPart_000_0039_01C852A0.8D4985F0--

Maybe you are looking for