Output of PL/SQL code in Client Machine.

I am writing the output of PL-SQL code to a file. Later on I will use that output in a UNIX shell script.
For that I am creating directory object and using the UTL_FILE.fopen and UTL_FILE.put_line functions of UTL_FILE package in Oracle.
E.G.
1) CREATE OR REPLACE DIRECTORY MYDIR AS '…………………ANY VALID DIRECTORY PATH IN SERVER……………………………’;
2)
DECLARE
config_file UTL_FILE.file_type;
lv_i BINARY_INTEGER := 1;
BEGIN
lv_i := 2;
config_file := UTL_FILE.fopen ('MYDIR', 'test.txt', 'W');
UTL_FILE.put_line (config_file, 'This is test file' || 'lv_i= ' || lv_i);
UTL_FILE.fclose (config_file);
END;
But UTL_FILE.fopen and UTL_FILE.put_line functions in oracle can write only to ORACLE SERVER side files.
However, I want to write the output of the file to the UNIX box from where I am accessing database (using sqlplus DB_USER_NAME/DB_PASSWORD@DB_NAME).
Is it possible in Oracle 10g (10.2.0.4.0) to write the output of PL/SQL code in client machine?

Hi,
Just an idea. I haven't tried it before in unix server since there's no chance to.
In Windows you can actually map the specified folder where you want to write the file, so in this case, you just need to find a way on how you can map/mount the folder/directory where you want your file written. UTL_FILE can be used to write files(if the file does not exists) and write text in that file on a directory accross the network as I have done it before in Windows machine.
Regards.

