Oracle Alert and subquery

I am using sub query in oracle alert it is not working fine any person guide me

select distinct
employee_number,
full_name,
c.proposed_salary decode(substr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),instr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),'.')1,9),'Allowance',c.proposed_salary*25/100,'None%',0,0)+
decode(substr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),instr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),'.',1,2)+1,4),'Allo',c.proposed_salary*15/100,'None',0,0) +
decode(substr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),instr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),'.',1,4)+1,4),'None',0,200) as net
INTO
&EMPNO,
&EMPNAME,
&NET
from per_all_people_f a , Per_all_assignments_f b,PER_PAY_PROPOSALS_v c
where a.person_id = b.person_id
and b.assignment_id = c.assignment_id
AND c.element_name = 'Basic Salary'
and c.pay_proposal_id = (select max(pay_proposal_id) from PER_PAY_PROPOSALS_v where ASSIGNMENT_ID =b.assignment_id
and element_name = 'Basic Salary'
and approved = 'Y')
and
DECODE (b.assignment_type,
'E', hr_general.decode_lookup ('EMP_CAT', b.employment_category),
'C', hr_general.decode_lookup ('CWK_ASG_CATEGORY',
b.employment_category
)='Labor'
and TRUNC(sysdate) between a.effective_start_date and a.effective_end_date
AND TRUNC(sysdate) between b.effective_start_date and b.effective_end_date
and c.proposed_salary decode(substr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),instr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),'.')1,9),'Allowance',c.proposed_salary*25/100,'None%',0,0)+
decode(substr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),instr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),'.',1,2)+1,4),'Allo',c.proposed_salary*15/100,'None',0,0) +
decode(substr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),instr(HR_GENERAL.DECODE_PEOPLE_GROUP(b.people_group_id),'.',1,4)+1,4),'None',0,200) >= 3000

