Need help on code PLSQL bit reality

Hello

I need help of reality bit on encoding.

I want to code a procedure that looks like where is a row in a table that is older, then a day and remove this line, but before that he sent an e-mail to the e-mail address that is stored in this row of the table.

Here is the example:

Table name: une_table

Columns: Username | SOMEINFO |         CREATE_DATE | CODE_THING | EMAIL_ADDRESS

Lines: user1 user1info 4 April 15 06.15.45.00PM XY2ZH89J [email protected]

User2 user2info 4 April 15 06.15.45.00PM KJH43TZH [email protected]

util_3 user2info 7 April 15 09.10.35.00PM LQT3B8N [email protected]

My test of this code (it just an example):


DECLARE
l_emailadres varchar2(50);
BEGIN
SELECT email_address into l_emailadres
FROM some_table
WHERE  create_date < sysdate -1;

APEX_MAIL.SEND(
p_to => l_emailadres,
p_from => '[email protected]',
p_subj => 'Email Info',
p_body => ‘Your row was deleted!’);
APEX_MAIL.PUSH_QUEUE();

DELETE FROM some_table WHERE create_date < sysdate -1;
END;

The problem is that there is more than one line which is given back then it gives me an error "in l_emailadres" because there is that [email protected] and [email protected] are selected.

I need a solution on this.


I'd appreciate any help.

Of course, it would be better if someone can give me a code example.

Thank you!

Of course, it seems that apex_mail.push_queue () performs a validation. It does not work with a 'for update cursor.
Therefore, place the push_queue after the loop:

declare
cursor c_x
is
Select email_address
of une_table
where create_date< sysdate="">
update the email_address;
Start
for in c_x r_x
loop
remove from une_table location being the c_x;
apex_mail. Send
(p_to-online r_x.email_address
p_from-online "[email protected]"
p_subj-online 'E-mail Info'
, p_body => "your row has been deleted!
);
end loop;
apex_mail.push_queue ();
end;

Tags: Database

