Simple question about using passing parameters in a procedure

I have a below stored procedure (part of a package) that I need to modify by removing hard coded declaration of "cutoffdays" and change it into a parameter passed from procedure. I am not sure how to do declare and pass values for delete from a table.
CREATE OR REPLACE PROCEDURE  counttimes
IS
   CutOffDays   NUMBER := 14;
BEGIN  
DELETE FROM   timetable
         WHERE   timestamp_val < SYSDATE - CutOffDays;
   COMMIT;
END counttimes;

Hints
<li>never commit at the end of a procedure, if you didn't commit at the beginning. Do the transaction handling at a higher level.</li>
<li>Name the procedure so that it is clear what it does. If records are deleted, then the procedure name should reflect that.</li>
<li>Work with full days, i.e. use trunc(sysdate) instead of sysdate. </li>
CREATE OR REPLACE PROCEDURE  removeTimes (CutOffDays in integer)
IS
BEGIN  
       DELETE FROM   timetable
       WHERE   timestamp_val < trunc(SYSDATE) - CutOffDays;
END counttimes;Edited by: Sven W. on Feb 14, 2011 4:17 PM

Similar Messages

  • Probably a simple question about using a flash header for navigation

    What would be the best way to go about loading this flash
    navigation?
    http://www.marcos-ac.com/wip/
    Basically my issue is that I don't want the animation to run
    through each time. On the homepage, I want it to run through it's
    whole animation, but after that, I just want everything to be up
    there... not flying in and fading in on each of the pages in the
    site.
    My ideas:
    1. Some sort of actionscript command that says "if you are on
    a page named index.htm then play the entire movie, otherwise, goto
    and play frame 100 (the last frame).
    2. Use a shell movie and do a loadMovie that they jumps to a
    frame. Insert the shell movie on the subpages in the site. I tried
    this an it didn't work. And I've read that it's unreliable because
    the label may not exist yet when the movie is called or something.
    Must be cached.
    3. Build 2 movies... one with all the intro animation frames
    chopped off. I tried this and didn't like it as the movie is
    already pretty huge and to load two movies that are large is
    annoying to users. This is the method I am currently using.
    Thanks for the help!

    The quick and easy way - not necessarily the most elegant way
    - to solve the problem is to use html frames. Put the nav in a
    header frame and have contents display in a second frame
    underneath. Will require you add a target="contentframe' (or
    whatever you name the content frame) parameter into each link in
    the nav flash, but other than that you won't need to make major
    changes.
    The nav plays once and just sits there until they reload the
    entire page the next time they visit. No actionscript, tests,
    preloading, etc required.

  • Keychain - simple question about use

    I would like keychain to ask me for the "login" keychain password when I navigate to a page requiring user id and password in Safari. After proving the "login" password, I would like keychain access to insert the appropriate user id and password. How do I accomplish this?

    Maybe I've got the wrong understanding. It was my impression that Keychain and Autofill were two distinct things. I have been using autofill all along and when I go to a website, put in my id and password and hit send or continue or whatever, a window comes down from the top of the safari window and asks me if autofill should remember the password. The next time I visit the site, the info appears in the right places.
    What I want is for me to go to the site and for a window to pop up and ask me for my keychain password BEFORE putting the site's user id and password in. A friend of mine has this setup on his computer but doesn't know/remember how it got that way so he is no help.
    I hope this clarifies my question.
    Thank you all for your help.

  • Simple Question About Using "Group by" Inside the Oracle XE Query Builder

    Hi,
    I am a new user of Oracle 10g XE and I have built and populated some tables. I am trying to create a view (make a query) via using the Query Builder. I have chosen two attributes, say course_section_ID and trainer_ID in the same table. I choose the "COUNT" function for course_section_no and I check the box for "Group By" with trainer_ID. (I would like to count the number course sections each trainer is teaching). Then I "run" the query and the same error message appears:
    fail to parse SQL query:
    ORA-00904: "COURSE_SECTION"."TRAINER_ID": invalid identifier
    Both attribute names should be valid (as shown above).
    If I only choose course_section_ID and do a COUNT on it, it gives the same error message on course_section_no.
    I did try to do the same thing with the demo HR database. There were no problems with counting a field nor with grouping on a field with HR.
    PLEASE HELP!
    Thanks.

    I have got it. When all the attribute names are in the uppercase, then I can do aggregate functions and "group by" with the GUI.

  • Question about Using PAPI Web Service in PowerBuilder 9

    Hi, all.
    I Have a simple question about using papiws in power builder 9.
    In pb9, I created a new Web Service Proxy Wizard and I input a url for papiws(ex. http://seraphpernote:7001/papiws/PapiWebService) and click next.
    But I couldn't get any Service List.
    In Eclipse, I used this url for using papiws well.
    Does anybody know about this case??
    help me plz.

    IIRC you must activate PAPI-WS for the engine. In Studio you do it by right-clicking on the project, then "engine preferences". In enterprise/standalone you must activate PAPI-WS in the Admin Center.

  • Simple question about mount and delay script

    Hello, I have a simple question about mounting volumes on start up.
    My computer wakes up auto - and then auto there are serveral applescript tasks (mount and start up programs)
    I use this script (daily) for serveral connections with external volumes I always need the connect to. ( In the script I use this code 3 times for other locations) I do this on start up.
    set Uname to "XXX"
    set Pword to "XXX"
    set someVolume to "afp://XXX.XXX.XXX.XXX/XXX/XXX
    mount volume someVolume as user name Uname with password Pword
    (same code for 2 other locations)
    When i do this on start up sometimes the script says there is no connection possible. I guess it's because on start up the connection isn't there. And 1 minute later when computer is total ready the connection is ok. When I run the script then It works. Just sometimes ( In the morning) 'It' want to connect but the script stops. When i do it manually(I run the script again) it works just fine.
    Is it possible that I need a delay? Can someone explain this?
    How would I make a delay handler for this script? Is that the best solution?
    Thanks in advance. This is something small i'm wondering about.
    Colin

    BTW, If you saved the script as an application +(and not as an application bundle)+ you could drop the script on to *Drop Script Backgrounder* (freeware).
    Then the script would run in the background, so, you wouldn't see it running in the Finder.
    <http://www.macupdate.com/info.php/id/7922/drop-script-backgrounder-x>
    Tom

  • A simple question about combo box

    Dear All,
    Just got a simple question about combo box: I have one of these selectors with labels based on filtered rows from a table.
    Is it possible to have one more label that would select all options?
    Like:
    Product A
    Product B
    Product C
    All Product
    Many thanks for your help!
    Gilles

    Hi Gilles,
    The purpose of ComboBox itself to select single option out of many.
    For your purpose, you may have to use "List Builder" which can accomodate 1 or more  to select.
    Please revert for more clarification if you need.
    With best wishes
    BaaRaa.

  • A simple question about performance!

    Hi! I have a simple question about performance. Suppouse that you have a servlet or a class with DB access, and you need to use a value several times in that page. What is best, to assign the value from say, a resultset or a request.getParameter() to a variable or to call the resultset or the request every time you need to retrieve that value? Which option uses less memory, which is faster, etc.?
    Hoping the best fou u
    Raul

    If you need more values from a db, the best is to open some connections (connection pool) and use the for accessing the db.
    To get the data only once, open the connection, get the data, store the data whereever you want: variable (class), hidden control (if you want to send from one page to another by request) and close the connection as quicky as possible.
    The advantage of the first method is that the most time consuming activity (connections opening) is done only once.

  • I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher

    I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher #1 iPad to its AppleTV without effecting/projecting onto the adjacent teachers #2 classroom AppleTV?

    Not as such.
    Give the AppleTV units unique names and also enable Airplay password in settings with unique passwords for each teacher.
    AC

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Question about using new battery in old Powerbook

    I have a pre-intel Powerbook G4, and the battery is pretty much toast (lasts about 15 minutes now). I have ordered a new battery for it, and I have this question about using it:
    Am I smarter to keep the new strong battery out of the PB most days (as I usually work with it plugged in at home) and just pop it in when I know I will be out surfing on batteries? Or is it just as good living in my laptop 24/7 and only occasionally being called upon to do its job?
    Current bad Battery Information below:
    Battery Installed: Yes
    First low level warning: No
    Full Charge Capacity (mAh): 1144
    Remaining Capacity (mAh): 1115
    Amperage (mA): 0
    Voltage (mV): 12387
    Cycle Count: 281
    thanks folks, Shereen

    Hi, Shereen. Every Powerbook battery wants to be used — drained and then recharged — at least every couple of weeks. If you've always used your Powerbook on AC power nearly all the time, and not followed that pattern of discharging and recharging the battery every week or two, it's possible that your use habits have shortened the lifespan and prematurely diminished the capacity of your old battery. Of course it's also possible that your battery is merely old, as a battery's capacity also diminishes with age regardless of how it's used. You didn't say how old the battery is in years, so this may or may not be an issue. I mention it only because it can be an issue.
    For general information on handling a battery for the longest possible lifespan, see this article. My advice on the basis of that article and long experience reading these forums is that it would be OK to do as you propose, but I doubt that you'd derive any significant benefit from it. You would still want to be sure of putting the new battery through a charge/discharge cycle every week or two, even if you didn't have a reason to use the Powerbook away from home or your desk, because sitting unused outside the computer is just as bad for a battery as sitting unused inside it. And you should never remove the battery from your computer when it's completely or almost completely discharged and let it sit that way any longer than a day or two.
    Message was edited by: eww

  • Question about using TVARV in an ABAP program

    Hello gurus, Im sorry about the silly question.
    I have a question about using TVARV in an ABAP program.
    A program is presenting a problem and I think that in this code:
    SELECT SIGN OPTI LOW HIGH
      FROM TVARV
      INTO TABLE R_1_163431035_VELOCIDADE
      WHERE  NAME = '1_163431035_VELOCIDADE'
      AND    TYPE = 'S'.
      IF ZMM001-VELOCIDADE_B   IN R_1_163431035_VELOCIDADE AND
          ZOPERADORAS-OPERADORA = 'ABCD' AND
          ZMM001-MATERIAL       IN R_1_163431035_PRODUTO.
      ELSE.
      ENDIF.
    What happens is that the value "ZMM001-SPEED" B not exist in "R1_163431035_VELOCIDADE" but the program executes commands under the IF and not under the ELSE, as I imagine it would work. Is this correct ?
    I am new to ABAP programming, but I have a lot of XP in other programming languages ​​and this makes no sense to me.
    Anyone know where I can find some documentation of the use of "TVARV" in ABAP programs?
    I search the Internet if other programmers use TVARV this way, but found nothing, which leads me to think that was a quick and dirty solution that used here.
    If this is a bad way to program, what would be the best way?
    Regards
    Ronaldo.

    Hi Ronaldo,
    But in this case, the range is not empty, there are 17 records, in this way.:
    For the column "SING" all values ​​are "E"
    It means that the result is false if ZMM001-VELOCIDADE_B has the same value as one of the 17 records (E = exclude).
    For instance, if it has value 'C' and one of 17 records matches C, then the result is false.
    The "IF" with "IN" using "TVARV" as used in the program of the post above has the same behavior of a selection screen?
    Yes, the same behavior as the selection criterion to be exact. You can press the help key in the complex selection dialog for more info.
    I know it's a silly and very basic question, but other language that I used, only the SQL has the "IN" operator, but I think they work in different ways, so I would like to understand how it works in ABAP.
    Not silly ;-). Yes they work differently.
    More info here:
    - http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba74635c111d1829f0000e829fbfe/frameset.htm
    - http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/frameset.htm
    BR
    Sandra

  • Question about using Macbook in Vietnam.

    I have a question about using Macbook in Vietnam. I bought my mac here in the US, and I'm going to visit Vietnam, but I'm wondering if I can plug in the power directly into the wall or I have to need any convert power modem for my mac. The only thing I know that Vietnam use 220V so, can anyone help me?

    You may need a plug adaptor, but you don't need a power converter.
    (43828)

  • I have a question about using adobe CS files in CS6 edition

    I am a graphic artist . I have a question about using adobe CS files in CS6 edition. when I am gonna open thse adobe CS created files in CS6 Edition i get a color variation than i made with the CS version.Please give me an idea about this issue as soon as possible.If you need i can upload my problem as a screenshot to clearity

    donrulz,
    Are your Edit>Color Settings the same?
    Are you using spot colours, such as Pantone (there have been some changes in CMYK values with new colour books)?

  • Where Would be the best category to ask a question about using dashboard?

    Where Would be the best category to ask a question about using dashboard?

    However, don't ask it in this topic. Create a new topic for the question with a title describing that you are looking for Dashboard help.