Similar Messages

  • Oracle Alert and sql query

    Hello, I am working on an oracle alert for PO's.
    goal- when a PO is not approved/rejected by the approver and is waiting on approver's queue for more than 3 business days, an email should be sent to the approver every day saying "PO waiting for +xx+ days".
    Working on R:12.1.1
    Here is the script I could write and get emails of all unattended PO's. I am not able to use the dates.
    Please help me out. Here is my script.
    SELECT distinct poh.segment1,
    TO_CHAR(SUM((pll.quantity - pll.quantity_cancelled) *
    pll.price_override),
    '$99999990.90'),
    he.full_name,
    NVL(fu1.email_address, '[email protected]') approver,
    NVL(he.email_address, '[email protected]') owner,
    pv.vendor_name,
    vd.name
    INTO &PO_NO,
    &PO_AMT,
    &CREATED_BY,
    &APPROVER_EMAIL,
    &CREATOR_EMAIL,
    &VENDOR,
    &DB_NAME
    from wf_item_activity_statuses wias,
    wf_notifications wfn,
    po_headers_all poh,
    po_line_locations_all pll,
    fnd_user fu1,
    fnd_user fu2,
    hr_employees he,
    ap_suppliers pv,
    v$database vd
    where wias.notification_id is not null
    and wias.notification_id = wfn.group_id
    AND poh.last_updated_by = fu2.user_id
    and wfn.recipient_role = fu1.user_name
    AND fu2.employee_id = he.employee_id
    AND pll.po_header_id = poh.po_header_id
    AND poh.vendor_id = pv.vendor_id
    AND poh.type_lookup_code IN ('STANDARD', 'PLANNED')
    and wfn.status = 'OPEN'
    and wias.item_type = 'POAPPRV'
    and wias.item_key = poh.wf_item_key
    and poh.org_id = 81
    AND poh.type_lookup_code IN ('STANDARD', 'PLANNED')
    and poh.authorization_status IN ('IN PROCESS', 'PRE-APPROVED')
    Thanks
    Raj
    Edited by: 936248 on Sep 20, 2012 7:15 AM

    Hi Sree,
    I tried this below script. This results in an error- APP-ALR-04106.
    Thanks for the help.
    SELECT distinct poh.segment1,
    TO_CHAR(SUM((pll.quantity - pll.quantity_cancelled) *
    pll.price_override),
    '$99999990.90'),
    he.full_name,
    NVL(fu1.email_address, '[email protected]') approver,
    NVL(he.email_address, '[email protected]') owner,
    pv.vendor_name,
    vd.name,
    count(gd.transaction_date)
    INTO &PO_NO,
    &PO_AMT,
    &CREATED_BY,
    &APPROVER_EMAIL,
    &CREATOR_EMAIL,
    &VENDOR,
    &DB_NAME,
    &datediff
    from wf_item_activity_statuses wias,
    wf_notifications wfn,
    po_headers_all poh,
    po_line_locations_all pll,
    fnd_user fu1,
    fnd_user fu2,
    hr_employees he,
    ap_suppliers pv,
    v$database vd,
    GL_TRANSACTION_DATES gd
    where wias.notification_id is not null
    and wias.notification_id = wfn.group_id
    AND poh.last_updated_by = fu2.user_id
    and wfn.recipient_role = fu1.user_name
    AND fu2.employee_id = he.employee_id
    AND pll.po_header_id = poh.po_header_id
    AND poh.vendor_id = pv.vendor_id
    AND poh.type_lookup_code IN ('STANDARD', 'PLANNED')
    and wfn.status = 'OPEN'
    and wias.item_type = 'POAPPRV'
    and wias.item_key = poh.wf_item_key
    and poh.org_id = 81
    AND poh.type_lookup_code IN ('STANDARD', 'PLANNED')
    and poh.authorization_status IN ('IN PROCESS', 'PRE-APPROVED')
    and gd.business_day_flag='Y'
    and gd.transaction_date between (sysdate-3) and poh.submit_date
    GROUP BY poh.segment1

  • Oracle alerts and microsoft exchange server

    Hi,
    We are working on Oracle Applications 11i (fail over on 2 servers) which is installed on Solaris 64 bit .
    AND I am trying to configure Oracle Alerts with Microsoft Exchange Server.
    I am following the note: Oracle Applications And Microsoft Exchange Server-Interoperability Guide.
    At the step of configuring the exchange Server I need to know the account used to run the Concurrent Manager service.
    How can i check that?
    Thanks.

    Hi,
    At the step of configuring the exchange Server I need to know the account used to run the Concurrent Manager service.
    How can i check that?Most probably it is applmgr user.
    To verify, issue "cd $COMMON_TOP/admin/scripts/<CONTEXT_NAME>", then "ls -l adcmctl.sh". This should should the OS owner of the script (the OS user which is used to start the CM). Or, you could check the value of the "s_appsuser" context variable in the application context file to determine the user.
    Regards,
    Hussein

  • Oracle Alerts and Notification

    Dear Hussein,
    I have configured Workflow in R12, but neither the alerts nor the notifications are working ...
    Please guide
    REgds
    Bilal

    Bilal,
    Can you find any errors in the log files?
    Please refer to the following document ("Diagnostics and Logging" section) for data gathering and troubleshooting.
    Note: 741769.1 - Oracle Workflow Release Notes, Release 12.0.6
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=741769.1
    Regards,
    Hussein

  • Sending Email by Oracle Alert when no rows returned

    Hello All,
    I am having one problem.
    In the Oracle Alert i wrote one query which is returing 0 rows.
    But sometimes it will returns some rows.
    And my requirement is that when this query doesn't return any rows , i want to send one email to user that there is no data
    and if the data is present then i have to send the data.
    But currently there is no data so i made one Oracle Alert and when i am running that Alert then it is showing me a one message and mail doesn't sent
    Oracle Alert did not perform the summary action "My Test Alert" because no exceptions were returned for this action set.
    Please Suggest
    Thanks & Regards

    Write a second alert that fires near about the same time.
    select 'send email'
    from dual
    where 0 = (select count(1) from your_table)
    This alert will send a "no rows found" email.
    Hope this helps,
    Sandeep Gandhi

  • Oracle Alert Configuration in 11i

    Hi Hussein:
    I am trying to configure oracle alerts for my application ( Test ) following article
    How To Check Oracle Alert Setup? [ID 577392.1]
    But when I run the query in the third step , I am not getting the two rows that is expected.
    3) Login into SQL*Plus as the 'APPS' user and run the following SQL.
    select object_name, status from user_objects
    where object_type = 'TRIGGER'
    and object_name like 'ALR_FND_PROFILE_OPTIONS%';
    Do I have to run any scripts to get this triggers created? I am kind of last.
    I went through the whole document and changed a user profile so I can check if the alerts is working. Nothing came out , Not an email or even a printout.
    Regards,
    Bala

    Hi Bala,
    Please run the test in (Note: 271367.1 - Oracle Alert Alert Check Setup Test) and see if it returns any error/warning messages.
    If you are on 11i and you have RUP4 patch installed (or above), then you need to consider having Workflow configured.
    Please see these documents/threads for details.
    Note: 422782.1 - Changes Introduced in Alerts Post RUP4 and its Impact
    Note: 428193.1 - How to determine what email system is being utilized for Oracle Alert processing?
    Oracle Alert and WF mailer
    Oracle Alert and WF mailer
    Regards,
    Hussein

  • Oracle alert not working in 11i but working on R12 on same server

    Hi Friends,
    I have an R12(R12.1.1) Instance and I configured Oracle Alert with the following details
    Mail systems : Windows NT Mail
    Mail Database/Server Name: server1
    Send Mail Account/password : wf/wf
    Response Mail Account/password: wf/wf
    Enable Response Processing:no
    Workflow mailer is working and I tested a sample Oracle Alert and it works fine.I received mail also.
    I also have a 11i (11.5.10.2) instance on the same server and i configured the alert options exactly as i did for R12 and the workflow mailer is also running but the alert is throwing error:
    APP-ALR-04124: Oracle Alert was unable to deliver your message
    To <mail id>
    Apps Version : 11.5.10.2(Default Installation,No patches applied)
    Server OS : Red Hat Linux ES 4.4
    Mail server : Exchange 5.5 on windows
    Both the instances are on the same server.
    what is the change needs to be done on 11i compared with R12(R12.1.1)which is working fine.
    Please let me know.
    Regards,
    DB

    Pl run the 11i Diagnostics Test outlined in MOS Doc 271367.1 (11i : Oracle Alert Alert Check Setup Test)
    HTH
    Srini

  • Oracle Alert: Access before and after update values of a table column

    We have a requirement where a notification needs to be sent when 'END_DATE' attribute (column in a table X) is set, in an Oracle Applications form.
    I have defined an Event based Oracle Alert which fires 'On Update' of the table X.
    Could anyone please let me know as how to access the value of 'END_DATE' before and after update (i.e :new.END_DATE and :old.END_DATE) in the sql query of the alert.
    The need to use the before update and after update values of the attribute 'END_DATE' is that if we add the condition END_DATE is not null, the alert is sent even if any other attrbutes are updated in the Oracle form which is not the intended behavior.
    Appreciate any help.
    Thanks

    Hi
    use selectionlistener for your first table then add clientlistener and serverlistener so that you will get the rows on click in back bean.
    then get second table vo and and create and add row for that view object. add partial target to refresh your second table from back bean.
    on click of save call commit operation.

  • How to configure oracle alerts to use Workflow mailer?

    Hello Guys:
    We were trying to setup oracle alerts using workflow mailer. I have created a dedicated mailer for handling oracle alerts related mail.
    Here is what I need to clarify:
    1. Having setup a new mailer for Oracle alert do I have to still configure the Options in Oracle Alerts. This is where you choose which type of mail u want to use ( like Unix mail,Windows NT mail )
    2.How do I tell oracle alert to use the new mailer that I created exclusively for this? While creating the mailer at some point I remember putting ALR in configuration form.
    I am on 11.5.10 CU2. I am on 11i.ATG_PF.H
    Regards,
    Bala

    Hi Hussain:
    Based on the note I realised that my oracle alerts will user unix sendmail. But then If u go to " Oracle Alert Options "
    -- > Mail systems -- I check Unix send mail
    -- > Mail server options ( Do I have to fill this section? )
    My guess is that the send mail will post the email to a IMAP account ( I created oraclealert account ) and IMAP account will push the alert email to Recipient
    Mail Database/Server Name --- imap.mydomain.com
    Mail Priority --- Normal
    Accounts
    Application Installation username Password
    Blank ** Blank ** oraclealert pwd
    Blank ** Blank ** oraclealert pwd
    ** - It wont allow me to choose an application.
    Is there a simple test to make sure that my oracle alert is working or not? I appreciate your help.
    Regards,
    Bala

  • Run a PL/SQL statement in an Oracle Alert action?

    Hello
    did anyone know is it possible to run a PL/SQL statement in an Oracle Alert action?
    I can run an SQL like “UPDATE Table SET alert_run = 'ok' where id = 10;” but if I run instead of this the following
    “Select XXKN_TEST.UPDATE_XXX_TEST('&USER_NAME') From dual;”
    I get the following error log:
    Alert: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    ALECDC module: Check Periodic Alert
    PL/SQL procedure successfully completed.
    XXKN_TEST.UPDATE_XXX_TEST('GROSS2')
    ERROR at line 2:
    ORA-00904: "XXKN_TEST"."UPDATE_XXX_TEST": invalid identifier
    APP-ALR-04020: Oracle Alert was unable to execute "&VALUE". Check that this file exists and that its read protection is set correctly.
    Many thanks for your help,
    Alois

    Hello Suresh,
    I tried your suggestion but it doesn't work.
    The PL/SQL procedure was successfully completed but no data was modified.
    Are you sure that running a PL/SQL is possible in an alert action?
    Kind Regards,
    Alois

  • Installing Oracle 8i and Developer 6.0 technet packages on NT

    I recently purchased the Oracle 8i (8.1.6) and Developer 6.0 "packages" from technet ($200/each). The Oracle 8i Enterprise Server software installed without any problems [ Oracle home = ora81 ]. However, when I tried to install the Developer package [ to oradev ], I got a message indicating that the install would replace my "ora81" registry settings with the "oradev" settings... which it did, thereby rendering my database "in-operable".
    After repeatedly removing and reinstalling the two packages, I was finally able to get both installed with an "operable" database. However, I keep getting a TNSNAMES error message when I try to connect to the database from Oracle Forms. Has anyone else encountered this scenario??? I am quite experienced in "using" Oracle tools and the database, but NOT when it comes to installing and configuring them...
    At this point, I believe that my problem lies with SQL*Net... any ideas???
    null

    U-da-Man!
    Thanks, Martin... your step-by-step process worked like a charm! Although, having used Oracle products for 7+ years, I am amazed that the Developer package had to be installed before the database. I wonder what will happen when I eventually install Developer 6i ??
    Anyway, thanks again for the info!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Martin Vonk ([email protected]):
    Hi Dave,
    Did not install Oracle 816 up to now. But still..
    Developer 6 has to be installed in DEFAULT_HOME...
    See the procedure below (source Oracle (modified)).
    Installation Procedure
    Follow this procedure to install Developer 6.0 and Oracle 8i on the same physical machine in separate ORACLE_HOMEs on NT:
    1) Install Developer 6.0 using the instructions on the Developer CD.
    Specify an appropriate drive and the ORANT directory as the destination. For example:
    D:\ORANT
    Note: You must install Developer in the Oracle home named DEFAULT_HOME.
    2) Install RDBMS 8.1.5 from the Oracle 8i CD. Specify the following information when prompted for the Oracle Home and Full path:
    Oracle Home ora8i
    Full Path d:\orant\ora8i
    Choose Typical Install
    Global Database Name ora8i.us.oracle.com (This is an example)
    SID ORA8I (This is an example)
    As the product installs, a summary is displayed that shows the products that are installed and the space requirements.
    When the installation is complete, the following information is displayed and the installer exits:
    Oracle Database Configuration Assistant Alert Database Creation Completed.
    Database Information
    Global Database Name ora8i.us.oracle.com
    SID ORA8I
    Sys password change_on_install
    System passwd manager
    3) A TNSNAMES entry needs to be created in the tnsnames.ora file for the new Oracle 8i installation. You can find the file in:
    d:\orant\net80\admin\tnsnames.ora
    A default entry will look like this:
    alias.world
    (DESCRIPTION
    (ADDRESS_LIST
    (ADDRESS
    (PROTOCOL = TCP)
    (Host = )
    (Port = )
    (CONNECT_DATA = (SID = )
    For example, if you installed on a machine with a HOSTNAME of TEST, a SID named ORA8I, on TCP/IP with port 1521, and an alias of NEW, you would create the following entry:
    NEW.world
    (DESCRIPTION
    (ADDRESS_LIST
    (ADDRESS
    (PROTOCOL = TCP)
    (Host = TEST)
    (Port = 1521)
    (CONNECT_DATA = (SID = ORA8I)
    4) If you manually created the entry, save and close the tnsnames.ora file.
    You can now connect to the local database instance of 8i using the DBSTRING as NEW. For example, you can connect as scott/tiger@NEW.
    <HR></BLOCKQUOTE>
    null

  • Out of the Box alerts and messages.  Necessary?

    Hi,
    I have installed Grid Control and I am monitoring a couple of Hosts and DB's and well, before I even did that I noticed that Grid had a whole bunch of Critical and warning alerts along with Policy Vioalations. Now I assume these are out of the box alerts and messages, cause some of them seems pretty dumb to me. I know we can change them to change the values but I just wanted to make sure if I should really worry about these or not? Are they really serious. Some of them don't make any sense to me and I have been trying to look online at places where I can find out what they mean exactly and how to correct them. Does anyone know how to. These messages are just annoying and I would like to log in to Grid and see no alerts or violations. Here are some examples of what I am talking about. Any advice or help is much appreciated :)
    Examples Alerts:
    -51.55% of all processes are in zombie state, crossed warning (35) or critical (50) thresho...
    -Number of Active Agents exceeded the critical threshold (1). Current value: 0
    **This one seems dumb to me since I only have one agent on the server and the threshold is set to 1!!!!
    -Metrics "Current Open Cursors Count" is at 1673
    -Target is in broken state...
    **This one I would really like to figure out what it means. It is listed under the errors tab.
    Example Policy Violations:
    -Critical Patch Advisories for Oracle Homes
    -Listener Direct Administration
    -Use of Hostname in Listener.ora
    -Oracle Home Executable Files Owner
    Thanks

    -Critical Patch Advisories for Oracle Homes
    Nice but pretty obvious - only need if you have a security policy at your company-Listener Direct Administration
    Dont believe in that one ...-Use of Hostname in Listener.ora
    Same with this ..-Oracle Home Executable Files Owner
    Should be fixed .. a valid problem.

  • Multi Org Access Problem in Oracle Alerts

    Hi All,
    I created one Alert for sending an email through Oracle Alert, after sending the mail I need to update one column in the table to indicate that alert has been sent for this particular row.
    Alert is sending mail correctly but it goes to update statement it throws following error:
    PL/SQL procedure successfully completed.
    BEGIN MO_GLOBAL.SET_ORG_ACCESS(0, null,'M'); END;
    ERROR at line 1:
    ORA-20001: APP-FND-02901: You do not have access privilege to any operating
    unit. Please check if your profile option MO: Security Profile includes any
    operating unit or the profile option MO: Operating Unit is set.
    ORA-06512: at "APPS.APP_EXCEPTION", line 72
    ORA-06512: at "APPS.MO_GLOBAL", line 638
    ORA-06512: at line 1
    APP-ALR-04020: Oracle Alert was unable to execute "&VALUE". Check that this file exists and that its read protection is set correctly.
    both the profiles MO: Security Profile, MO: Operating Unit are alredy set but still I'm getting error.
    My alert's update is simple update stement on custom table, Please guide.
    Thanks in advance.
    Regards,
    Reetesh Sharma

    Hi Reetesh ;
    What is your OS and EBS level?
    please check below Notes:
    APP-FND-02901 error when trying to open OM Forms [ID 887512.1]
    Convert to Multi-Org: Oracle error 20001:ORA-20001:Error occured during product initialization for MO [ID 413031.1]
    XLAACCPB - Create Accounting Program fails with Oracle error -20001: ORA-20001: APP-FND-02901: You do not have access privilege to any operating unit [ID 753824.1]
    When Running Concurrent Programs Get Oracle error -20001: ORA-20001: APP-FND-02901, Why? [ID 1061434.1]
    Accessing Responsibilities after Applying Patchset Gives Ora-20001 on MO:Security Profile [ID 199842.1]
    Hope it helps
    Regard
    Helios

  • Sending Attachments using Oracle Alerts

    Hi All,
    I am working on Oracle Alerts. I have to send an output of the report to the client, is it possible to send using Oracle Alerts.
    Thanks in Advance,
    Venky.

    Hi,
    To send attachments using Oracle Alert, you can follow below mentioned steps:
    1) While defining Oracle alert Action, Select 'Action Level' as 'Summary'
    2) In Action Details, select 'Action Type' as 'Operating System Script'
    3) Select 'Text' radio button
    4) Write following code : uuencode <Name of the file along with the path> <Name of the attachment in the mail>|mailx -c &cc_mail_id,&to_mail_id -s "<Subject of the Mailer>" &to_mail_id.
    5) You can use mail or sendmail command also instead of mailx command.
    6) Save Alert details
    Thanks and regards,
    Indira

  • "found dead shared server ... " errors occured in oracle alert log

    Dear all,
    I have found a error message in my oracle alert log which is "found dead shared server 's000, pid=(10,1)'". What's this mean? and this error will casue a core dump in ../cdump directory.
    btw. Thanks the answers of antti.koskinen and yingkuan.

    one more thing, my server is not configured as shared server mode, it is dedicated server mode. but I don't know why system inform me "found dead shared server..".

Maybe you are looking for