Similar Messages

  • SSRS - Report on software deployment Exit Codes on client machines

    Hi,
    Can anyone advise whether its possible to report on Software deployment Exit Codes on client machines, with a particular exit code and how many times the deployment has been retried?
    Example:
    Application deployment- App1
    Failed with Exit code : 0x1388 (5000) Log off network
    I would like to report on clients with App1 deployment failed with exit code 5000 and how many times on retry?
    Regards,
    Craig
    MCTS | MCITP | MCSA

    Only the last return code can be queried (see the default SRS reports). Number of retries are not reported.
    Torsten Meringer | http://www.mssccmfaq.de

  • I am not able to connect SQL(Open SQL) in EAS client machine

    Hi Experts,
    I have Installed Oracle Essbase 11.1.1.3.0 on Linux Environment.I am not able to connect SQL(Open SQL) in Essbase EAS Client machine.
    Please let me know any scripts I have to run for SQL connection activation purpose.
    Please provide the necessary paths and procedures.
    waiting for your reply
    Many Many Thanks.

    Have you created a database (or have one you connect to)?
    Have you created the Net Service connections for SQL Developer to use?
    Does SQL Developer have access to this Net Serviice name?
    Have you created the connections from SQL Developer?
    Can you post an error message?
    See
    <br>
    Oracle Database FAQs
    </br>

  • Problem in running TVApplet code on client machine.

    Hi Friends
    I installed the JMF windows pack and ran the JMF Diagnostic applet
    successfully. Then I compiled and ran the TVApplet example code
    given by Sun through a htm file successfully in Internet Explorer on my
    machine.
    My operating system is Windows 2000 Professional.
    My Web server is Tomcat 4.1.31 which is installed at my machine itself.
    I am able to run this applet on my machine but when I access this
    applet on some different machine it is not running and seeing in Java
    Console,Exceptions are found as:-
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
    Can sombody help me here ???
    Why the applet is not running on the client side.
    Is the JMF APIs or some of its file required to be present at the client
    side.
    The client machine is having required version of Internet Explorer and client machine operating system is XP,2000.
    Thanks

    the jar file reqiured is jmf.jar this jar file will there in
    jmf_home/lib
    for example in my mechine
    C:\Program Files\JMF2.1.1e\lib this jar file contain all the file reqired to run the application
    i think you may need some of the dll files also to run see
    if reqiured the then it may throw exception
    java.lang.UnsatisfiedLinkError then put respective dll file to workiing folder or the system32 folder

  • Connecting to sql server database mdf file without installing sql server on client machine?

    I am creating a window application that need to use sql server database. I want to install this application to client machine without installing sql server so that my application can still connect to a database i.e mdf file that i will be providing at client
    system.
    How can i connect to a database(mdf) on client machine through my window application without installing sql server. ? I dont know is it possible or not.
    If possible what will be the connection string in that case. Database need not be used in network.

    you cant connect and view the internals of mdf file unless it being attached to a sql server instance as a database.
    The sql server instance can be installed in any box which is in the same domain and then you can connect from your application to it.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Saving report output on client machine

    Hi All,
    I'm using reports 6i. I'm running a report on the web which runs 5 reports inside it and it should save the outputs of these five reports in PDF format to the client machine. I can not give mime type as i don't want to show it in the acro. reader. What i want is, silently all these 5 outputs should get saved on the client machine and the main reports should say something like 'The reports generated and saved in c:\...... '. Can somebody help
    TIA
    Manish

    hello,
    what you can do, is to run the reports to file on the server in a directory, that is available as virtual path and then use e.g. javascript to fetch these reports.
    hope this helps,
    the oracle reports team

  • I need help in making the programe which updates our code into client machi

    I need help in making the programme which updates our code into client machine from the server.
    As yahoo messanger does if there is any updated version of yahoo messanger.
    It asks when we login into it do you want to update new version of yahoo messanger
    It automatically updates it
    Need Help??

    Sounds to me like you need Java Web Start.

  • Creating excel file on client machine using oracle pl/sql code

    Hi All,
    I have a situation where in i need to create an excel output file in my client machine, but using UTL_FILE i understood that i need to create the directory on server and i need to read and write on server itself.
    Is there any other way where we can create a excel file other than oracle server, bcos this is used only once and there is no scheduler to execute on server.
    Please do the needful.
    Thanks,
    Santhosh.S

    santhosh.shivaram wrote:
    I have a situation where in i need to create an excel output file in my client machine, but using UTL_FILE i understood that i need to create the directory on server and i need to read and write on server itself.I would say that you only need to to look at basic client-server architecture - what is the client component responsible for and what is the server component responsible for.
    The server should create the data set required by the client - do all the (intense) server processing that servers do well. This data set is then send to the client. The client is responsible for rendering that data set.. or saving it to the client machine storage if needed.
    Within PL/SQL that is quite easy to do using the most common/standard client-server in use today - web based client-server.
    The client is a web browser. It makes a call to the web server, that is serviced by a PL/SQL database procedure - a so-called web enabled procedure. It processes the request from the web browser, and returns a dynamic response. This response can range from HTML and XML, to video and image streams - and also CSV (Character Separated Values) data.
    By default, most web browsers will use the local client spreadsheet application (like MS Excel) to open the CSV response received. Many web browsers will also provide an alternate option of saving that response as a CSV file (that can then be opened later using MS Excel).
    Straight forward and basic client-server - and easily done using PL/SQL. Even easier done using (freeware) Oracle APEX (Application Express). APEX is a PL/SQL software suite that provides a web development system (only web browser required for development) and a run-time system to run the web application you have created.

  • Excel output of report on client machine

    excel output report on client machine
    hello
    i am running report from app server, output is excel file...
    using following URL
    web.show_document(rpt_url ||'&report='||rpt_path||'batch_idcards_print_excel.rdf&desformat=spreadsheet&destype=file&desname=c:\batch.xls','_blank');
    ----this stores the excel file at app server under c:\
    now i want to save it on client machine... how can i do that ?
    from one forum, i got help , so i changed URL as below
    web.show_document(rpt_url ||'&report='||rpt_path||'batch_idcards_print_excel.rdf&desformat=spreadsheet&mimetype=application/msexcel&destype=FILE&title=batch.xls','_blank');
    when i open report, no window opens for saving file...a new window opens and gets closed itself immediately...
    wht is the problem?... client machine having MS office excel 2003...

    Dear
    Could you, please, tell us what you've done to solve this issue? We're facing the same problem, and until now we couldn't figure out what is exactly happening.
    Thanks in advance for any help.

  • Create sql trace files on client machine

    Hi
    oracle creates sql trace files on server side, what are possible and best ways of sharing those files with end users? is it possible to create them on client side instead?

    Dbb wrote:
    Hi
    Hi
    oracle creates sql trace files on server side,
    Yes
    what are possible and best ways of sharing those files with end users?
    Using shared directory. Use the parameters dump to point to it
    is it possible to create them on client side instead?
    No
    . :-) any help with my english is wellcome :-) .does this mean sharing user_dump destination at linux level and then mounting it from client machines ( win xp )?is there any doc on this?

  • A database error occurred. Source: Microsoft SQL Server Native Client 10.0 Code: 1205 occurred

    Hi
    i am getting these errors in sharepoint server event viewer, and when i see the sql server the log files disk is full memory only some mbs left out of 1 TB
    Log Name:      Application
    Source:        Microsoft-SharePoint Products-SharePoint Server Search
    Date:          7/12/2014 9:56:04 PM
    Event ID:      57
    Task Category: Search service
    Level:         Warning
    Keywords:     
    User:          XYZ\svc-mc-sps3eServsear
    Computer:      SPFIND01.xyz.gov.local
    Description:
    A database error occurred. Source: Microsoft SQL Server Native Client 10.0 Code: 1205 occurred 1 time(s) Description: Transaction (Process ID 193) was deadlocked on lock
    resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    Context: Application 'XYZSP_SearchApp'
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-SharePoint Products-SharePoint Server Search" Guid="{C8263AFE-83A5-448C-878C-1E5F5D1C4252}" />
        <EventID>57</EventID>
        <Version>14</Version>
        <Level>3</Level>
        <Task>136</Task>
        <Opcode>0</Opcode>
        <Keywords>0x4000000000000000</Keywords>
        <TimeCreated SystemTime="2014-07-12T18:56:04.665684900Z" />
        <EventRecordID>225666</EventRecordID>
        <Correlation />
        <Execution ProcessID="3408" ThreadID="2932" />
        <Channel>Application</Channel>
        <Computer>SPFIND01.xyz.gov.local</Computer>
        <Security UserID="S-1-5-21-1537596049-1164153464-4201862467-47315" />
      </System>
      <EventData>
        <Data Name="string0">Microsoft SQL Server Native Client 10.0</Data>
        <Data Name="string1">1205</Data>
        <Data Name="string2">1</Data>
        <Data Name="string3">Transaction (Process ID 193) was deadlocked on lock resources with another process and has been chosen as the deadlock
    victim. Rerun the transaction.</Data>
        <Data Name="string4">
    Context: Application 'XYZSP_SearchApp'</Data>
      </EventData>
    </Event>
    A database error occurred. Source: Microsoft SQL Server Native Client 10.0 Code: 9002 occurred 1 time(s) Description: The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'.
    Context: Application 'XYZSP_SearchApp'
    adil

    If you've run out of disk space for your SQL databases then of course you'll get errors. Fix SQL then look to see if you're still getting errors.

  • Pagination of output  php code with sql code

    if one program of php including sql query
    it seems to output wrong .(means some data will be calculated sum)
    if php code output all data in one page.pagination
    it seems to output right(means some data will be calculated sum)
    if there has column of company including two companies of A and B.
    and if each page output 3 lines while A company has 4 lines in sql query,so
    the last line of A company will output in second page,
    i want to calculate A company including 4 lines sum
    how to calculate sum of company of A in second page.
    i think it will be a good interesting question of php code with sql code.
    who can solution thus question ?
    thanks !

    Hi,
    for Example:
    SELECT sum(quantity * price)
    FROM orders
    WHERE COMPANY = 'A';
    This will give you the total amount for company A.
    But remember that your example table will give no output, since you have no price column. So you must decide, what which sum to calculate.
    A sum only calculated over the quantity makes IMHO no sense, because there are apples and bananas ...
    Greetings from Hamburg
    Thorsten Körner

  • SQL Code Output

    Hello All,
    Does anyone know if it possible to get SQL code ouput for the rules resulting from clustering?
    Thanks,
    Alan

    I'm still not sure that I understand what you are doing...
    You're using SQL Developer. Are you using Oracle Data Mining? Unfortunately, Oracle the corporation and Oracle the database use the term "cluster" in a lot of different places so it has a lot of potential meanings. It sounds like you're trying to run a clustering algorithm using Oracle Data Miner on a sample data set.
    If that's the case, you probably want to post this over in the Data Mining
    Justin

  • How to FTP a file from client machine to database server using forms 10g

    Hi
    I want to ftp a file from a client machine to the database server machine using forms 10G (or PL/SQL).
    could you please tell me how can I do this
    Regards

    hi
    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: Oracle_Home is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    Oracle_Home with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
    and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
    C:\webutile is the folder where you extracted Jacob, and will end in ...\jacob_18
    cd C:\webutile
    copy jacob.jar Oracle_Home\forms\java\.
    copy jacob.dll Oracle_Home\forms\webutil\.
    The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
    Open a DOS command prompt.
    Add Oracle_Home\jdk\bin to the PATH:
    set PATH=Oracle_Home\jdk\bin;%PATH%
    Sign the files, and check the output for success:
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\frmwebutil.jar
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
    you may skip this step. Otherwise,
    Create a schema to hold the WebUtil stored code, and privileges needed to
    connect and create a stored package. Schema name "WEBUTIL" is recommended
    for no reason other than consistency over the user base.
    Open Oracle_Home\forms\create_webutil_db.sql in a text editor, and delete or comment
    out the EXIT statement, to be able to see whether the objects were created witout
    errors.
    Start SQL*Plus as SYSTEM, and issue:
    CREATE USER webutil IDENTIFIED BY [password]
    DEFAULT TABLESPACE users
    TEMPORARY TABLESPACE temp;
    GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
    CONNECT webutil/webutil@rcci
    @Oracle_Home\forms\create_webutil_db.sql
    -- Inspect SQL*Plus output for errors, and then
    CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
    Reconnect as SYSTEM, and issue:
    grant execute on webutil_db to public;
    5) Modify Oracle_Home\forms\server\default.env, and append Oracle_Home\jdk\jre\lib\rt.jar
    to the CLASSPATH entry.
    6) Modify Oracle_Home\forms\server\formsweb.cfg insde [default] add :
    archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
    archive=frmall.jar
    also add :
    [webutil]
    WebUtilLogging=off
    WebUtilLoggingDetail=normal
    WebUtilErrorMode=Alert
    WebUtilDispatchMonitorInterval=5
    WebUtilTrustInternal=true
    WebUtilMaxTransferSize=16384
    baseHTMLjinitiator=webutiljini.htm
    baseHTMLjpi=webutiljpi.htm
    baseHTML=webutilbase.htm
    archive_jini=frmall_jinit.jar
    WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
    archive=frmwebutil.jar,f90all.jar
    lookAndFeel=oracle
    7) Modify Oracle_Home\forms\server\webutil.cfg and add :
    transfer.database.enabled=TRUE
    transfer.appsrv.enabled=TRUE
    8) Start the OC4J instance
    9) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
    Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
    It is important to generate the PLX, to avoid the FRM-40039 discussed in Note 303682.1
    If the PLX is not generated, the Webutil.pll library would have to be attached with
    full path information to all forms wishing to use WebUtil. This is NOT recommended.
    10) Create a new FMB.
    Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
    There is no need to Subclass the WebutilConfig object.
    Attach the Webutil.pll Library, and remove the path.
    Add an ON-LOGON trigger with the code
    NULL;
    to avoid having to connect to an RDBMS (optional).
    Create a new button on a new canvas, with the code
    show_webutil_information (TRUE);
    in a WHEN-BUTTON-PRESSED trigger.
    Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    11) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
    the "Application Server URL" is empty.
    Then append "?config=webutil" at the end, so you end up with a URL of the form
    http://server:port/forms/frmservlet?config=webutil
    12) Run your form.

  • Generating outputfile on client machine.

    Hi.
    We all use various development tools such sqlplus, pl/sql developer, toad etc...
    some time (most of the time) user comes with adhoc requirement.
    so we write some code, (which we only know) and get the output.
    so we 'spool' and dbms_output to write line.
    dbms_output has buffer restriction.
    is there any package which will write to client machine directly. (utl_file writes on db server, so it is not useful. text_io/client_text_io work inside forms)
    regards

    Simple answer no. How can server-side code (like PL/SQL) hack its way across a network into some unknown client platform (could be Windows, Linux, OS/X, etc), and break into that client platform's file system to write data to it?
    More complex answer. Quite easy within the proper concepts of client-server. Top of the list is having the client use a browser to "access" the data - and the developers writing PL/SQL procedure that, instead of using DBMS_OUTPUT, uses the HTP package instead. In this case the PL/SQL code "writes"to a HTML buffer (page). This buffer is then rendered by the user's browser.
    The components underneath this is Apache and MOD_PLSQL (Oracle's HTTP Application Server), or DBMS_EPG.
    Even easier is using APEX - Oracle's Application Express.

Maybe you are looking for

  • Is there an app to create, save, edit and view Microsoft Office Documents on the iPad2?

    I am currently enrolled in online classes and I have to have Microsoft Office to access Word, Excel, Powerpoint for the classes. I have a laptop and an iPad2 but do not have Microsoft Office on either. Rather than purchase it on windows, I wanted to

  • Download the output of smartform into excell sheet

    Hi Experts, We have one smartform for list out the  Shipment  packing list. Now the requirement is we need to download  into excel file output of the samrtform when we issue the output. Please help on this issue to resolved. Thanks and regards, Amjad

  • WARN No Users Pattern

    Hi all, I use Jdev 11.1.2.2 I get the below stack trace each time i login to the system even though the user is getting authenticated it throws this error. In weblogic server I have given the DefaultAuthenticator as sufficient and LDAP as sufficient

  • Modifying E-Mail content for Standard ESS Application

    Hi ESS Experts, We are using Loan Encashment and Leave Encashment applications in ESS and system is triggering mail to approver and employee. How we can modify the text of Mail Content approver and employee receiving. Kindly provide your valuable inp

  • Problem in setting ClassLoader

    I m trying to Change the class Loader in a programm. I m using a instance of URLClassLoader . plz look at the following programm. import java.net.*; import org.python.util.PythonInterpreter; import org.python.core.*; class Test      public static voi