How do I send a email notification with PL/SQL to Check for Columns

I want to be able to use PL/SQL to check my columns and makes sure that all required columns were populated, and if any were not populated to send an email notification.
Thanks
Hank

I would still suggest that adding appropriate constraints (well, logical constraints) to the table is the right way to go.
When you get the file back, you load the data into the table. If the constraint is satisfied, the data is loaded. If the constraint is violated, the loader gets an error, writes the affected data to another table, to another file, etc. That way, the data in the database is always correct and you have a log of the rows that were bad.
create table t( status varchar2(10), cost number );
create or replace trigger trg_t
before insert or update
on t
for each row
begin
   if :new.status = 'Approved' and :new.cost is null
   then
     raise_application_error( -20001, 'Cost must not be null if status is approved' );
   end if;
end;
SCOTT @ hp92 Local> insert into t values( 'Reject', 1 );
1 row created.
SCOTT @ hp92 Local> insert into t values( 'reject', null );
1 row created.
SCOTT @ hp92 Local> insert into t values( 'Approved', 2 );
1 row created.
SCOTT @ hp92 Local> insert into t values( 'Approved', null );
insert into t values( 'Approved', null )
ERROR at line 1:
ORA-20001: Cost must not be null if status is approved
ORA-06512: at "SCOTT.TRG_T", line 4
ORA-04088: error during execution of trigger 'SCOTT.TRG_T'If you don't want to touch the loader, you can rename the table, create a view with the same name, and use an INSTEAD OF trigger on the view to populate the real table or a reject table.
Either way, you're better off, in general, rejecting invalid records than trying to expend a lot of effort reporting on them.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • Send custom email notification with taskID to task owners

    Hi there,
    For a BPM process we're switching the UI partly from WDJ to SAPUI5.
    I've got a question about that:
    Right now, task owners are notified by the standard e-mail:
    Dear Potential Owners,
    You have new task(s) in your work item inbox. To view this task, click any of the following links.
    Direct access to this task:
    <http://sap.example.com:50000/example.com~approverequest/index.html?taskId=655fba65239311e48ef70000254e17a2>,
    Your complete work item list:
    <http://sap.example.com:50000/NavigationTarget=ROLES:portal_content/every_user/...>
    This mail is generated automatically. Do not reply.
    In case of technical issues, contact your IT department directly
    As we want to make the new UI also available from the internet (e.g. mobile phones), we want to use a reverse proxy for that.
    So in fact the address will no more be http://sap.example.com:50000, but http://approval.example.com.
    Can I send out custom notifications including the task ID?
    Thanks in advance!
    Best regards,
    Thorsten.

    Hi Thorsten,
    I'm not 100% sure if this will work for you or not, but you can change the URL's via Java system properties, see the below screenshot. If you set custom calculated values here they will appear in the default messages that are sent out.
    Being Java system properties these apply across the entire system though so if you only want a subset of tasks to have the external facing URL this wont work, this also assumes the external facing url will work internally too.
    Chris

  • How do I change the email associated with my facetime account. For some reason I was notified that the email was switched to an older email that I had and I need to change it back.

    How do I change the email address associated with FaceTime.  I received a notification that it was being changed to an old email address. I want to change it back to my current email.

    Hi there,
    You may find the information in the article below helpful.
    FaceTime for Mac 1.x: Sign in to FaceTime
    http://support.apple.com/kb/PH5645
    -Griff W.

  • Sending an email notification when an IDOC get failed

    Hi Experts,
    Can anybody tell how i can send an email notification when my Idoc fails.
    Regards,
    Ratheesh

    report zalv10.
    type-pools: slis.
    data: g_repid like sy-repid,
    gs_print type slis_print_alv,
    gt_list_top_of_page type slis_t_listheader,
    gt_events type slis_t_event,
    gt_sort type slis_t_sortinfo_alv,
    gs_layout type slis_layout_alv,
    gt_fieldcat type slis_t_fieldcat_alv,
    fieldcat_ln like line of gt_fieldcat,
    col_pos type i.
    data: begin of itab,
    field1(5) type c,
    field2(5) type c,
    field3(5) type p decimals 2,
    end of itab.
    data: begin of itab1 occurs 0.
    include structure itab.
    data: end of itab1.
    data: begin of itab_fieldcat occurs 0.
    include structure itab.
    data: end of itab_fieldcat.
    Print Parameters
    parameters:
    p_print as checkbox default ' ', "PRINT IMMEDIATE
    p_nosinf as checkbox default 'X', "NO SELECTION INFO
    p_nocove as checkbox default ' ', "NO COVER PAGE
    p_nonewp as checkbox default ' ', "NO NEW PAGE
    p_nolinf as checkbox default 'X', "NO PRINT LIST INFO
    p_reserv type i. "NO OF FOOTER LINE
    initialization.
    g_repid = sy-repid.
    perform print_build using gs_print. "Print PARAMETERS
    start-of-selection.
    TEST DATA
    move 'TEST1' to itab1-field1.
    move 'TEST1' to itab1-field2.
    move '10.00' to itab1-field3.
    append itab1.
    move 'TEST2' to itab1-field1.
    move 'TEST2' to itab1-field2.
    move '20.00' to itab1-field3.
    append itab1.
    do 50 times.
    append itab1.
    enddo.
    end-of-selection.
    perform build.
    perform eventtab_build changing gt_events.
    perform comment_build changing gt_list_top_of_page.
    perform call_alv.
    form build.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    data: fieldcat_in type slis_fieldcat_alv.
    clear fieldcat_in.
    fieldcat_ln-fieldname = 'FIELD1'.
    fieldcat_ln-tabname = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    fieldcat_ln-key = ' '. "SUBTOTAL KEY
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-seltext_l = 'HEAD1'.
    append fieldcat_ln to gt_fieldcat.
    clear fieldcat_in.
    fieldcat_ln-fieldname = 'FIELD2'.
    fieldcat_ln-tabname = 'ITAB1'.
    fieldcat_ln-no_out = 'X'.
    fieldcat_ln-seltext_l = 'HEAD2'.
    append fieldcat_ln to gt_fieldcat.
    clear fieldcat_in.
    fieldcat_ln-fieldname = 'FIELD3'.
    fieldcat_ln-tabname = 'ITAB1'.
    fieldcat_ln-ref_fieldname = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    fieldcat_ln-ref_tabname = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-do_sum = 'X'. "SUM UPON DISPLAY
    append fieldcat_ln to gt_fieldcat.
    DATA SORTING AND SUBTOTAL
    data: gs_sort type slis_sortinfo_alv.
    clear gs_sort.
    gs_sort-fieldname = 'FIELD1'.
    gs_sort-spos = 1.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT****
    append gs_sort to gt_sort.
    clear gs_sort.
    gs_sort-fieldname = 'FIELD2'.
    gs_sort-spos = 2.
    gs_sort-up = 'X'.
    *GS_SORT-SUBTOT = 'X'. **THIS SHOULD NOT BE UNCOMENTED*
    append gs_sort to gt_sort.
    endform.
    form call_alv.
    ABAP List Viewer
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    i_callback_program = g_repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    i_structure_name = 'ITAB1'
    is_layout = gs_layout
    it_fieldcat = gt_fieldcat[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    it_sort = gt_sort[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    it_events = gt_events[]
    IT_EVENT_EXIT =
    is_print = gs_print
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    tables
    t_outtab = itab1
    exceptions
    program_error = 1
    others = 2.
    endform.
    HEADER FORM
    form eventtab_build changing lt_events type slis_t_event.
    constants:
    gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
    data: ls_event type slis_alv_event.
    call function 'REUSE_ALV_EVENTS_GET'
    exporting
    i_list_type = 0
    importing
    et_events = lt_events.
    read table lt_events with key name = slis_ev_top_of_page
    into ls_event.
    if sy-subrc = 0.
    move gc_formname_top_of_page to ls_event-form.
    append ls_event to lt_events.
    endif.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
    INTO LS_EVENT.
    IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
    APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    endform.
    form comment_build changing gt_top_of_page type slis_t_listheader.
    data: gs_line type slis_listheader.
    clear gs_line.
    gs_line-typ = 'H'.
    gs_line-info = 'HEADER 1'.
    append gs_line to gt_top_of_page.
    clear gs_line.
    gs_line-typ = 'S'.
    gs_line-key = 'STATUS 1'.
    gs_line-info = 'INFO 1'.
    append gs_line to gt_top_of_page.
    gs_line-key = 'STATUS 2'.
    gs_line-info = 'INFO 2'.
    append gs_line to gt_top_of_page.
    CLEAR GS_LINE.
    GS_LINE-TYP = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO GT_TOP_OF_PAGE.
    endform.
    form top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = gt_list_top_of_page.
    write: sy-datum, 'Page No', sy-pagno left-justified.
    endform.
    form end_of_page.
    write at (sy-linsz) sy-pagno centered.
    endform.
    PRINT SETTINGS
    form print_build using ls_print type slis_print_alv.
    ls_print-print = p_print. "PRINT IMMEDIATE
    ls_print-no_print_selinfos = p_nosinf. "NO SELECTION INFO
    ls_print-no_coverpage = p_nocove. "NO COVER PAGE
    ls_print-no_new_page = p_nonewp.
    ls_print-no_print_listinfos = p_nolinf. "NO PRINT LIST INFO
    ls_print-reserve_lines = p_reserv.
    endform.deepakb
    Posts: 3
    Joined: Mon Nov 17, 2003 8:18 am
    Location: Mumbai

  • Anyone know how to send automatic email notification in OA?

    Any where I can find a resource about how to send automatic email notification?
    say, samples, reference?
    please advice, thank you very much

    integrate your application with oracle workflow and send a notification from the mailer.
    details of working with workflow is there in the dev guide
    Thanks
    Tapash

  • How to send html email notification in bpel

    hi gurus,
    i want to send html email notification from bpel.
    before, i already successful send html email with attachment, but when i send an email without attachment, then the body message will turn into a plain text.
    as i check from the email accepted, email with attachment will have a mime type "text/html" but if no attachment then it will be "text/plain"
    from the bpel configuration, by default the mime type already set to "text/html; charset=UTF-8", below is the sample configuration in my bpel process
    [quote]
    <copy>
                                    <from>string('text/html; charset=UTF-8')</from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content/ns10:MimeType</query>
                                    </to>
                                </copy>
    [/quote]
    i think this suppose to be a easy configuration, but i'm not sure whether i miss something in configuration the email process or this is a bugs in bpel.
    environment:
    linux
    jdev 11.1.1.6
    do u guys ever facing a same problem or have a solution to this ? please throw some light.
    thanks
    ===
    update, i found a temporary solutions.
    so i add a attachment from the process design, and then i change it from the source.
    [quote]
    <copy>
                                    <from>
                                        <literal>
                                            <Content xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">multipart/alternative</MimeType>
                                                <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                    <MultiPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                        <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                                                            <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
                                                            <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
                                                            <BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
                                                        </BodyPart>                                            
                                                    </MultiPart>
                                                </ContentBody>
                                            </Content>
                                        </literal>
                                    </from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content</query>
                                    </to>
                                </copy>
    <copy>
                                    <from>string('text/html; charset=UTF-8')</from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content/ns10:ContentBody/ns10:MultiPart/ns10:BodyPart[1]/ns10:MimeType</query>
                                    </to>
                                </copy>
                                <copy>
                                    <from>string('your message')</from>
                                    <to variable="varNotificationReq"
                                        part="EmailPayload">
                                        <query>ns10:Content/ns10:ContentBody/ns10:MultiPart/ns10:BodyPart[1]/ns10:ContentBody</query>
                                    </to>
                                </copy>
    [/quote]
    make sure you put the mime type multipart/alternative into the email payload content. by default, when you add attachment, it will generate mime type multipart mixed automatically.
    if you don't change it to multipart/alternative, your email will show a attachment, but actually your email doesn't contain any attachment.
    and then for the message and mimetype make sure you have that ns10:bodypart, because this email already been set as a multipart email.
    when you add attachment, by default it will generate 2 body part, first one is for the body message and the second one is for the attachment. since i only want to use the body message only, then i have to erase the second bodypart
    with this workaround, i can send a html email without attachment perfectly.
    but i have to take note, when i updating the email process from process design, then the source will be generated again automatically, and the edited one will be replaced.
    thanks.

    Make sure you upload all of the images used in your email to a server you control. Then, change your image paths to point to those uploaded images with absolute links.
    You will get marked as spam if you attempt to send images as attachments to a large list of recipients and most email clients won't download images to begin with, so make sure your html email makes sense with broken pictures.
    CSS support is spotty across email clients, if you use css, make sure it's inline, not embedded in the <head> or externally linked in the <head>. Some email clients strip out the <head> section entirely.
    Basically, you need to design your html email as if you haven't moved out of the 90's yet, as far as web design is concerned, in order to get maximum cross client compatibility.
    Then, when you're ready, I would suggest using a service like www.icontact.com or www.constantcontact.com if your subscriber list is anywhere over 100 or so recipients.

  • How do I send an email with a "read receipt" please

    how do I send an email with a "read receipt" please

    banyard,
    There is no support for read receipts in Apple mail.
    Sorry,
    Captfred

  • How do I send an email with a group address and not show the addresses/names of the recipients?

    How do I send an email with a group address and not show the addresses/names of the recipients?

    Use BCC.   That's blind carbon copy.   And copy paste the address into the BCC field.  It really depends what e-mail program you use how to enable BCC.

  • JDev - how to send a email notification

    Hi,
    I am working with ADF Framework, JSP, and Toplink. How do I send an email on a specific date? The email address and the date to send the email will be in a DB column.
    I think that I should compare the date in the DB column with the System date, and when they're the same, the email will be sent.
    Would appreciate if someone could give me some insights. Thanks!
    Lin

    Hi Lin, you can use a ServletContextListener along with Timer and TimerTask in order to schedule a task, in this case a send mail task. Obviously you should use JavaMail API for mail sending.
    First of all, you should config the Servlet Listener in web.xml so it will run when your App Server starts.
    You may change some of this code to meet your requirements.
    web.xml
    <listener>
    <listener-class>ServletListenerTimer</listener-class>
    </listener>
    public class ServletListenerTimer implements ServletContextListener {
    private java.util.Timer timer = null;
    public void contextInitialized(ServletContextEvent event) {
    timer = new java.util.Timer(true);
    timer.schedule(new SendMail(event.getServletContext()), 0, 60 * 60 * 1000);
    public void contextDestroyed(ServletContextEvent event) {
    timer.cancel();
    public class SendMail extends TimerTask {
    private static final int C_SCHEDULE_HOUR = 18;
    private static boolean isRunning = false;
    private ServletContext context = null;
    public SendMail(ServletContext context) {
    this.context = context;
    public void run() {
    Calendar cal = Calendar.getInstance();
    if (!isRunning) {
    if (C_SCHEDULE_HOUR == cal.get(Calendar.HOUR_OF_DAY)) {
    isRunning = true;
    doMailTask(); // Send Mail task here...
    isRunning = false;
    } else {
    context.log("task still running...");
    Hope this helps.
    Regards,
    Luis R.

  • How can i send an email with subject more than 50 char.

    Hi
    Can you please explain How can i send an email with subject more than 50 char?? I am using Cl_BCS=>SET_MESSAGE_SUBJECT but it is throwing an error " An exception of the type CX_SY_REF_IS_INITIAL has occured which is not caught" .
    Regards
    Alok

    Try using the following FM
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = i_mail_data
            put_in_outbox              = c_x
          TABLES
            packing_list               = i_objpack[]
            object_header              = i_objhead[]
            contents_bin               = i_objbin[]
            contents_txt               = i_objtxt[]
            receivers                  = i_receivers[]
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
          OTHERS                     = 8.
    Regards
    Avinash
    Edited by: Avinash Jagtap on Dec 2, 2009 7:00 AM
    Edited by: Avinash Jagtap on Dec 2, 2009 7:02 AM

  • How do I send an email with hyperlinks active upon receipt?

    How do I send an email with hyperlinks active upon receipt? Currently the hyperlinks are only active once I open the attachment. I want them to arrive active just like they do in the emails I receive from Office Depot et al.

    mlaughbaum wrote:
    BTW, it is "showing". It's just that the links aren't active.
    Sometimes you need to look at it from the perspective of a recepient. Save the message before sending and close it. It will be in your Drafts Folder. Click once on it in the Drafts list so you can view is as the recepient would. (Don't open for edit) The links should be active.
    Jerry

  • How do I send an email with blind address recipients?

    How do I send an email with blind address recipients?

    When you open a New Message there's a little box with three lines next to the Subject Box. When you click it you get a drop down menu with a list of options. Click on Bcc Address Field. That will add a BCC box to your message.

  • When I send an email notification that the form has been sent I want the receiver to get a copy of the actual filled out form not a ling to the data, how can I make this happen?

    When I send an email notification that the form has been sent I want the receiver to get a copy of the actual filled out form not a ling to the data, how can I make this happen?

    Hi,
    you can find documentation for Designer under this website
    http://help.adobe.com/en_US/livecycle/10.0/documentation.html#task=4,5&module=2
    In Designer you can use the JavaScript API of Acrobat.
    So the Devnet for Acrobat is also a good source.
    http://www.adobe.com/devnet/acrobat.html
    http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf

  • How do I send my business logo with my new email

    Hi , can someone please explain how to attach my business email header with business logo to every email I send. It is a htm file and I can do it via PC but I don't know how to do it with my mail on the mac.
    Cheers chris

    Is this something you want to embed into the email header, or make as the top line in the message body? Or would it be okay to attach it as a signature at the bottom.
    I don't think you can stick it into the message header to be displayed as an X-face. I think there used to be a 3rd-party add-on that would do that for Panther, but it no longer works (or never worked) for Tiger.
    Not certain about htmls, and not quite certain that this is what you would want, but there is another post here in this forum, dated today, that asked about inserting hyperlinks into email messages.
    If you wanted to insert this as the first line in your message, you could convert the html to gif or jpg and drag the resulting file into the message. At least in Mac's Mail.app, those would expand automagically at the receiver. Don't know whether Windows in general or other Mail programs, regardless of platform, would do that expansion automagically, though.
    You could do a similar thing if you would be okay with a "business card" attached as a signature to the email. Just go through the motions like you are going to create a new signature, but rather than type anything in the signature text box, just drag your jpg or gif file into the text box instead.
    Or suppose that none of the above is exactly what you want. You say you could do this on a PC so do it again on a PC and send it to you and retrieve your mail on your Mac in Mail.app. Then keep that message, essentially, as a template, and just ⇧⌘D (Mail > Message > Send again). That basically pulls that message up in a new window, you can re-edit it, re-address it, and send it on its way while retaining the original template that you mailed to yourself indefinitely.

  • How to send alert email notification through graphical mapping ?

    Hi,
    I want to send an email notification whenever there is an exception raised while doing graphical mapping.
    However my requirements are as follows :
    1. We want to use email adpater sending emails
    2. We don't want to go for BPM approach, to achieve the above requirement
    3. We don't want to connect to any alert framewok.
    I appreciate your early reply.
    Thanks
    Ganesh

    Hey
    >>whenever there is an exception raised while doing graphical mapping.
    as said earlier this is not possible without configuring alerts.
    yeah,if u know the reasons beforehand that why exceptions can be be triggered in mapping,then u can use conditional receiver determination,for e.g suppose u know that you will get a mapping exception if value of tag <OrdersID>=000,then u can use this condition in conditional receiver determination and send a mail to concerned party,but this won't work if u don't know beforehand as to under what conditions the exception will be  triggered in mapping.
    i would vote for configuring alerts as its the most suited way to handle this
    thanx
    Aamir

Maybe you are looking for

  • Adobe form is going to Spool directly want a print preview

    HI Experts, I have created a class where I am calling a standard Material document print form WOST_WSGM_MATDOC_PDF but it is directly going to spool. NOTE : I am calling this class method in one of my POWL Feeder class which is linked with standard G

  • SRM-SUS for Service Entry Sheets - Classic Scenario

    Hi SRM Gurus, Our client wants to use SRM-SUS for the Service Entry Sheets (to being with and then later expand more in other SRM areas). The lead system will be R/3 system. We will be going with ECC 6.0 and SRM 5.0. Service Order will be created in

  • Memory monitor exception

    I am working on a mobile game using JSR-184 and WTK 2.2.0. When I try to run the program with the memory monitor enabled (on emulator) I always end up with the following exception: Exception in thread "Thread-5" java.lang.RuntimeException: Inconsiste

  • Schedular to call OrderService at configured intervals in OSB?

    HI All, I am new to OSB, I have requirement of calling the  exposed web service(Order service)  at configured intervals in OSB. Can you suggest best way. any related example  blog. Thanks in advance.

  • To draw a pic

    How can I draw something on a component by using MouseMotionListener? What paint method of my component has to do? Has it to redraw all the drawing operations that I have done? That is, must I save these operations for the paint method? Is somebody h