Passing a Parameter to the Procedure and changing it in the Procedure

Hi all,
I am trying to pass a parameter to a procedure like this.
PROCEDURE FLASH_PHY
(date_begin IN DATE, date_end IN DATE)
IS
I am trying to do SELECT and INSERT based on the date range passed in the procedure as mentioned above. And I am trying to do something like this.
SELECT NVL(sum(charges),0),count(summary_balances_id)
INTO lnu_charges_6months,c_summary
FROM SUMMARY_BALANCES
WHERE period_begin BETWEEN ADD_MONTHS((date_begin), -6) -- AND ADD_MONTHS((date_end), -1);
UPDATE summary_balances
SET cummulative_charges_6mo = lnu_charges_6months;
how should I do this parameter change. Right now if I use this select statement than it does not return anything as the parameter is passed on the procedure level. I am under the impression that when you pass a parameter to the procedure like this you can't change it into the procedure.
PLEASE GUIDE. Thanks a bunch. I really appreciate it.

From what I understand your variables that are passed into the
procedure can be manipulated as local variable to the procedure.
Here is my interpretation of what your attempting to do:
create or replace procedure A (x in number) IS
yes varchar2(3) := 'No';
begin
dbms_output.put_line('Start value for yes:'||yes);
select 'yes' into yes from dual where x+1 = 2;
dbms_output.put_line('End value for yes:'||yes);
end;
Call the procedure called "A" passing in a "1".
EG:
BEGIN
A(1);
END;
Does this answer your question?
,Russ