Maybe you are looking for

  • Adobe Photoshop CS6 Very Slow On Rendering Type

    I have a notebook with specification as mentioned below : Lenovo Ideapad Y470P 2nd generation Intel Core i7-2670QM Processor( 2.2GHz 1333MHz 6MB) Windows 7 Ultimate x64 AMD Radeon HD 7690 2GB 8.0GB PC3-10600 DDR3 SDRAM 1333 MHz 750GB 5400 I'm using A

  • ABAP in update rule

    I have one code in the start routine of the update rule which i have copied below .Just to fetch 96000 record , the system is getting hanged. select       /bic/zemployee       /bic/zevent       /bic/zmatlsamp       material       /bic/zcustomer      

  • Mouse pointer rather slow

    After changing mouse pointer acceleration in control panel to maximum, mouse pointer is faster, but still rather slow. At least slower, than it is with windows7. In windows7 it´s one move from left to right. In Windows10 I have to move twice. It´s an

  • Hey im using apple 3g with os 4.2.1 but i cant install whatsapp for this need a help

    hey im useing apple 3g with os 4.2.1 but i cant install whatsapp for that how can i install whatsapp!!!!please reply me soon

  • DIM-00035 You have entered and invlaid option for the -EDIT command

    Hi Experts, I am creating oracle instance using oradim utility. I am using oracle 9.2 on windows 2003 server. I have installed oracle 9.2 and created ORCL database as part of installation. Now I have deleted ORCL database using DBCA. Now I try to cre