Using DDE package

Dear all,
i'm using oracle 9i version 9.2.0.1.0, i want to get data from an excel fie excel version 2003.
i'm using the same code in the help
DECLARE
     CONVID PLS_INTEGER;
BEGIN
CONVID := DDE.INITIATE('EXCEL','C:\abs.xls');
DDE.REQUEST(CONVID,'D4',BUFFER,DDE.CF_TEXT,1000);
end;
but each time i'm getting this error ora-106555 and ora-106553, and i can't find enough explanation either in google or in other posted messages here.
can u help me plz

Hi,
We have implemented it using the following command.(But it is a word document).
But it requires some configuation.Like u need to place the MS09.dll and WinWord.EXE in the c:\MSOFFICE.
AppID := DDE.APP_BEGIN('c:\MSOFFICE'||:blk01.image_file,
     DDE.APP_MODE_MAXIMIZED);
Hope this will help u.
Regards,
Alok Dubey

Similar Messages

  • How to use DDE package in form 10g module

    Hi All,
    I am using DDE.package in form 10g for uploading excels data in oracle database at windows platform but it is showing non-oracle exception.
    Thanks

    hi
    mehwish............just do for attachment.......
    u can also use something like this...
    Execute send_mail;and also.
    try something like this..
    example:
    begin
    mahi.mail('email address','subject','message','attachment');
    end;Edited by: Sarah on Apr 18, 2011 10:25 AM

  • Using DDE package in report builder 10g

    Hi,
    I use this code in form 10g to edit a ms word and its work properly:
    DECLARE
    APPID PLS_INTEGER;
    CONVID PLS_INTEGER;
    DOCID PLS_INTEGER;
    SYS_DATE CHAR(8);
    BEGIN
    SELECT TO_CHAR(SYSDATE,'MM/DD/YY') INTO SYS_DATE FROM DUAL;
    APPID := DDE.APP_BEGIN('C:\Program Files\Microsoft Office\Office12\WINWORD.EXE',
    DDE.APP_MODE_MINIMIZED);
    CONVID := DDE.INITIATE('WINWORD','SYSTEM');
    DDE.EXECUTE(CONVID,'[FileOpen "c:\bin_test\exp.dotx"]', 10000);
    DOCID := DDE.INITIATE('WINWORD','c:\bin_test\exp.dotx');
    DDE.POKE(DOCID,'BOOKMARK1', SYS_DATE,DDE.CF_TEXT,10000);
    DDE.EXECUTE(DOCID,'[FileSaveAs "c:\bin_test\output.doc"]', 10000);
    DDE.TERMINATE(CONVID);
    END;
    when I put this code in the afterreport trigger in report builder 10g and call the report from form;
    a blank document word is opened withoud any changes as well as the report result in pdf format.
    what can i do to let this code work in report builder??
    best regards,
    Ahmad

    I use this code in form 10g to edit a ms word and its work properlyI very much doubt that. Calling DDE from Forms this way would result in trying to open Word on the <b>server</b>.
    the report result in pdf formatThe report result format is determined by how it is called. Looks like you call it with desformat=pdf.

  • Printing pdf using DDE

    Hi , I want to print pdf files from Forms 6i using DDE package. If any one has done this type of thing , please send me the code for the same. Please help. I have opened a sample pdf file using DDE with the following code:
    DECLARE
    AppID PLS_INTEGER;
    BEGIN
    AppID := DDE.App_Begin('C:\Program Files\Adobe\Acrobat 4.0\Reader\AcroRd32.exe c:\temp\test.pdf',DDE.App_Mode_Maximized);
    END;

    You already have a PDF -which you generated- and you want to print it -which you can't-.
    Right.
    Where did the PDF go? Save / Open in the browser, left on the filesystem somewhere...
    You really have to try to be more specific about your particular problem otherwise there is no way in the world i will be able to help you.

  • WebUtil and DDE-package

    Hello,
    does anybody know, if there will be something like a CLIENT_DDE-package (related to the old DDE-package of forms) in webutil. The first announcements of Oracle about WebUtil told so, but now there is nothing left about it.
    Any suggestions?
    Thank you in advance!

    Roelof J van Suilichem
    In forms 9i, which is on web architechture, does DDE work ?
    i.e. if I want to read a .xls located on a network drive, and load that data into a table, is it possible using DDE in forms 9i.
    Thanks

  • Using DDE with Oracle Forms for uploading Excel data

    Hi There,
    I have used DDE in Forms to upload data from Excel.
    The code which I have implemented is as follows:
    DECLARE
    iApplication pls_integer;
    iConv pls_integer;
    v2Buffer varchar2(100);
    v2text varchar2(100);
    nLength number;
    nTransactionId number;
    /* these varrays are defined in a package specification*/
    vExcelProduct p_upload_functions.prd_no:=p_upload_functions.prd_no('1');
    vExcelVpc p_upload_functions.vpc:=p_upload_functions.vpc('1');
    BEGIN
    /*Open an DDE Server application*/
    iApplication:= DDE.App_Begin('C:/excel.exe ‘||v2fileName,DDE.App_Mode_Minimized);
    iConv:=DDE.Initiate('EXCEL',v2filename);
    BEGIN
    /* first row of the sheet used for title . So loop is started from 2*/
    /* Reading a row*/
    FOR I IN 2..10000
    LOOP
    /* Reading columns of a particular row*/
         FOR J IN 1..n / * n be the number of columns in excel sheet */
         LOOP
    /* generate the cell no of excel sheet from where data will
    be fetched- R is used for row no and C is foe column no*/
         v2text:='R'||I||'C'||J||':'||'R'||I||'C'||J;
    /* Store the value in variable */
    dde.request(iConv,v2text,v2Buffer,dde.cf_text,1000);
    /*Stores values in the varrays for a row*/
    IF j=1 THEN
    /* for first column*/
    nLength:=length(v2Buffer);
    vExcelOrg(I-1):=To_Number(substr(v2Buffer,1,nLength-2));
         /* for second column */
    ELSIF j=2 THEN
    nLength:=length(v2Buffer);
    vExcelProduct(I-1):=substr(v2Buffer,1,nLength-2);
    END IF;
    END LOOP;
    /*Exit the loop when it encounters an empty row*/
    IF vExcelProduct(I-1) IS NULL AND vExcelOrg(I-1) IS NULL THEN
    EXIT;
    END IF;
    /* Otherwise extending the varray*/
    vExcelProduct.extend;
    vExcelOrg.extend;
    /* Reading the next row*/
    END LOOP;
    /* Now close the DDE application */
    DDE.app_end(iApplication);
    DDE.terminate(iConv);
    EXCEPTION
         WHEN Others THEN
         DDE.app_end(iApplication);
    DDE.terminate(iConv);
    RAISE Form_Trigger_Failure;
    END;
    I am facing a problem, I will appreciate if you can give some insights to help.
    We have been having problem logging in to application when there are a number of EXCEL processes running (17-18) on the server. Users that have already logged in have no problem, but new login will get "FRM-92101 There was a failure in the Forms Server during startup". The Forms Server itself is running fine. After we killed a few EXCEL processes, new users will be able to login.
    Thanks and regards,
    Mandeep

    this is a trial method and right now i am trying to read only the first cell of the excel sheet and return that value and show it in the UI when the user presses the button but this code is not returning any value.
    METHOD read_excel.
      INCLUDE ole2incl.
      DATA: filename(128) TYPE c,
                excel TYPE ole2_object,
                cell TYPE ole2_object,
                workbook TYPE ole2_object,
               pfile TYPE localfile VALUE
               'C:\Documents and Settings\I047323\Desktop\new.xls',
                name TYPE string.
      CREATE OBJECT excel 'EXCEL.APPLICATION'.
      SET PROPERTY OF excel 'VISIBLE' = 0.
      CALL METHOD OF excel 'WORKBOOKS' = workbook.
      CALL METHOD OF workbook 'OPEN'
        EXPORTING  #1       = pfile.
        CALL METHOD OF excel  'CELLS' = cell
          EXPORTING
            #1      = 1
            #2      = 1
        GET PROPERTY OF cell 'VALUE' = value.
      CALL METHOD OF workbook 'SAVE'.
      CALL METHOD OF workbook 'CLOSE'.
      CALL METHOD OF excel 'QUIT'.
      FREE OBJECT excel.
    ENDMETHOD.
    Edited by: neelima v on Jan 14, 2008 4:06 PM

  • DDE Package refusing to take more than 265 CHAR

    Dear all,
    i'm using Oracle 9i, i'm using the DDE package to get data from Excell
    this is my code
         DECLARE
         CONVID PLS_INTEGER;
         AppId PLS_INTEGER;
         BUFFER VARCHAR2(5000);
         LEN NUMBER;
    BEGIN
    AppId := Dde.App_Begin('C:\Program Files\Microsoft Office\OFFICE11\Excel.exe C:\abc.xls' , DDE.APP_MODE_MAXIMIZED );
    CONVID := DDE.INITIATE('EXCEL','C:\abc.xls');
    DDE.REQUEST(CONVID,'R7C6',BUFFER,DDE.CF_TEXT,10000);
    :DATA:= BUFFER;
    DDE.TERMINATE(CONVID);
    DDE.APP_END(APPID);
    END;
    the R7C6 cell contain a text of 270 character. in the buffere it is returning only 265 character.
    if anyone please can tell me what cuase this.
    Message was edited by:
    nbreik

    If changing the data type to CLOB is NOT a option at the moment then you can work around using DBMS_SQL to get the LENGTH of the LONG column.
    Something Like what I have below (Not tested) –
    In this Function, I am passing the “Id” <Key> of the record to search and check the length of the LONG column. You can chose to pass ROWID instead.
    Declare
    lRtnLen Number := 0;
    FUNCTION fn_len_long_str ( p_RecId In Number )
    RETURN number As
    mycursor Integer default DBMS_SQL.open_cursor;
    l_x number;
    l_long_value varchar2(32760);
    l_len_of_long number;
    l_blen number := 32760;
    l_pos number := 0;
    BEGIN
    DBMS_SQL.parse( mycursor, 'select col2 from Test3 Where Col1 = :pCol2',
    dbms_sql.native );
    DBMS_SQL.bind_variable( mycursor, ':pCol2', pId );
    DBMS_SQL.define_column_long(mycursor, 1);
    l_x := DBMS_SQL.execute(mycursor);
    if (dbms_sql.fetch_rows(mycursor)>0)
    then
    loop
    DBMS_SQL.column_value_long(mycursor, 1, l_blen,
    l_pos ,
    l_long_value, l_len_of_long );
    l_curpos := l_pos + l_len_of_long;
    EXIT when l_len_of_long = 0;
    end loop;
    end if;
    DBMS_SQL.close_cursor(mycursor);
    RETURN l_curpos;
    exception
    when others then
    END fn_len_long_str;
    Begin
    lRtnLen := fn_len_long_str (Pk_Of_The_Table);
    Dbms_output.Put_Line ('Len Of LONG = ' || lRtnLen);
    End;
    /

  • OLE2 and DDE package books

    Hi All,
    I need to fully understand OLE2 and DDE package. Pressing F1 provides very limited help for me. Anyone here have or know some links of any reading materials(e-books, documentation)?
    Please share... I'm drowned with my tasks here.
    Thanks!

    DDE is seriously outdated and should only be considered as a last resort. As for OLE2, concern yourself not with learning the OLE2 package, but instead, with understanding OLE automation. The OLE2 package is just a wrapper that makes it possible to manipulate OLE automation servers from PL/SQL. Once you understand OLE, using OLE2 should come easily.
    I learned OLE automation as a Visual Basic developer, before ever working with Oracle, and found it to be fairly straightforward. The easiest and cheapest way to learn OLE automation is by using Microsoft's Visual Basic for Applications IDE -- an Office component. Search this forum using keywords VBA and Tutorial, and you will find information that should hopefully prove helpful.
    As for Mark's assertion that XML provides a simpler solution, there are important differences between the XML and OLE approaches. The XML approach involves simply creating a document, whereas the OLE approach involves instructing the OLE server application to create a document. XML might be perfect, for example, if you wish to create Word documents on a *NIX server.  On the other hand, when your environment permits it, OLE makes it possible to leverage application functionality, like Excel's data analysis functions.
    Eric Adamson
    Lansing, Michigan

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • How to delete data from a file using IO package

    Hi All,
    i am trying to remove some content of the file.
    this content is not at starting of file not even at end of file.
    can anybody tell me how can i delete number of lines from file using IO package.

    iam having some data in text file .ex:in flowrist.txt
    12/5/07,500,300,6000 like many set of datas are
    there.In these if i want to delete the data based on
    the date which i specified.How to do this specific
    deletion?You need to open a stream to read in the file and then use the indexOf method provided in the Sting class to check if the line contains the date or whatever String you are looking for, if so then skip that line and store or re-write the lines you wish to keep, as well as some extra lines you may wish to add.
    Take a look below at this example found on Google.
    http://www.java-tips.org/java-se-tips/java.io/how-to-read-file-in-java.html
    The above read a file line by line and prints it to console. You should be able to modify this, instead of using System.out to print the line you should use index of to check the lines for a date/String. Index of return -1 if the String you specify is not in the line you parse.

  • Using DDE from server machine

    Hi guys, need some help..
    I have designed a forms application(10g). It sits on a server so it can be accessed by multiple users from different computers. I have a documents form which you can use to open documents using DDE as follows
    AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office11\EXCEL.EXE '||:SCR_DOCUMENTS.doc_path, DDE.App_Mode_maximized);
    But the document is being opened on the server and not on the client machine, cos obviously its referencing the excel.exe on the servers C drive.
    How do i get this to work so it opens the document on the client machine?

    It will not work on ur client machine as the EXCEL.EXE path may be different on client machine.
    Microsoft changes the path of EXE files according to the version it releases.
    It happens when u upgred existing MS office.
    u will have to get the value of registry entry from the local machine for EXCEL.EXE
    and then try again, hope it will work
    nJoy
    Shantaram

  • Help finding and using a package

    hi guyz,
    Iam new to this forum and i need this info urgently. so plz try to help me.
    I want to use the package below in an applet to convert my TemporaryRegistrationPermit to create a PNG file and then print it.
    how can i get the above package. I searched a lot on net and even on IBM website but never found it. How can i get it and include the class file in an applet and use the methods in it.Is there any other way to include this package in my applet, i mean a URL pointing to this class file.
    package com.ibm.gs.houston.saz.trp.utils.TemporaryRegistrationPermit
    I would really appreciate an early reply
    thank you
    tarun

    How do you know you need this package ? You know the path to it, so you must have seen it referenced somewhere.
    Some background please, but it sounds like it's an IBM internal class of some sort, so I wouldn't get your hopes up unless you have legitimate access to this or know it to be freely available.
    D.

  • Submitting Oracle job via OCCI using dbms_job package

    I am using 10g client to connect to a 9i Database on Redhat Linux AS 3.0.
    I am trying to submit a job via OCCI. I get back a jobId, but don't see the job in the user_jobs table or the result of the job being executed.
    I am using occi::Statement in the following way :
    stmt = connection->createStatement("begin dbms_job.submit(:v1, 'submitJobTest;', sysdate,'sysdate+1'); end;");
    // where submitJobTest is a stored procedure
    stmt->registerOutParam(1, OCCIINT);
    stmt->executeUpdate();
    int jobId = stmt->getInt(1);
    I get back a job id, but can't find it in the user_jobs. The first time I executed the program, i got back jobId 0, then 1 and so on..
    Any ideas? Do I need to use dbms_scheduler package?
    Thanks, Nilofer

    Good catch!
    Had a bug, in that my autocommit was not being set!
    Works now.
    Thanks,
    Nilofer

  • How to print new line using DBMS_OUTPUT package

    Hi,
    I am trying to print a new line using DBMS_OUTPUT package. but it do not print the new line.
    set serveroutput on size 200000
    set feedback on
    BEGIN
    DBMS_OUTPUT.PUT_LINE('First Line');
    DBMS_OUTPUT.PUT_LINE('');
    DBMS_OUTPUT.PUT_LINE('Second Line');
    END;
    I expect following output ...
    First Line
    Second Line
    but i got following output....
    First Line
    Second Line
    why DBMS_OUTPUT.PUT_LINE( '); is not printing a new line ?

    You can try the following:
    SQL> ED
    Wrote file afiedt.buf
      1  BEGIN
      2  DBMS_OUTPUT.PUT('ONE LINE...');
      3  DBMS_OUTPUT.PUT('SECOND LINE...');
      4  DBMS_OUTPUT.NEW_LINE;
      5  DBMS_OUTPUT.PUT_LINE('THIRD LINE WITH NEW LINE...');
      6  DBMS_OUTPUT.PUT('TEST');
      7  DBMS_OUTPUT.NEW_LINE;
      8  DBMS_OUTPUT.PUT_LINE('FOURTH LINE'||CHR(10)||'EXAMPLE');
      9  DBMS_OUTPUT.PUT_LINE(CHR(10));
    10  DBMS_OUTPUT.PUT_LINE('FIFTH LINE');
    11* END;
    SQL> /
    ONE LINE...SECOND LINE...
    THIRD LINE WITH NEW LINE...
    TEST
    FOURTH LINE
    EXAMPLE
    FIFTH LINE
    PL/SQL procedure successfully completed.Documentation:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_output.htm#i1000062

  • How do I create and use a package?

    Sorry for the noobish question, but I have never had the need to use a package and currently would like to learn how they work just to satisfy my own curiosity.
    Suppose I have a file named Node.class in a folder named Classes, and I have another class named Main.class sitting in another folder. I want to create a Node object using the Main class.
    How do I accomplish that? Would I need to use a package?
    I tried to write package Classes; on my Main file but it did not work. thanks

    This is an old explanation I wrote:
    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    And a statement to run the program is:
    java myapp.aProgram
    (This can be issued from any directory, as Java will search for the program, starting the search from the classpath directories.)
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

Maybe you are looking for