Similar Messages

  • Passing a parameter from one class to another class in the same package

    Hi.
    I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
    i. BugWatcherAction.java
    ii.BugWatcherRefreshAction.Java.
    We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
    So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
    ==============================================================
    public Object loadContent() throws Exception {
    Hashtable htStore = new Hashtable();
    JetspeedRunData rundata = this.getInputData();
    String pId = this.getPorletId();
    PortalLogger.logDebug(" in the portlet content: "+pId);
    pId1=pId;//done by sraha
    htStore.put("PortletId", pId);
    htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
    htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
    HttpServletRequest request = rundata.getRequest();
    PortalLogger.logDebug(
    "BugWatcherPortletContent:: build normal context");
    HttpSession session = null;
    int bugProfileId = 0;
    Hashtable bugProfiles = null;
    Hashtable bugData = null;
    boolean fetchProfiles = false;
    try {
    session = request.getSession(true);
    // Attempting to get the profiles from the session.
    //If the profiles are not present in the session, then they would have to be
    // obtained from the database.
    bugProfiles = (Hashtable) session.getAttribute("Profiles");
    //Getting the selected bug profile id.
    String bugProfileIdObj = request.getParameter("bugProfile" + pId);
    // Getting the logged in user
    String userId = request.getRemoteUser();
    if (bugProfiles == null) {
    fetchProfiles = true;
    if (bugProfileIdObj == null) {
    // setting the bugprofile id as -1 indicates "all profiles" is selected
    bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
    if (bugProfileIdObj == null) {
    bugProfileId = -1;
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    session.setAttribute(
    ("bugProfileId" + pId),
    Integer.toString(bugProfileId));
    //fetching the bug list
    bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
    PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
    if (bugData != null) {
    Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
    } else {
    htStore.put("NoProfiles", "Y");
    } catch (CodedPortalException e) {
    htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    PortalLogger.logException
    ("BugWatcherPortletContent:: CodedPortalException!!",e);
    } catch (Exception e) {
    PortalLogger.logException(
    "BugWatcherPortletContent::Generic Exception!!",e);
    htStore.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
    if (fetchProfiles) {
    bugProfiles = (Hashtable) bugData.get("Profiles");
    session.setAttribute("Profiles", bugProfiles);
    // putting the stuff in the context
    htStore.put("Profiles", bugProfiles);
    htStore.put("SelectedProfile", new Integer(bugProfileId));
    htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
    return htStore;
    =============================================================
    And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
    In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
    =============================================================
    public void doPerform(RunData rundata, Context context,String str) throws Exception {
    JetspeedRunData data = (JetspeedRunData) rundata;
    HttpServletRequest request = null;
    //PortletConfig pc = portlet.getPortletConfig();
    //String userId = request.getRemoteUser();
    /*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
    String pId = request.getParameter("PortletId");
    PortalLogger.logDebug("just after pId " +pId);  */
    //Calling the variable holding the value of portlet id from BugWatcherAction.java
    //We are getting the portlet id here , through a variable from BugWatcherAction.java
    /*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
    String portletID = bgAct.pId1;
    PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
    // updating the bug groups
    Hashtable result = new Hashtable();
    try {
    request = data.getRequest();
    String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
    //String pId = (String)request.getParameter("portletId");
    //String pId = pc.getPorletId();
    PortalLogger.logDebug("just after pId " +pId);
    PortalLogger.logDebug("after getting the pId-----sraha");
    result =BugWatcherAPI.getbugList(profileId, userId);
    PortalLogger.logDebug("select the new bug groups:: select is done ");
    context.put("SelectedbugGroups", profileId);
    //start clearing the cache
    ContentCacheContext cacheContext = getCacheContext(rundata);
    PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
    // remove the markup content from cache.
    PortletContentCache.removeContent(cacheContext);
    PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
    //remove the backend content from cache
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
    PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
    PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
    if (pdata != null)
    // User's data found in cache!
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
    pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
    PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
    //end clearing the cache
    // after clearing the caching calling the data from the database taking a fn from the portletContent.java
    PortalLogger.logDebug("after clearing cache---sraha");
    BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
    Hashtable httable= new Hashtable();
    httable=(Hashtable)bugwatchportcont.loadContent();
    PortalLogger.logDebug("after making the type casting-----sraha");
    Set storeKeySet = httable.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, httable.get(paramName));
    PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
    } catch (CodedPortalException e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    catch (Exception e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
    try {
    ((JetspeedRunData) data).setCustomized(null);
    if (((JetspeedRunData) data).getCustomized() == null)
    ActionLoader.getInstance().exec(data,"controls.EndCustomize");
    catch (Exception e)
    PortalLogger.logException("bugwatcherRefreshAction", e);
    ===============================================================
    In the bugwatcher Action there is another function called PostLoadContent.java
    here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
    ================================================
    // Get the PortletData object from intermediate store.
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
    //rundata.getRequest().getRemoteUser()));
    ((JetspeedUser)rundata.getUser()).getUserName()));
    pId1 = (String)portlet.getID();
    PortalLogger.logDebug("in the bugwatcher action:"+pId1);
    try {
    Hashtable htStore = null;
    // if PortletData is available in store, get current portlet's data from it.
    if (pdata != null) {
    htStore =(Hashtable) pdata.getObject(     PortletCacheHelper.getUserPortletHandle(
    ((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
    //Loop through the hashtable and put its elements in context
    Set storeKeySet = htStore.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, htStore.get(paramName));
    bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
    bRefAc.doPerform(pdata,context,pId1);
    =============================================================
    So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
    I am unable to implement that thing.
    If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
    Please let me know as early as possible.
    Thanks and regards,
    Santanu Raha.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • I am fed up with Spring and Apple passing me off to one another and neither will fix the problem. I am unable to receive a connection on my phone.

    I am fed up with Spring and Apple passing me off to one another and neither will fix the problem. I am unable to receive a connection on my phone.
    The internet goes out and I have to reset network setting each and every time. This is only a temporary solution which by the time I release the line with Spring or leave the apple store the issue is back. Sprint indicates that it is a know issue with the Iphone 5 and apple says it is a network issue as Sprint's network is not up to par with the Iphone and can not meet the expectations on the Iphone 5.
    I have attached a few picture, as you can see it clearly says I have 5 bars and 3g available but I have no connections what so ever.
    This issue affects all data and so I can not send or receive picture messages, use apps, or access the internet. The data goes in and out intermittently and it seems the phone chooses what I can and can't do.
    For example I can watch Youtube or Vevo videos but I can not access Facebook or Instagram.
    Is anyone else having this issue?
    I will soon loose my patience....
    I have reset my phone three time and have reset network and other setting mutltiple times.

  • How to call procedure inside a procedure and need to sore the value in a variable?

    HI ALL,
    i am usung oracle 11g.
    here is my package and procedure
    i want  to call get_email_details this procedure inside the process_email_master and want to keep the value inside a varible in master procedure
    create or replace
    PACKAGE        ms_gen_process_email
    as
       type email_type is record(subject                            varchar2(4000 char),
                                 email_body                       varchar2(4000 char),
                                 to_receipent                    varchar2(4000 char),
                                 cc_receipent                     varchar2(4000 char));
        type email_type_table is table of email_type;
       procedure process_email_master(
          p_metric_name     IN   VARCHAR2,
          p_current_stage   in   varchar2,
          p_action          in   varchar2,
          p_pid             in    number,
          P_OBJECT_ID       in    varchar2
          --p_emai_master     out   p_email_type_table
       PROCEDURE get_email_details (
          p_metric_name     IN   VARCHAR2,
          p_current_stage   in   varchar2,
          P_ACTION          in   varchar2,
          p_email_type_table1 out email_type_table
    END ms_gen_process_email;
    create or replace
    PACKAGE BODY        ms_gen_process_email
    as
        procedure process_email_master(
          p_metric_name     IN   VARCHAR2,
          p_current_stage   in   varchar2,
          p_action          in   varchar2,
          p_pid             in    number,
          p_object_id       in    varchar2
          as
          begin
          null;
           EXCEPTION
          WHEN OTHERS
          then
             null;
          end process_email_master;
       PROCEDURE get_email_details (
          p_metric_name     IN   VARCHAR2,
          p_current_stage   IN   VARCHAR2,
          P_ACTION          in   varchar2,
          p_email_type_table out email_type_table
       as
       BEGIN
          select subject, email_body, to_receipent, cc_receipent
           bulk collect into p_email_type_table
                    from ms_gen_email_config_detail
           WHERE email_key = (
                    SELECT email_key
                      FROM ms_gen_email_config
                     WHERE metric_name = p_metric_name
                       AND action = p_action
                       and current_stage = p_current_stage
          for i in p_email_type_table.first..p_email_type_table.last loop
          dbms_output.put_line(p_email_type_table(i).subject||p_email_type_table(i).email_body||p_email_type_table(i).to_receipent||p_email_type_table(i).cc_receipent);
          end loop;
       EXCEPTION
          WHEN OTHERS
          THEN
             NULL;
       END get_email_details;
    END ms_gen_process_email;
    but i am getting this error
    Error(15,31): PLS-00201: identifier 'P_EMAIL_TYPE_TABLE' must be declared
    Regards
    Damby

    If you need to call a procedure which has yet to be defined in your package, you can use forward declaration...
    That means that you declare the procedure/function before the place it's going to be called (typically people do this at the top of the package) without providing a body for the code...
    PACKAGE BODY        ms_gen_process_email as
       PROCEDURE get_email_details
          p_metric_name     IN   VARCHAR2,
          p_current_stage   IN   VARCHAR2,
          P_ACTION          in   varchar2,
          p_email_type_table out email_type_table
       ); -- Forward declaration of get_email_details procedure
        procedure process_email_master(
          p_metric_name     IN   VARCHAR2,
          p_current_stage   in   varchar2,
          p_action          in   varchar2,
          p_pid             in    number,
          p_object_id       in    varchar2
          as
          begin
          null;
           EXCEPTION
          WHEN OTHERS
          then
             null;
          end process_email_master;
       PROCEDURE get_email_details
          p_metric_name     IN   VARCHAR2,
          p_current_stage   IN   VARCHAR2,
          P_ACTION          in   varchar2,
          p_email_type_table out email_type_table
       ) as

  • I have bought an used Iphone 5. I dont have the password for the existing login id of the old owner. How do i use the phone and change the log in id?

    I have bought an used Iphone 5. I dont have the password for the existing login id of the old owner. How do i use the phone and change the log in id?

    Unfortunatly the only way that you can get it off is to get the old user to input the password.  You may need to contact that old user and see if he can put the old password in.  hope this helps.

  • When I convert my pdf doc to word, the fonts go really weird and it also puts some text into boxes. when I try to select the test and change the font, it does not change it properly?

    When I convert my pdf doc to word, the fonts go really weird and it also puts some text into boxes. when I try to select the text and change the font, it does not change it properly? This is making it impossible to amend.

    Hi Janedance1,
    If the PDF that you converted already has searchable text, please try disabling OCR as described in this document: How to disable Optical Character Recognition (OCR) when converting PDF to Word or Excel. (If the PDF was created from a scanned document and doesn't already have searchable text, disabling OCR isn't a great option, as the text won't be searchable/editable in the converted Word doc.)
    Please let us know how it goes.
    Best,
    Sara

  • I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    Are you trying to Print to PDF or are you trying to Print a PDF file to a physical printer?

  • All of a sudden, my settings have been changed, my homepage, and EVERYTHING. No matter how many times I go in and change them again, the SAME pages open up when I start FireFox and I am constantly being asked if I want Yahoo as my start page and default s

    I don't know what happened. All of a sudden, my settings have been changed, my homepage, and EVERYTHING. No matter how many times I go in and change them again, the SAME pages open up when I start FireFox and I am constantly being asked if I want Yahoo as my start page and default search engine. I click the box 'do not ask me again' and it comes up EVERY TIME. I change things like I don't want history remembered, and when I reload FireFox again, it's back to the way it was BEFORE. EVERY SINGLE TIME. I don't know why this is happening, or how to fix it. What do I do??

    I do not want to download another virus program.. I do not believe it is a virus. I am running the full version of Norton 360 and it is doing a daily scan. I have Windows 7, 64 bit OS.
    This is very irritating !! If I wanted Yahoo I would ask for it !

  • I change my Pc and don't found my Original DVD from my Acrobat 9 STANDARD. I have the Key and found in Internet the Pro Version, but not the Standard Version. Where can i download the Standard Version?

    I change my Pc and don't found my Original DVD from my Acrobat 9 STANDARD. I have the Key and found in Internet the Pro Version, but not the Standard Version. Where can i download the Standard Version?

    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 |12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.window using the Lightroom 3 link to see those 'Important Instructions'.

  • How do you change the color of the sign and fill text to the color blue

    How do you change the color of the sign and fill text to the color blue in a pdf document

    Is this using the "Fill & Sign" tab of https://cloud.acrobat.com/fillsign (for now text input is only black) or maybe using the Fill & Sign tool in Adobe Reader XI, or another application? 
    Thanks,
    Josh

  • HT5661 I gave my old I-phone to my daughter and changed all of the settings to her acc. But when we plug it in to sync the phone in her acc, it still says its my phone, were else do I need to look

    I gave my old phone to my daughter and changed all of the setting to her user name and everything, but when we sync it to her account it still says its my phone, were else should i look for changing account name

    have you logged out with the old appleID in settings->itunes & app stores ?

  • When connect appletv to tv it is asking to check the resolution and change the resolution

    First time when I am connecting appletv to SamsungTV it is asking to check the resolution and change the resolution.

    Keynote can not burn DVD discs, nor can it compile a video DVD project
    If you have iDVD installed on your Mac, You can export the Keynote presentation to iDVD to create a video DVD:  
    from within Keynote:     Share > Send to > iDVD

  • My mac disk is full and i cant transfer files from Mac to USB. saying the format is not good, how can i change the format and what happened to the files i have on USB?

    my mac disk is full and i cant transfer files from Mac to USB. saying the format is not good, how can i change the format and what happened to the files i have on USB?

    Once something similar happened to me. The external drives I had set up for FCP to use for some reason were not mounted, and FCP put all its render files on the main drive and I couldn't find them anywhere.
    Go to applications, and control-click (and hold down) on your FCP icon; you should get a pop up menu that says "show package contents". Select that, select the "contents" folder, then the "mac OS" folder. See if your quicktime file is in there, or if you've got render files in the "render" folder or audio render files in the "audio render" folder that don't belong there.
    That's where FCP sticks stuff when your documents FCP project folders are not available or when external drives you've selected aren't available.

  • How do I change the size of the words on the banner and tool bars?  The words are so large that I cannot access all the options.

    How do I change the size of the words on the banner and tool bars?  The words are so large that I cannot access all the options.

    Hi ewhuntley,
    It sounds like you may be running Acrobat 11.0.07, is that correct? If so, please choose Edit > Preferences > General. In the entry Scale for Screen Resolution, choose 100%. Save your changes, and restart Acrobat. Did that do the trick?
    Best,
    Sara

  • Has anyone else had issues with changing how the time and date look on the status menu in Mavericks?

    I'm trying to make it so the year displays, but haven't been able to figure out how to change that. I have the Day of the Week, Month, Day and Time only and I haven't been able to figure out how to do that in the Date & Time or the Language & Region Settings.

    There is no option in System Preferences. However, it may be possible to set it with a "defaults write" command.
    This page shows how to set the time and date format in the Terminal, but doesn't show whether you can add the year.
    http://apple.stackexchange.com/questions/75116/i-want-to-change-clock-from-12h-t o-24h-mode-via-terminal
    If you can find a description of Apple's date format code that includes the year, then it may be possible. Or not.
    I'm guessing Apple thinks only Time Travellers need to ask what year it is...

Maybe you are looking for

  • Can you burn multible movies on one bluray dvd disc with final cut pro

    how to burn two completed quick time movies to blu ray dvd with final cut pro? Ive tried but wont play

  • PL/SQL Javascript Function Call

    Can anyone offer some help on this? I am attempting to get a javascript tool tip to work on an application I am developing. I have developed a line calendar using PL/SQL outputting HTML. When I embed a javascript function into my PL/SQL htp.p functio

  • Pipeline Function Showing Error.

    Hi, I have created a popeline finction in a packages... CREATE OR REPLACE package xx is type xxaptab_tp is record (FLAG CHAR(1),   LEDGER               VARCHAR2(30),   OPERATING_UNIT       VARCHAR2(240) ,   GL_DATE              DATE   ,   TYPE       

  • Authentication and Groups

    Hi I have several security roles defined within weblogic.xml. It is heirarchical in nature, ie root/admin/user, such that root can see all, admin can see admin and user and user can see only user. If I log into a root only page as an admin user with

  • Can substitution strings be changed at runtime?

    I need to deploy my application such that it can run with different sets of tables, which are otherwise identical in design. My client has multiple versions of the tables. For instance, they may have CHICAGO.EMPLOYEES CHICAGO.DEPARTMENTS or LONDON.EM