FTP via PLSQL

Dear All
using a procedure need to generate a txt files and stored it in a table then need to ftp it to remote pc. anyone could you please help in this regards
thanking you
regards
Lakmal

There is no built-in FTP package in Oracle that I'm aware of. You'll have to look to use other peoples implementations or move the FTP functionality out of the database.
Here is one example based on a simple Google search: [UTL_FTP|http://sourceforge.net/projects/plsqlftp/]

Similar Messages

  • Using FTP via PL/SQL

    Hi all,
    i have the need to implement an FTP procedure and accordingly to what i found here : http://www.oracle-base.com/articles/misc/ftp-from-plsql.php i try this code:
    DECLARE
         l_conn  UTL_TCP.connection;
         l_result  PLS_INTEGER;
    BEGIN
         l_conn := UTL_TCP.open_connection('remotehost', '21');
         dbms_output.put_line('1 '||UTL_TCP.get_line(l_conn, TRUE));
         l_result := UTL_TCP.write_line(l_conn, 'USER user');
         dbms_output.put_line('2 '||UTL_TCP.get_line(l_conn, TRUE));
         l_result := UTL_TCP.write_line(l_conn, 'PASS passord');
         dbms_output.put_line('3 '||UTL_TCP.get_line(l_conn, TRUE));
         l_result := UTL_TCP.write_line(l_conn, 'cwd /some/remote/path');
         begin
              loop
                  dbms_output.put_line('4 '||UTL_TCP.get_line(l_conn, TRUE));
              end loop;
         exception
                when UTL_TCP.END_OF_INPUT then
                  null;
        end;
         l_result := UTL_TCP.write_line(l_conn, 'bye');
         UTL_TCP.close_connection(l_conn);
    END;     in order to intercept all the returning messages ... but the loop never raise exception.
    Any suggestion?
    Thanks
    Alex

    OraclePSP wrote:
    Paul Horth wrote:
    "I NEED to do ftp in a procedure, if possible"
    What business function are you trying to satisfy?Hi Paul,
    in a higher vision the all process have to :
    - transfer files in directory and subdirectory (eg. /2012/Nov , /2012/Dec, /2013/Jan, etc)
    - "check and make" the path
    - the success or errors of the entire flow has to be reported to the user
    I know that all this can be done with os command, and i already does, but i have an apex app that manage the files i would like to export.
    Is easier to report os commands result in apex vs. reproducing the command in apex directly?
    Any suggestion is welcome and appreciated.
    AlexWithout knowing more it is difficult to say what would be the best fit to your requirements but two
    approaches spring to mind.
    One is to use Unix scripts to do the ftp and write the results to a table whcih can then be interrogated by an Apex
    report as to what the result was. When you say the Apex app manages the files you want to export, do you mean
    the user picks the files to transfer? One way of doing that would be for the Unix script to read a table to see what needs
    ftping (the app would obviously set the required data up in the table).
    The second approach might be to write a Java procedure that sits in the DB and invokes the OS commands required. This procedure
    can be invoked like a normal PL/SQL procedure stored on the DB.
    Others may have other ideas.

  • Synchronize IR columns via plsql API

    Hi!
    I would like to use the package wwv_flow_worksheet_standard to synchronize the IR columns in my application out of plsql.
    Reason: My IR are based on views (simply: Select * from view_name) I have lots of them and they change frequently via plsql execute immediate.
    What I have tried is:
    DECLARE
    l_flow_id NUMBER (20);
    l_region_id NUMBER (20);
    l_query VARCHAR2 (4000);
    l_result VARCHAR2 (4000);
    BEGIN
    SELECT application_id, region_id, sql_query
    INTO l_flow_id, l_region_id, l_query
    FROM apex_application_page_ir
    WHERE page_id = 9 AND application_id = 133;
    APEX_040100.wwv_flow_worksheet_standard.synch_report_columns (p_flow_id => l_flow_id,
    p_region_id => l_region_id,
    p_query => l_query,
    p_add_new_cols_to_default_rpt => 'Y');
    COMMIT;
    END;
    Unfortunately it doesn't work. When executing the synch_report_columns procedure the following error raises.
    ORA-01003: no statement parsed
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1685
    ORA-06512: at "SYS.DBMS_SQL", line 629
    ORA-06512: at "APEX_040100.WWV_FLOW_WIZARD_API", line 840
    ORA-06512: at "APEX_040100.WWV_FLOW_WORKSHEET_STANDARD", line 2735
    ORA-06512: at line 23
    Can anyone help?
    Best regards,
    Mike

    Hello Joni!
    Thank you for your reply! Unfortunately this is not what I am searching for.
    I want to update the interactive report definition on my apex page out of plsql.
    E.g. the query of the IR on my page is: Select * from view_name
    When i add/remove columns from the view, the IR is broken. In order to repair the IR I need to logon to apex, edit every IR and save it again. Afterwards the new columns will appear in the report.
    Because my application has about 30 IR's and columns will change frequently I would like to script this step.
    The function APEX_040100.wwv_flow_worksheet_standard.synch_report_columns sounds like it does exactly what I need.
    Unfortunately what I tried doesn't work. (Look above)
    BR Michael

  • Refresh Interactive Report Definition via PLSQL

    Hello!
    I am currently working on set of generic database-apex applications.
    That means I have two applications. The first is the admin apex application used to define columns and tables.
    The second application is the one for the end users, where they can view and edit the values.
    My problem now is: Every time the admin adds or removes a column I need to edit the user-apex application, open the region definition of all interactive reports and switch to the report attributes to add/remove the columns of the report.
    I would like to automate this step via plsql. How can I achieve this?
    I guess the first step would be to load a list of all IRs...
    select * from apex_application_page_ir where application_id = 133;
    But I don't know how to reload the columns...
    Can anyone help?
    Thanks in advance!
    BR Mike

    Hello Andre, Hello Mimi!
    Thank you for your messages.
    First to your idea Mimi, i think you brought me on the right track. Using your update statement doesn't works for me.
    There are some missing permissions I couldn't grant and in addition I think this would hardly work because apex_application_page_ir is a complex view.
    But I am currently working on a solution using the wwv_flow_worksheet_standard.synch_report_columns function. Code like this:
    DECLARE
    l_flow_id NUMBER (20);
    l_region_id NUMBER (20);
    l_query VARCHAR2 (4000);
    l_result VARCHAR2 (4000);
    BEGIN
    SELECT application_id, region_id, sql_query
    INTO l_flow_id, l_region_id, l_query
    FROM apex_application_page_ir
    WHERE page_id = 9 AND application_id = 133;
    APEX_040100.wwv_flow_worksheet_standard.synch_report_columns (p_flow_id => l_flow_id,
    p_region_id => l_region_id,
    p_query => l_query,
    p_add_new_cols_to_default_rpt => 'Y');
    COMMIT;
    END;
    Unfortunately it doesn't work. When executing the synch_report_columns procedure the following error raises.
    ORA-01003: no statement parsed
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1685
    ORA-06512: at "SYS.DBMS_SQL", line 629
    ORA-06512: at "APEX_040100.WWV_FLOW_WIZARD_API", line 840
    ORA-06512: at "APEX_040100.WWV_FLOW_WORKSHEET_STANDARD", line 2735
    ORA-06512: at line 23
    Maybe you or someone else can reproduce the error?
    Therefor you simply need an interactive report on a page, based on a view. Remove some column of the view definition-the IR will display an error like this:
    ORA-20001: get_dbms_sql_cursor error ORA-00904: "DUV_FOCUS_OFFSET": invalid identifier
    Then execute the code above (use your page and app_id).
    After the execution the IR should work again. In my opinion...
    @Andre: The application I am working on is a critical pice of software used in a highly sophisticated semiconducter fab.
    It is simply impossible to train some of the shift leaders or operators on apex, in fact it is a great thread if someone else can change the application and produces a downtime.
    So for me it is necessary to script everything as far as possible. I finished nearly everything, simply the synch of the report columns is missing...
    BR Mike

  • Loading dimension via plsql

    Hi
    I am trying to create a dimension and load it via plsql and am able to create dimension and its corresponding table in database.I am quite unsure of how to load the dimension D_OFF from an equivalent relational table R_OFF
    I have a dimension D_OFF with following structure.
    Hierarchy:OFFKEY is child of OFF30 is child of OFF20 is child of OFF10
    Levels -->Attributes
    OFF10 ID--> CD ,DSCR
    OFF20 ID -->CD ,DSCR
    OFF30 ID-->CD ,DSCR
    OFFKEY ID-->CD,DSCR,UPDATE BY,UPDATE_DATE,CREATE BY, CREATE_DATE
    I have created the dimension and the table structure in the database and are as follows
    CREATE DIMENSION D_OFF
    LEVEL "OFF10" IS "OFF10_ID"
    LEVEL "OFF20" IS "OFF20_ID"
    LEVEL "OFF30" IS "OFF30_ID"
    LEVEL "OFFKEY" IS "OFFKEY_ID"
    HIERARCHY "STANDARD" (
    "OFFKEY" CHILD OF
    "OFF30" CHILD OF
    "OFF20" CHILD OF
    "OFF10"
    ATTRIBUTE "OFF10" DETERMINES ( "OFF10_CD", "OFF10_DSCR" )
    ATTRIBUTE "OFF20" DETERMINES ( "OFF20_DSCR", "OFF20_CD" )
    ATTRIBUTE "OFF30" DETERMINES ( "OFF30_DSCR", "OFF30_CD" )
    ATTRIBUTE "OFFKEY" DETERMINES ( "OFFKEY_DSCR", "UPDATE_DATE", "OFFKEY_CD", "UPDATE_BY", "CREATE_DATE", "CREATE_BY" )
    CREATE TABLE "D_OFF"
    ( "DIMENSION_KEY" NUMBER NOT NULL ENABLE,
    "OFF10_ID" NUMBER,
    "OFF10_DSCR" VARCHAR2(200),
    "OFF10_CD" VARCHAR2(500),
    "OFF20_ID" NUMBER,
    "OFF20_CD" VARCHAR2(500),
    "OFF20_DSCR" VARCHAR2(200),
    "OFF30_CD" VARCHAR2(500),
    "OFF30_DSCR" VARCHAR2(200),
    "OFF30_ID" NUMBER,
    "UPDATE_DATE" DATE,
    "CREATE_DATE" DATE,
    "UPDATE_BY" VARCHAR2(250),
    "OFFKEY_ID" NUMBER,
    "CREATE_BY" VARCHAR2(250),
    "OFFKEY_CD" VARCHAR2(500),
    "OFFKEY_DSCR" VARCHAR2(200),
    CONSTRAINT "OFFE_DIMENSION_KEY_PK" PRIMARY KEY ("DIMENSION_KEY")
    My source table is
    CREATE TABLE "R_OFF"
    ( "DIMENSION_KEY" NUMBER NOT NULL ENABLE,
    "OFF10_DSCR" VARCHAR2(200),
    "OFF10_CD" VARCHAR2(500),
    "OFF20_CD" VARCHAR2(500),
    "OFF20_DSCR" VARCHAR2(200),
    "OFF30_CD" VARCHAR2(500),
    "OFF30_DSCR" VARCHAR2(200),
    "UPDATE_DATE" DATE,
    "CREATE_DATE" DATE,
    "UPDATE_BY" VARCHAR2(250),
    "OFFKEY_ID" NUMBER,
    "CREATE_BY" VARCHAR2(250),
    "OFFKEY_CD" VARCHAR2(500),
    "OFFKEY_DSCR" VARCHAR2(200),
    Could you please let me know how to load the dimension via plsql.
    Best Regards,
    Sri

    I assume you're quite sure that the relevant dimension does at least sometimes get updated by the build process, and that you've searched the outline just in case the member was added somewhere you didn't expect.
    How is the data pulled in to the load rule? If it's from a relational database, check the SQL query used to extract it (could there be a WHERE clause restricting records)? If it's from a flat file, check the select / reject criteria set up in the load rule.
    Another possibility is that your load rule is set up to skip X lines at the beginning, and the new member appears there.
    You could build a brand new load rule against a test copy of the cube and confirm that ABC does build in successfully (that at least tells you that the problem is in your rule somewhere).

  • Attachment via PLSQL

    Dear All,
    I want to send a attachment via plsql.
    Please advise if we can attach file (text) from any directory from server.
    Regards,
    Shivaya

    If your file resides in the DB server then no matter which directory it resides in, if you have proper permission to access the directory all you need to do is create a directory object that refers to that path and use the directory object in your UTL_FILE.FOPEN
    UTL_FILE.FOPEN (
      location    IN VARCHAR2,
      filename    IN VARCHAR2,
      open_mode    IN VARCHAR2,
      max_linesize IN BINARY_INTEGER DEFAULT 1024)
      RETURN FILE_TYPE;

  • FTP in PLSQL

    Hi All -
    I am developing a small website using APEX 4.2 which has backend database that has 10-12 tables. All these tables have to be populated on daily basis based on public data published on some website.
    The question is, what are the possible ways to ftp these files into my database. I donot have access to the oracle file system to use the UNIX ftp program to copy the files into Oracle directory and then do a PLSQL API which is explained in http://www.oracle-base.com/articles/misc/ftp-from-plsql.php. Please share your thoughts.
    Thanks,
    -Seenu

    If the file is on a web site, you would need to use HTTP to access it. If the file is on a FTP server, you would need to use FTP to access it. When you click the link to download the file, are you sent to an HTTP:// address or a FTP:// URL?
    You may be able to use the UTL_COMPRESS package to unzip the ZIP file once you download it-- see, for example
    http://technology.amis.nl/2010/03/13/utl_compress-gzip-and-zlib/
    Personally, though, I'd find it easier to write a Java stored procedure to do that. There are way more examples and far more complete libraries for working with ZIP files in Java.
    Once you've unzipped the ZIP file and extracted the file, you'll have to write code to parse the file and load the data into your table.
    Of course, all this would be dramatically easier if you had access to the operating system functions on the server. Then you could simply download, unzip, and parse the file as part of an external table definition with a preprocess step doing all the heavy lifting.
    Justin

  • Cannot cannect to a particular ftp via both Dreamweaver 8 & GoLive CS2

    OK, my trouble is a little complicated.
    I have two different FTP servers: One is provided by
    Dreamhost, another is provided by Startlogic.
    Suddenly, it became unable to connect to Startlogic's ftp in
    Dreamweaver MX2004. So, I upgraded to 8 in order to see if it works
    again. No, it is no longer able to work on ftp connection. My ftp
    setting is just correct. By the way, my OS is Windows 2000.
    Here's the error message: "The connection to the remote host
    has been lost. Click refresh to reconnect."
    Then, I click "OK" and I get this error message: "togglinng
    the 'Use Passive FTP" check box may help you establish a
    connection. Select or de-select the checkbox and click Test to try
    again. If the problem persists, check your network setting,
    including the local firewall settings on your computer, or consult
    your network administrator."
    So, I did what the message instructed
    Then, I get another long error message: "An FTP error
    occurred. - cannot get a remote folder information. Dreamweaver
    could not connect to the server. This may be due to one or more of
    the following reasons: ...."
    On the other hand, there is no problem with Dreamhost ftp. I
    have tried to test with different applications such as GoLive CS2
    and a generic ftp application. Only Startlogic's ftp does not work
    on both Dreamweaver and GoLive, but it works on ta generic ftp
    application.
    I tried to connect to Startlogic's ftp on a ftp application
    from a different computer. It was a success. I have not tested
    Dreamweaver and GoLive though.
    I have some other accounts of Startlogic's ftp and tried to
    test those ftp. None of them worked via Dreamweaver on my computer.
    Now, I don't understand why I cannot connect to only
    Startlogic's ftp with Dreamweaver 8 & GoLive CS2. Is it my
    computer's fault? Is it caused by some bugs on Dreamweaver 8 &
    GoLive CS2? I asked Startlogic's tech support but they said that
    they could connect to my ftp. I don't have firewall software
    installed. My router might have though. My network admin has no
    idea why it causes this.
    Should I reinstall those Dreamweaver 8 & GoLive CS2
    anyway?
    Thank you for your help in advance.

    The answer is always the same. Check your firewall for its
    interference.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "bernielove1" <[email protected]> wrote in
    message
    news:fjq2sf$i4b$[email protected]..
    > Hello,
    >
    > I have the same problem..
    > I have a Startlogic FTP as well and I can not connect
    either. I have been
    > working with someone from the company. I was able to
    conect into my ftp
    > via a
    > web page that they posted on the internet but I was
    still not able to get
    > on in
    > Dreamweaver.
    >

  • Sending multiple IDocs (all in single file) to FTP via XI

    Hi All,
    We have a requirement as below where we are looking for various feasible solutions.
    The requirement is to collect multiple IDocs in ERP (2000-5000 in number) per day (either Flat File or XML) and needs to be sent as a single File (which has all these IDocs) to FTP Server via XI.
    BPM is not allowed to use and we are working on PI 7.0, so IDoc packaging is also not applicable. There is no mapping required, we need to just route them to FTP from ERP System.
    Looking forward for various solutions.
    Regards,
    N. Jayanth Kumar.

    Hi,
         Using the XML file port at R/3 to collect the Idocs would be a feasible solution. Also, as Sunil as already pointed out, you can configure this as a pass through interface, which will improve your overall processing time.
    Another solution can be to pass the Idocs to PI and then use the append mode in the receiver file adapter to collect the days idoc into a single file.
    To append only idocs for a particular day, try using dynamic filename, where file would have the date in it. This way, only Idocs for a particular day would be appended.
    Regards

  • Ftp via proxy server 4.0.1

    We have proble with ftp access via our proxy server 4.0.1, with authentization to LDAP database.
    We can connect to anonymous FTP servers with Firefox, but to nonanonymous we can not.
    If we use some software for connect to FTP (Total Commander etc.), we can not connect to anonymous and nonanonymous FTP.
    connecting process to anonzmous FTP with Total Commander:
    Connect to:(12.10.2006)
    hostname=ftp.nai.com/CommonUpdater
    Firewall=192.168.1.112:8080
    Connect
    GET ftp://ftp.nai.com/CommonUpdater/HTTP/1.0 Host:ftp.nai.com/CommonUpdater
    HTTP/1.1 200 OK
    Copied (12.10.2006 ..) http://ftp.nai.com/CommonUpdater/ -> D:\temp...
    and then popup error window "Connecting closed"
    thanks

    Does total commnder recognize http proxy gatewaying for ftp?
    If so, can you capture the traffic between the total commander, the proxy, and the ftp server? (Use any available snoop commands to do this.) and paste it here?

  • Error when opening a zipped file transfred to the FTP via ABAP program

    Hi All,
    I have extracted the files from al11 and have zipped them and moved the zipped file to FTP site.
    But when I open the zipped file in FTP site, it shows the file names, but they dont look like real files(looks as text)...Even when copied the zipped file to the local pc and tried opening it the result was same.
    Note : For testing when the same zipped file is written to al11 and dowloaded from there using CG3y it works fine.
    Also created a zipped folder manualy and copied it to the FTP site and tried opening it.....It opened but displayed there are no records in it (which is incorrect), But when copied the same file back to local PC it displayed correctly.
    Please let me know hoe to resolve this issue. 
    Regards
    Jithu

    Hi Andreas Mann ,
    Thanks for your reply.
    I dont have access to choose tools in Tcode SXDB.
    Error msg: "You are not authorized to use Transaction SXDA_TOOLS"
    So can you pls Elaborate on this would be helpful in resolving the issue.
    Regards
    Jithu

  • How to set sap directories for FTP via TCode:AL11?

    Hi, all
    I want transfer data from a FTP server to BW. With TCode AL11 I setup SAP directory for FTP, format as following:
    Z_MYDIR         ftp://user:[email protected]
    ftp://10.5.1.21 is the main directory in my FTP server.
    but when I double click the row of the above, error occoured as the following:
    Wrong order of calls <- CALL opendir(,,..)
    I want to ask how to setup the ftp directory in sap al11, and why the error occoured.
    Thank you very much.
    Jiande Ding
    Edited by: Jiande Ding on Dec 3, 2008 9:24 AM
    Edited by: Jiande Ding on Dec 3, 2008 9:49 AM

    Hi,
    As i know there is no possibility if alphanumeric number range in sap.You check with any exit before updating the no in database.check this and post .
    Regards,
    Madhu.

  • Using a Laptop to connect to FTP via an iPhone hotspot

    Hi guys,
    When I try to connect to ftp in either Dreamweaver or FileZilla using my iphone hotspot I cannot connect.
    I wonder if anyone knows (a) if this is possible and (b) how to go about it?
    Many thanks
    Jamie

    Thank you for your reply,
    I have attached a drawing of what I need to achieve. I have omitted the old ADSL links that are now obsolete. My concern is: Is it possible, and how can I configure, a VPN or any other method of encryption over an existing VLAN or VPN whilst keeping the existing networking configurations at each site. This is required to ensure that the IT department cannot access or view sensitive security data (e.g CCTV and access profiles) that is moving between the remote sites and Central Security. The other challenge is that the Cisco router will be installed in the remote sites one at a time over 3 months. During this time sites must be able to operate with or without the upgraded security depending upon what has been installed.

  • Convertion from ASCII to UTF8 on Oracle 8.1.7 via PLSQL

    I need to extract a string from a ascii db, put it into a variabile in a plsql procedure, then with a 'magic box' convert it into utf8 and put it into a new utf8 database.
    I need the magic box, does exist a tool, or package or procedure or..... that works like that?
    Thanks in advance!

    I suggest to post this message on the genaral RDBMS or PL/SQL forums
    Kuassi

  • File size when doing ftp via proxy

    Hi ALL,
    I can not see file size when doing ftp download through proxy.
    Why?

    Welcome to the Apple Discussions.
    There’s a second setting in the New Message Window in Mail that only appears if you have a JPEG attached:
    Uploaded with plasq's Skitch!
    Regards
    TD

Maybe you are looking for