Similar Questions

  • Compaq cq10: need help please code error: CNU0015RN9 on compaq cq10 150ev

    Need help please code error: CNU0015RN9

    Thank you in advance!

    Hello

    No problem. Did you do a hard reset and try again?

    For the error code, check again a time-

    Try:

    e9l11f3zv7

    all lowercase letters

    first letter is a small suitcase E
    second is number Nine
    third letter is small case L
    fourth & fifth is number one
    Sixth letter is small box F
    seventh is number three
    eighth letter is small suitcase Z
    ninth letter is small case V
    the last is number seven

    Concerning

    Visruth

  • Need help with Code

    Hi, I need help in answering this question...

    1. to list separate them that visit many of the sites.

    The code that I currently displays holidays and sites, but I need if it will show the top 3 holidays than most visit sites.

    Select 'IT220_DETAILS_SITES_VISITED '. "' SITE_NAME ' as 'SITE_NAME ',.
    'IT220_HOLIDAY_DETAILS '. "' DESCRIPTION_OF_HOLIDAY ' as 'DESCRIPTION_OF_HOLIDAY '.
    of "IT220_SITES_VISITED" "IT220_SITES_VISITED"
    "IT220_DETAILS_SITES_VISITED" "IT220_DETAILS_SITES_VISITED"
    "IT220_HOLIDAY_DETAILS" "IT220_HOLIDAY_DETAILS".
    where 'IT220_SITES_VISITED '. "" CODE_OF_HOLIDAY_PACKAGE "=" IT220_HOLIDAY_DETAILS. " "" CODE_OF_HOLIDAY_PACKAGE ".
    and "IT220_DETAILS_SITES_VISITED". "" CODE_OF_SITE "=" IT220_SITES_VISITED. " "" CODE_OF_SITE ".
    order by 'SITE_NAME '.

    813948 wrote:
    I realize the question is actually just holidays to appear that the sites the most.

    select  "DESCRIPTION_OF_HOLIDAY"
      from  (
             select  "IT220_HOLIDAY_DETAILS"."DESCRIPTION_OF_HOLIDAY" as "DESCRIPTION_OF_HOLIDAY"
               from  "IT220_SITES_VISITED" "IT220_SITES_VISITED",
                     "IT220_DETAILS_SITES_VISITED" "IT220_DETAILS_SITES_VISITED",
                     "IT220_HOLIDAY_DETAILS" "IT220_HOLIDAY_DETAILS"
               where "IT220_SITES_VISITED"."CODE_OF_HOLIDAY_PACKAGE"="IT220_HOLIDAY_DETAILS"."CODE_OF_HOLIDAY_PACKAGE"
                 and "IT220_DETAILS_SITES_VISITED"."CODE_OF_SITE"="IT220_SITES_VISITED"."CODE_OF_SITE"
               group by "IT220_HOLIDAY_DETAILS"."DESCRIPTION_OF_HOLIDAY"
               order by COUNT(*) DESC
            )
      where ROWNUM <= 3
      order by "DESCRIPTION_OF_HOLIDAY"
    /
    

    SY.

  • Need help acquiring Code of Validation to download an update on Windows Vista

    I am trying to install an update on Microsoft.com (KB971512 update) and it says I need a verification code and download a real control to get it. I have download and run, it is said "this version of Windows Genuine Advantage validation tool is no longer supported. Please download the latest version and make sure that your system clock is accurate.

    I tried the latest version and found the 1.9.0027.0 version. He said that my posting status is authentic, but the validation code is 0. I need a 8 digit code to be able to download the update above, how do I get this code?

    Use Internet Explorer - Firefox OR Chrome.

    validation in Windows 7 requires ActiveX.

  • need help error code c355

    I have this code in my history of update?

    Hello

    1. for the update that you get this error code?
    2 did you recent hardware or software changes to your computer before this problem?

    Step 1: Install the first update manually in the clean boot state.

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    See the following article in the Microsoft KB for more information on how to solve a problem by performing a clean boot in Windows Vista or Windows 7:

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

    Step 2: I also suggest you to run the system analysis tool and look for problems with Windows Update.

    http://support.Microsoft.com/kb/947821

    Step 3: You can try to download the update from the Microsoft Download Center and install it.

  • Need help with code signing.

    Hello

    I did an application that requires a code signature because I use the function 'Automatic Execution at startup' (this is what I was told).  I use not all restricted classes.

    So, I asked for a key to the RIM and received.

    I have received only a single file named "customer-CPR-# .csi" (the e-mail talked about three files however: RBB, CPR, RRT).  Nevertheless, I followed the instructions and managed to install this .csi without error (I received a confirmation e-mail).

    Now, I want to sign my code...

    I tried using "build - request Signatures ' in my Blackberry JDE and this displayed:

    javaw.exe - jar "C:\Program research in Motion\BlackBerry JDE 4.2.1\bin\SignatureTool.jar" f d "C:\Documents and Settings\johndoe\Local Settings\Temp\RIMSigTool65120.tmp"

    However, nothing happens (this jar file is there though).

    I looked beyond and found a 'Signature tool' under "Component of the Blackberry JDE 4.2.1 Package" in the "Programs" menu

    When I run this, I get invited to one. COD file.  I select my and then I see a window that shows six times my. File of COD that says that my COD file does not require a signature.

    Also, looking around this forum, I have seen some people saying a. CSL file is necessary... but I do not have this file in my project directory.

    So to make a long story short, I'm a bit confused on what do I do next for my application run at startup on the Blackberry.  How should I sign it?

    Thanks for your help!

    Please ensure that you have a current project, when you select apply Signatures from the Build menu.  The only assets of signs SignatureTool projects, so if no project is active, nothing will happen.

  • Need help RE: Code 80070005 error when I try to update

    I get the error code 80070005 when I try to update. I also got "Fix a problem" then "Try again" with the same results. I tried to download the update from the window

    Hi cynthiabrickey,

    Follow the troubleshooting steps in this thread to solve the problem with Windows Update, error 80070005.

    Let us know if it helps.

  • need help with code 43 windows7 hp all-in-one2050 j510

    Code 43 felmeddelande

    Windows 7 har stangt av printern.

    Tell me WHY "?"

    Var snall och help till att fixa felet.

    Tack

    Hello

    Please select your language from the drop-down menu above to post your question in the language of your choice. The forum in which you've posted is for English only. If you can't find your language above, support for additional international sites options are by following the link below:

    http://support.Microsoft.com/common/international.aspx

    Hope this information helps.

  • Need help with forms, plsql

    Hi, am new to oracle and do a project on the same

    I have the following code and would like to store the variable 'wid' for my next step but unfortunately I get an error > bad connection variable. How can I go about it? Any help will be much appreciated

    Code > >

    DECLARE

    U_ID VOTERS. TYPE % V_ID;

    MOVE VOTERS. PASSWORD % TYPE;

    CURSOR LOGIN_CUR IS

    SELECT V_ID, PASSWORD OF VOTERS;

    BEGIN

    SELECT W_ID IN: WID OF VOTERS WHERE V_ID =: V_ID;

    BEGIN

    LOGIN_CUR OPEN;

    LOOP

    EXTRACT THE LOGIN_CUR IN U_ID, PASS;

    IF: V_ID = U_ID AND: PASSWORD = PASS THEN

    OPEN_FORM ("... ») ;

    OUTPUT LOGIN_CUR % FOUND;

    END IF;

    END LOOP;

    CLOSE LOGIN_CUR;

    END;

    END;

    Hello

    By declaring the global variable, you can pass values between Forms.

    For example

    -to declare a global variable in the triggering of the preform

    : global .wid: = null;

    or

    default_value (null, 'global.wid');

    -then on your trigger when--button of the " connection " button

    SELECT W_ID IN: GLOBAL. WID OF VOTERS WHERE V_ID =: V_ID;

    -to destroy a global variable and free its memory, use the built-in procedure clear ;

    Erase ('global.wid');

    I think that the following discussion is useful to you:

    Pass the global variable between two forms

  • Need help with a 32-bit Thinapp had app to interact with Outlook 2010 x 64.

    It is a specific example, but this isn't the only application that I have a problem with any ideas are welcome.

    Here's the current scenario that drives me bananas.

    The Thinapp - Visio 2010 (32-bit, of course), packed under XP SP3 with Office 2003 is installed locally.

    Target OS - Win 7 x 64 with Office 2010 x 64 installed locally.

    Visio 2010 is running, you can virtually all do it... except, save and send-> Send as an attachment (or take the steps to e-mail).

    Basically, I tried it is difficult to explain the specific error, because they vary from "There is no default mail client installed" as many variations of "Reinstall outlook" absolutely nothing happening.

    The common theme is that the windows installer starts a repair for msmapi32.dll.  Insulation on the folder that contains msmapi32.dll (C:\Program Files\Common Files\System\MSMAPI\1033) is set to writecopy.  I even tried including msmapi32.dll inside the thinapp Visio, but I don't seem to be getting anywhere.

    Send as attachments work fine on XP SP3/Office 2003.  So I was wondering if anyone had some advice to get 32-bit apps to play nicely with x 64 apps.

    I tried to turn on/off WOWon64 in package.ini, I've got the following in my buildoptions

    ChildProcessEnvironmentDefault = virtual

    ChildProcessEnvironmentExceptions = Outlook.exe

    and VirtualiseOutofProcessCOM = 0

    All tips/tricks beyond the ordinary, much appreciated. For now, it's time for me to go home and have a beer.

    Cannot conclude something concrete now.

    It may be a good idea to install 32-bit office natively, and to observe the behavior. This way atleast we can reduce. Take your old installation that has worked for you in the other OS. Deploy it on 64 bit OS and see if it works.

    If there is a communication problem with the 64-bit native applications. We need to varify if that actually works of native office visio and 64-bit native 32-bit.

  • canoe to update windows vistA, C8000408, need help error code on this

    Cannot update error code windows vista get C8000408, what can I do?

    Hello

    ·        You did changes to the computer before the show?

    ·        What is the complete error message you get?

    Method 1: Run the SFC scan and check if system files are intact:

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    http://support.Microsoft.com/kb/929833

    Method 2: I suggest that you put the computer to boot and check if you can install the updates:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

    You can also check out the link:

    What are the error codes and how can I use them?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-are-error-codes-and-how-can-I-use-them

    Reference: The problems with installing updates

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates

  • I try to install Theme Hospital, but I need help :-(incompatibility with 64-bit

    I try to install Theme Hospital, but it says it cannot start or run due to incompatibility with 64-bit windows versions... y at - there a way around this? I REALLY want to play.

    Hello

    always check the compatibility of vista programs on the link below

    and compare it to the 64-bit tab compatibility, not only the 32-bit standard

    http://www.Microsoft.com/Windows/compatibility/Windows-Vista/default.aspx

    If a program is compatible with vista you can try right click on the setup.exe, and then selecting run as administrator

    It is not compatible with vista, you can try running it in a previous operating system mode

    This does not work for all programs

    read the information below

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-compatibility-mode/

    ____________________________________________________________

    and read this information MS, too

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-the-program-compatibility-Wizard

  • Need help with rewrite PLSQL function EVALUATE

    Hi all

    I'm trying to convert some PLSQL (from Discoverer) in a column of answers and I can't seem to get the correct formula.

    The original formula:
    MIN (Processed_Date) MORE (SCORE OF Business_Area, product, Serial_No)

    I guess that this must be done in an evaluation function, but I can't work on the correct syntax.

    This formula:
    Evaluate ('MIN (%1) OVER (PARTITION OF 2%, 3%, 4%)) ", Business_Area, Processed_Date, Serial_No, product)
    Has generated this error:
    [nQSError: 10058] A general error occurred. [nQSError: 22027] Union of incompatible types. (HY000)

    I do not know what causes the error, and tried casting explicitly throughout the column, but still getting errors.


    I am open to any suggestion.

    Thank you.

    Published by: jasonr on Dec 14, 2010 09:54

    Jasonr,

    highlighted in bold is the change
    Try this EVALUATE ('MIN (%1) OVER (PARTITION OF 2%, 3%, 4%)) AS the DATE, Processed_Date, Business_Area, product, Serial_No)
    update if it solved your problem.

    -bifacts
    http://www.obinotes.com
    J

    Published by: bifacts on December 14, 2010 21:52

  • HP2000: Need help

    Need help with code is 53346046

    @Danero2

    Enter 42024088

    Kind regards

    DP - K

  • my bit defender can't seem to get rid of malware called OSX/InstallMiez need help

    I have a Mac with OSX EL Capitan my bit defender 2014 I can't seem to get rid of malware called OSX/InstallMiez.

    Need help thanks in advance

    I don't know this type of malicious software, but you can try to get rid of with one of these applications (free and safe):

    https://www.Malwarebytes.com/antimalware/Mac/

    http://etrecheck.com/

Maybe you are looking for