Invoke Report From Database trigger

Hi,
Is it possible to invoke a report from a database trigger?
The requirement is to start a report after a record was inserted in a table.
Thank you,
Alex.

Hi
I was looking for exactly the same thing. I need to invoke a report in response to an update in the database. To make things even more complicated, I want to send the report to an email add. Is that something anyone has already taken a look at? Any help appreciated.
_*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Is there any way to run a report from database?

    Is there any way to run a report from database using trigger?
    A report needs to be printed out when a new row is inserted into a table.

    If you are using the Reports Server it is possible to start a report from a trigger by using the UTL_HTTP package (in the sys schema) to call the report URL. This should work with DESTINATION=PRINTER.
    Hope this helps.

  • How to send error message to forms from Database Trigger

    Hi, Please help me to send error message to forms from Database Trigger?
    RgDs,
    Madesh.R.M

    You are correct, the On-Error trigger is a Forms trigger. However, if your Form is going to display the error generated by the database stored procedure or trigger - you might not see the database error in your Form unless you check the DBMS_ERROR_CODE in the On-Error trigger and manually display the Error Code and associated Text. I've see this happen with a co-worker. The Form she was working on was based on a table with an Before-Insert trigger. Because she was not explicitely handling the error from the Before-Insert trigger in the Forms On-Error trigger, her Form appeared to halt for no reason at all. Once she added code to the On-Error trigger in the Form to handle the DBMS_ERROR_CODE, she discovered the trigger was producing an error and was able to show the error to the user in the On-Error trigger.
    I understand the desire to keep as much as possbile in the database, but with that comes some extra coding in your Forms to handle this. This extra coding could easily be placed in a Forms Library, attached to a Form and called in the On-Error trigger. Your code could look like this:
    DECLARE
       /*This example assumes you have an Alert defined
          in your Form called: 'ERROR' */  
       al_id    ALERT;
       al_text  VARCHAR2(200);  /* Max text of a Forms Alert message*/
       al_btn   NUMBER;
    BEGIN
    IF DBMS_ERROR_CODE != 0 THEN
       /* Error code is ORA-00000 Normal Successful completion
           So only handle non-zero errors  */
       al_text := DBMS_ERROR_CODE||':'||DBMS_ERROR_TEXT;
       al_id := Find_Alert('ERROR');
       set_alert_property(al_id, alert_message_text, al_text);
       al_btn := show_alert(al_id);
    END IF;
    END;Your original question was "How to send error message to forms from Database Trigger?" The answer is you don't because Forms already gets the database error code and database message through the Forms DBMS_ERROR_CODE and DBMS_ERROR_TEXT functions. Look these up in the Forms help and it should clear things up for you.
    Craig...
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:50 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM

  • Calling form .fmx or report .rep from database trigger. (URGENT PL.)

    can we call an form (.fmx) or a report (.rep) from a database trigger. that is when there is some insertion in the table i want to call a report which will take the parameters from the table changed.
    regards
    vishal

    JDeveloper and ADF

  • How can I call a Report From database function

    Hi all,
    I want to call a Report from a database function. Could you hel
    me???
    Rgds

    Hello there!
    There is a solution for executing an executable like RWRUN60
    from PL/SQL on http://asktom.oracle.com/pls/ask/f?
    p=4950:8:227101::NO::F4950_P8_DISPLAYID,F4950_P8_B:150612348067,Y
    Or you can invoke the CGI from the Reports-Server through
    UTL_HTTP
    Hope this helps
    Dannys

  • Generate report from database using .xsl style sheet

    I am trying to view test result histories for specific uut serial numbers.
    We are logging all test data to the default access database template that was provided with Teststand.
    Is there a method of generating reports from the database that match the format of those generated at runtime?
    I was surprised to find that the default access database did not contain any gui or pre-made reports matching the xsl style sheets chosen in the report options dialog.
    My database skills are weak, I am able to browse the raw data and I see the relationships between some of the tables, but the prospect of recreating one of the xml report formats in access seems daunting. Am I missing something? what is the best way to print a uut report from test data stored in access?

    Hello msears,
    Thank you for posting on the NI Discussion Forums.  Unfortunately there are no tools available in TestStand for directly converting an Access database to a formatted .xsl report.  It is possible to have a step in a sequence that reads the information from the database, and create the .xsl report as if it had been generated at sequence run-time, by writing those values directly to Locals.ResultList.  Admittedly, this would require some knowledge of Microsoft Access, and the ability to write a program that will extract information from the database, in order to include it as a step in the sequence.
    Is there anything stopping you from creating a formatted .xsl report when the sequence is run (instead of trying to create it from previous data stored in an Access database)?
    Chris_G
    Sr Test Engineer
    Medtronic, Inc.

  • Generate Test Report from database

    Hi
    How can i generate a Html Test Report from a UUT Test that i logged about a week ago?
    Does Teststand have a pre built sequence for this?
    Help share your knowlegde

    Shako-
    I see that you also posted this question in this forum.  As Taylor mentioned, there isn't a tool to generate a report from data in a database.  You can create a sequence to call into a database and then generate a report.  I would look at the example located at C:\Users\Public\Documents\National Instruments\TestStand\Examples\Database for reference.
    Thanks,
    Sean
    Applications Engineering Specialist - Semiconductor Test
    National Instruments

  • Invoking reports from menu in designer 10.1.2

    Hello,
    i'am working on a 6 to 10g migration and have some problems whith the menu that invoke reports.
    It seems that my predecessor has use the migration utility to migrate the menu.
    So that the call to run_product where change to rp2rro_run_product.
    But when i try to generate it with designer the call is CGNV$INVOKE_REPORT
    1) Is there a possibility to change some generating preferences to have the rp2rro_run_product call instead of CGNV$INVOKE_REPORT?
    2) When i compile the generated menu in windows the CGNV$INVOKE_REPORT compiles fine but when i move it to the linux server et try to recompile it failed saying that CGNV$INVOKE_REPORT must be declared ?
    I check that the OFGNAVL and the OFGMNL pll are attached and in the path for compilation
    Can someone help me please ?
    Regards
    Jean-Yves

    Thanks for your response and sorry for late feedback.
    I tried to set MNUDRC but was unsuccessful.
    It seems that the MNUDRC preference doesn't work in 10g refering to the documentation.
    Default:     RUN_PRODUCT (REPORTS, '<MODULE>',SYNCHRONOUS,RUNTIME,FILESYSTEM,'','');
    Values:     Up to 240 characters
    Levels:     Container, Module
    Category:     Menu - Gen Options
    In Oracle Designer 6i only, use this preference to specify the command to run a report from a generated menu item if the repository module's Command Line property is not set or if the MNUUCL preference is set to No.
    For more information about using this preference, refer to Setting a menu item's Menu Item Code property.
    In Oracle9i Designer, this preference is not used. For the alternative preferences to use, see Report invocation preferences.
    Related preferences
    MNUUCL
    I also tried the 'Command line' property of the report with not more success.
    For the moment, I can't generate the menu with appropriate rp2rro command line for the reports. Is there a way to achieve this?
    Regards
    Jean-Yves

  • Oracle reports from database

    Dear all,
    Is there any way to print reports to file from database, without using IAS?
    King regards

    The RWServlet, for 'real' deployments is provided as part of oracle application server/weblogic. In 10G you can just run forms and reports services, not sure about 11g.
    If you have it running you could use RWCLIENT from the database server (Possibly scheduled via DBMS_SCHEDULER) to run the reports.
    I vaguelly remember running a local standalone RWServlet instance on my development machine for development purposes, you could probably get that working, but for a production environment as far as I am aware you will need a licensed copy of either full weblogic/Application server or just forms and reports services.
    Is this an existing report/set of reports you need to run, or for a new development? If it is new it might be worthwhile looking at alternative technologies, if you have already made an investment in the reports then you are probably best persevering with the reports option.

  • How to Invoke Reports from Oracle Menus

    Hi,
    Pls. check the code for calling report from menu item.
    For my report below I am not passing any parameter just calling a report in the menu item.
    When I am calling the report option from the menu it is
    Giving error message in the report engine which is
    Starting report hdg04103 [Sun Mar 24 14:22:11 2002] ...
    REP-0002: Unable to retrieve a string from the Report Builder message file.
    REP-1439:
    End report hdg04103 [Sun Mar 24 14:22:15 2002].
    Pls. Look into the problem and mail me at your earliest.
    Declare
    t_sttm number(4);
    t_edtm number(4);
    t_worktime varchar2(4);
    pl_id paramlist;
    pl_name varchar2(20) := 'tempdata';
    Begin
    Select sttm,edtm into t_sttm,t_edtm
    from rtaad231 where usrid = :global.usrid and cses = 'HDG04103';
         Select to_char(sysdate,'hh24mi') into t_worktime
         from dual;
    if to_number(t_worktime) >= t_sttm and to_number(t_worktime) <= (t_edtm - 0015) then
    pl_id := get_parameter_list('tempdata');
    if not id_null(pl_id) then
    destroy_parameter_list(pl_id);
    end if;
    pl_id := get_parameter_list('tempdata');
    if id_null(pl_id) then
    pl_id := create_parameter_list('tempdata');
    end if;
    Run_Product(REPORTS, '\\rcadon\oradata\applive\hedging\reports\hdg04103.rep', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id);
    else
    Message('You are not authorised to use this option at this time');
    Message('You are not authorised to use this option at this time');
    end if;
    Exception
    When NO_DATA_FOUND then
         Message('You are not authorised to use this option');
         Raise Form_Trigger_Failure;           
    End;
    Regards
    Saleemuddin.

    If you are not passing any parameters, you don't need to pass the parameter string. Replace the pl_id with "null" or use the 2 double quotes to represent the null eg. "" and see if you still get the same error

  • Is there a way to mass export/save the reports from database to server

    Hi Everyone,
    Hope all is well,
    We use Discoverer to report off of an ODS. We are moving from ODS 3.1 to ODS 8.
    Is there a way to mass download the reports into ODS 8.
    My idea at this time, would be to individually save as the query to a folder on server.
    Then open another Discoverer instance, sign to ODS 8, open the query from server and do save as to database.
    This would take time ....
    Please advise with your thoughts and ideas, tx, sandra

    hi sandra,
    This question can be answered by Michael,he is expertise in sungard banner.
    By,
    Kranthi.

  • Running report from database package

    Hi,
    I have a database package and it gets soem details and submits the report using SRW. It has submitted successfully. But the report is not outputed but there is file with extension eps. Can the package pass the user variables??
    The package code follows:-
    PROCEDURE p_submit_copy_invoices(
    par_organization_id1           IN     system_users.organization_id%TYPE,
    par_batch_no1               IN     ds_invoice_headers.batch_no%TYPE,
    par_invoice_date IN ds_invoice_headers.creation_date%type,
    par_user_code          IN     system_users.user_code%TYPE,
    par_err_msg               OUT     VARCHAR2) IS
    replist SRW_PARAMLIST;
    repindent SRW.job_ident;
    repstatus SRW.STATUS_RECORD;
    par_customer_code_from ds_invoice_headers.customer_code%type;
    par_organization_id number;
    par_batch_no number;
    CURSOR GET_CUST_CODE IS
    SELECT DISTINCT dih.CUSTOMER_CODE,dih.batch_no,NO_OF_INVOICE_COPIES
    FROM DS_INVOICE_HEADERS DIH, DS_CUSTOMER_SITES DCS
    WHERE dih.ORGANIZATION_ID = par_organization_id1
    AND TRANSACTION_TYPE = 'IN'
    AND TRUNC(dih.CREATION_DATE) = par_invoice_date --'16-SEP-04' --TO_DATE(:DUAL.INVOICE_DATE)
    and DIH.ORGANIZATION_ID = dcs.ORGANIZATION_ID
    AND DIH.CUSTOMER_CODE= DCS.CUSTOMER_CODE
    AND dih.CUSTOMER_SITE_CODE = DCS.CUSTOMER_SITE_CODE
    AND NO_OF_INVOICE_COPIES > 0;
    BEGIN
    dbms_output.put_line('before');
         FOR CURR_REC IN GET_CUST_CODE
         LOOP
         --v_user_params :=  ' par_organization_id1 ='||:GLOBAL.organization_id
         --                    || ' par_customer_code_from ='||CURR_REC.customer_code
         --                    || ' par_batch_no = '||CURR_REC.batch_no;
         dbms_output.put_line('inside loop -'||curr_rec.customer_code);
    replist := SRW_PARAMLIST(SRW_PARAMETER('',''));
         srw.start_debugging;
         SRW.ADD_PARAMETER(replist,'GATEWAY','http://seikoapps.seiko.com.au:7777/reports/rwservlet');
         SRW.ADD_PARAMETER(replist,'REPORT','/u02/app/dis/dev/reports/rdf/dsinvprt.rdf');
         SRW.ADD_PARAMETER(replist,'SERVER','repseikoapps2');
         SRW.ADD_PARAMETER(replist,'USERID','dis/[email protected]');
         SRW.ADD_PARAMETER(replist,'DESTYPE','FILE');
         --SRW.ADD_PARAMETER(replist,'DESNAME','itgenicom');
         dbms_output.put_line(' before desformat ');
         --SRW.ADD_PARAMETER(replist,'DESFORMAT'.'lst');
         SRW.ADD_PARAMETER(replist,'DESTINATION','/u02/app/dis/dev/reports/rep/dsinvprt.pdf');
         SRW.ADD_PARAMETER(replist,'BLANKPAGES','no');
         SRW.ADD_PARAMETER(replist,'COPIES',CURR_REC.NO_OF_INVOICE_COPIES);
         --SRW.ADD_PARAMTER(mplist,DESTINATION,
         dbms_output.put_line(' before MODE');
         SRW.ADD_PARAMETER(replist,'MODE','Bitmap');
         SRW.ADD_PARAMETER(replist,'ORIENTATION','Landscape');
         SRW.ADD_PARAMETER(replist,'PARAMFORM','no');
         dbms_output.put_line(' user defined variable ');
         SRW.ADD_PARAMETER(replist,par_organization_id,par_organization_id1);
         SRW.ADD_PARAMETER(replist,par_customer_code_from,CURR_REC.customer_code);
         SRW.ADD_PARAMETER(replist,par_batch_no,CURR_REC.batch_no);
         dbms_output.put_line(' before runrepoert ');
         repindent := srw.run_report(replist);
         repstatus := SRW.REPORT_STATUS(repindent);     
         dbms_output.put_line(' status of the report - '||repstatus.statuscode);
         --srw.stop_debugging;
         END LOOP;
    END p_submit_copy_invoices;
    I have turned the dubugging on :-
    * WELCOME TO EVENT-BASED-REPORTING API *
    * API-Version : 9i *
    * (C) Oracle Corporation, 2000 - 2002 *
    * Debugging turned ON **************************
    *** Length of Paramlist : 1
    OK : Parameter added : GATEWAY=http://seikoapps.seiko.com.au:7777/reports/rwservlet
    *** Length of Paramlist : 2
    OK : Parameter added : REPORT=/u02/app/dis/dev/reports/rdf/dsinvprt.rdf
    *** Length of Paramlist : 3
    OK : Parameter added : SERVER=repseikoapps2
    *** Length of Paramlist : 4
    OK : Parameter added : USERID=dis/[email protected]
    *** Length of Paramlist : 5
    OK : Parameter added : DESTYPE=FILE
    before desformat
    *** Length of Paramlist : 6
    OK : Parameter added : DESTINATION=/u02/app/dis/dev/reports/rep/dsinvprt.pdf
    *** Length of Paramlist : 7
    OK : Parameter added : BLANKPAGES=no
    *** Length of Paramlist : 8
    OK : Parameter added : COPIES=1
    before MODE
    *** Length of Paramlist : 9
    OK : Parameter added : MODE=Bitmap
    *** Length of Paramlist : 10
    OK : Parameter added : ORIENTATION=Landscape
    *** Length of Paramlist : 11
    OK : Parameter added : PARAMFORM=no
    user defined variable
    *** Length of Paramlist : 12
    OK : Parameter added : =129
    *** Length of Paramlist : 13
    OK : Parameter added : =250000D
    *** Length of Paramlist : 14
    OK : Parameter added : =100104
    before runrepoert
    Starting run_report: building url
    *** Building URL (RUN_REPORT)
    OK : URL built : http://seikoapps.seiko.com.au:7777/reports/rwservlet?REPORT=%2Fu02%2Fapp%2Fdis%2Fdev%2Freports%2Frdf%2Fdsinvprt%2Erdf&SERVER=repseikoapps2&USERID=dis%2Fseikodis%40dis%2Eseiko%2Ecom%2Eau&DESTYPE=FILE&DESTINATION=%2Fu02%2Fapp%2Fdis%2Fdev%2
    *** Submitting HTTP Request
    *** using URL :http://seikoapps.seiko.com.au:7777/reports/rwservlet?REPORT=%2Fu02%2Fapp%2Fdis%2Fdev%2Freports%2Frdf%2Fdsinvprt%2Erdf&SERVER=repseikoapps2&USERID=dis%2Fseikodis%40dis%2Eseiko%2Ecom%2Eau&DESTYPE=FILE&DESTINATION=%2Fu02%2Fapp%2Fdis%2Fdev%2Fr
    OK : Request submitted - Return stream : <?xml version = '1.0' encoding = 'ISO-8859-1' standalone = 'yes'?>
    <serverQueues>
    <job id="842" queueType="past">
    <name>/u02/app/dis/dev/reports/rdf/dsinvprt.rdf</name>
    <type>report</type>
    <st
    OK : Request submitted - Length of stream : 678
    *** XML-Parsed - Following Structure discovered :
    *** Checking elements!
    serverQueues ()
    *** Checking attributes!
    job ()
    *** Checking attributes!
    __id = 842
    __queueType = past
    name (/u02/app/dis/dev/reports/rdf/dsinvprt.rdf)
    *** Checking attributes!
    type (report)
    *** Checking attributes!
    status (Finished successfully)
    *** Checking attributes!
    __code = 4
    owner (RWUser)
    *** Checking attributes!
    server (repseikoapps2)
    *** Checking attributes!
    destination ()
    *** Checking attributes!
    desType (FILE)
    *** Checking attributes!
    desFormat (unknown)
    *** Checking attributes!
    file (71106787.eps)
    *** Checking attributes!
    timingInfo ()
    *** Checking attributes!
    queued (1/10/2004 15:02:18)
    *** Checking attributes!
    started (1/10/2004 15:02:18)
    *** Checking attributes!
    finished (1/10/2004 15:02:18)
    *** Checking attributes!
    *** Finished Parsing XML
    Getting value for element: job
    *** Requesting value for Attribute job.id [842]
    Getting value for element: server
    *** Requesting value for TAG server [repseikoapps2]
    Getting value for element: job
    *** Requesting value for Attribute job.type []
    Getting value for element: job
    *** Requesting value for Attribute job.queueType [past]
    Getting value for element: name
    *** Requesting value for TAG name [u02/app/dis/dev/reports/rdf/dsinvprt.rdf]
    Getting value for element: status
    *** Requesting value for Attribute status.code [4]
    Getting value for element: status
    *** Requesting value for TAG status [Finished successfully]
    Getting value for element: owner
    *** Requesting value for TAG owner [RWUser]
    Getting value for element: desType
    *** Requesting value for TAG desType [FILE]
    Getting value for element: desName
    *** Requesting value for TAG file [71106787.eps]
    Getting value for element: queued
    *** Requesting value for TAG queued [1/10/2004 15:02:18]
    Getting value for element: started
    *** Requesting value for TAG started [1/10/2004 15:02:18]
    Getting value for element: finished
    *** Requesting value for TAG finished [1/10/2004 15:02:18]
    Getting value for element: parentJob
    *** RUN REPORT BY URL - Processing finished
    JobID : 842
    StatusCode : 4
    StatusText : Finished successfully
    ================================================
    TimeStamp : 10/01/04 02:22 PM
    ================================================
    *** Length of Paramlist : 1
    OK : Parameter added : GATEWAY=http://seikoapps.seiko.com.au:7777/reports/rwservlet
    *** Length of Paramlist : 2
    OK : Parameter added : SERVER=repseikoapps2
    *** Length of Paramlist : 3
    OK : Parameter added : JOBID=842
    *** Length of Paramlist : 4
    OK : Parameter added : AUTHID=
    *** Building URL (showjobid)
    Added jobid to URL
    Added Server to URL
    Added statusformat to URL
    OK : URL built : http://seikoapps.seiko.com.au:7777/reports/rwservlet/showjobid842?Server=repseikoapps2&statusformat=xml
    *** Submitting HTTP Request
    *** using URL :http://seikoapps.seiko.com.au:7777/reports/rwservlet/showjobid842?Server=repseikoapps2&statusformat=xml
    OK : Request submitted - Return stream : <?xml version = '1.0' encoding = 'ISO-8859-1' standalone = 'yes'?>
    <serverQueues>
    <job id="842" queueType="past">
    <name>/u02/app/dis/dev/reports/rdf/dsinvprt.rdf</name>
    <type>report</type>
    <st
    OK : Request submitted - Length of stream : 678
    *** XML-Parsed - Following Structure discovered :
    *** Checking elements!
    serverQueues ()
    *** Checking attributes!
    job ()
    *** Checking attributes!
    __id = 842
    __queueType = past
    name (/u02/app/dis/dev/reports/rdf/dsinvprt.rdf)
    *** Checking attributes!
    type (report)
    *** Checking attributes!
    status (Finished successfully)
    *** Checking attributes!
    __code = 4
    owner (RWUser)
    *** Checking attributes!
    server (repseikoapps2)
    *** Checking attributes!
    destination ()
    *** Checking attributes!
    desType (FILE)
    *** Checking attributes!
    desFormat (unknown)
    *** Checking attributes!
    file (71106787.eps)
    *** Checking attributes!
    timingInfo ()
    *** Checking attributes!
    queued (1/10/2004 15:02:18)
    *** Checking attributes!
    started (1/10/2004 15:02:18)
    *** Checking attributes!
    finished (1/10/2004 15:02:18)
    *** Checking attributes!
    Getting value for element: job
    *** Requesting value for Attribute job.id [842]
    Getting value for element: server
    *** Requesting value for TAG server [repseikoapps2]
    Getting value for element: job
    *** Requesting value for Attribute job.type []
    Getting value for element: job
    *** Requesting value for Attribute job.queueType [past]
    Getting value for element: name
    *** Requesting value for TAG name [u02/app/dis/dev/reports/rdf/dsinvprt.rdf]
    Getting value for element: status
    *** Requesting value for Attribute status.code [4]
    Getting value for element: status
    *** Requesting value for TAG status [Finished successfully]
    Getting value for element: owner
    *** Requesting value for TAG owner [RWUser]
    Getting value for element: desType
    *** Requesting value for TAG desType [FILE]
    Getting value for element: desName
    *** Requesting value for TAG file [71106787.eps]
    Getting value for element: queued
    *** Requesting value for TAG queued [1/10/2004 15:02:18]
    Getting value for element: started
    *** Requesting value for TAG started [1/10/2004 15:02:18]
    Getting value for element: finished
    *** Requesting value for TAG finished [1/10/2004 15:02:18]
    Getting value for element: parentJob
    *** JOB STATUS - Processing finished
    JobID : 842
    StatusCode : 4
    StatusText : Finished successfully
    =============================================
    TimeStamp : 10/01/04 02:22 PM
    =============================================
    Can any one help me why the file is not created.
    Thanks
    Bain

    The file is created, but as an eps file (post script printer file). That is because you have not specified a desformat (e.g. PDF).

  • Execute report from database procedure

    I want to know if some way exists of sending to execute a. rdf (that in turn generates a pdf) from a procedure stored in the database. This because I want it to execute (the procedure) from a job of the database. thank you, ahead of time."

    hello,
    this functionality will be provided in oracle9i reports (as part of 9iAS release 2). in 6i you can submit an HTTP-request using the databse-package UTIL_HTTP.
    regards,
    the oracle reports team

  • Invoke Java from Insert trigger in Oracle 9i

    Hi,
    I want to invoke a java app with trigger once a row is inserted into orcle table. I've a trigger on insert but insert statement does not insert data to table until commit is executed.
    Trigger is not allowed on commit. How can I solve this problem?
    Thanks.

    navi01 wrote:
    I've found the solution at Oracle forum. I need tthe following and it works.
    trigger --> submit job
    commit --> job will run --> job calls java
    Job starts running or job completes? Because the second is going to make that table useless for anything but a jobs table and if you have a jobs table you might as well have a jobs server.

  • Email to hotmail or yahoo from Database trigger

    Hi all.
    I m working on Oracle Developer 6i with Oracle 9i.
    OS is Windows XP. My Oracle database is on Samba Server.
    I m using Exchange Server as my mail server.
    I want to send emails to hotmail, yahoor or any other mail server from my company.
    I have already create a database procedure to send mails within my company.
    I m using following procedure.
    PROCEDURE send_mail(p_to IN VARCHAR2,
    p_subject IN VARCHAR2,
    p_body IN VARCHAR2,
    p_from IN VARCHAR2)
    IS
    con utl_smtp.connection;
    l_log_err varchar2(4000);
    PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) is
    BEGIN
    utl_smtp.write_data(con,name||': '||header||chr(13)||chr(10));
    END;
    BEGIN
    con := utl_smtp.open_connection(hd_parameter.setting('MAILSVR'));
    utl_smtp.helo(con,hd_parameter.setting('DOMAIN'));
    utl_smtp.mail(con, p_from);
    utl_smtp.rcpt(con, p_to);
    utl_smtp.open_data(con);
    send_header('From', 'Help Desk System');
    send_header('To', p_to);
    send_header('Subject', p_subject);
    utl_smtp.write_data(con,chr(13)||chr(10)||p_body);
    utl_smtp.close_data(con);
    utl_smtp.quit(con);
    EXCEPTION
    WHEN utl_smtp.transient_error or utl_smtp.permanent_error THEN
    BEGIN
    utl_smtp.quit(con);
    EXCEPTION
    WHEN utl_smtp.transient_error or utl_smtp.permanent_error THEN
    Null;
    END;
    /* Create the error log file if send mail fails
    Added: June 03, 2004 by Hassan Raza*/
    l_log_err := sqlerrm;
    insert into mail_log_error
    values(sysdate, 'Failed to send mail due to the following error:'||l_log_err);
    END;
    Best Regards
    Hassan

    Hi Justin
    I got the following error
    Failed to send mail due to the following error:ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay for [email protected]
    Failed to send mail due to the following error:ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay for [email protected]
    Can you help me what should i do in this case?
    Best Regards
    Hassan Raza

Maybe you are looking for