How to get value and name of the n'th parameter in a pl/sql funct./proced.

procedure test(name varchar2, birthdate date, zip number, country varchar2);
in procedure x I do
test('Michael Postmann', to_date('03.01.1983', 'DD.MM.YYYY'), 7461, 'AUSTRIA');
And this should htp.print the following:
test: name=Michael Postmann,birthdate=1983/01/03,zip=7461,country=AUSTRIA
In procedure test I want to know:
*) What is the name of myself (the procedure)
*) Optionally: Am I a procedure or a function?
*) How many Parameters do I have?
*) What are the values of them?
*) What are the names of them?
*) Optionally: What are the types of them?
What I actually want to do is:
I have a procedure for logging errors. So in my program I call this function frequently and I want it to log the current time, a string passed to the logging function, the client's ip, etc.... but it should also log a list of the parametrs and values of the procedure/function where the error occoured.
Is there any way to do this (I think in C this is done by argc and argv, but a string containing all the information (as you get it from the WebDb when something goes wrong) would be enough)?
Thx in advance,
Nomike aka Michael Postmann

Name of procedure or function can be retrieved using DBMS_UTILITY.FORMAT_CALL_STACK:
CREATE OR REPLACE FUNCTION fn_whoami (v_in varchar2)
RETURN varchar2
AS
v_stack varchar2(1000) DEFAULT DBMS_UTILITY.FORMAT_CALL_STACK;
v_job varchar2(500);
v_name varchar2(100);
BEGIN
v_job := SUBSTR(v_stack,INSTR(v_stack,'function'),256);
v_name := SUBSTR(v_job,1,INSTR(v_job,CHR(10))-1);
return v_name;
END fn_whoami;
select fn_whoami('1') from dual;
CREATE OR REPLACE PROCEDURE pr_whoami
AS
v_stack varchar2(1000) DEFAULT DBMS_UTILITY.FORMAT_CALL_STACK;
v_job varchar2(500);
v_name varchar2(100);
BEGIN
v_job := SUBSTR(v_stack,INSTR(v_stack,'procedure'),256);
v_name := SUBSTR(v_job,1,INSTR(v_job,CHR(10))-1);
dbms_output.put_line(v_name);
END pr_whoami;
exec pr_whoami;

Similar Messages

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • How to get Branch and section of the employee

    HI ,
             I want to get branch and section of the employee in report, please suggest me any way to get this from table and which fields are used for this . I have pernr , orgeh and BEGDA and endda of the employee.

    First check the infotype in which the Branch and Section are stored.
    if Employee Group & Subgroup are known as branch and section the u can find in PA0001
    PERSG
    PERSK
    There are lot of Standard Reports to Get this.
    U can goto Human resources--> Personal Management >Administrartion>Info Systems>Reports>Employee

  • Getting the Month value and Name from the Ranges of the Date given input.

    Hi Techies,
    I am developing Monthly wise report in FICO. My Inputs are Company Code, Fiscal Year and Date Range. From the Date Range I have to get the month and Generate the Report.
    For Ex:
    BUKRS : 1000
    GJAHR : 2009
    FKDAT : 01.04.2008 to 01.04.2009
    From the Above Date range how can I get the individual month names or periods. As per my Knowledge I can get the month value when the date is parameter but here the date is ranges.  Is any code available for this ?
    Thanks in Advance
    Regards,
    Muralikrishna Peravali.
    Edited by: muralipsharma on Aug 31, 2010 10:30 AM
    Edited by: muralipsharma on Aug 31, 2010 12:57 PM

    DATA: lv_dat          TYPE dats,
          lv_day          TYPE c LENGTH 2,
          lv_month        TYPE c LENGTH 2,
          lv_year         TYPE c LENGTH 4.
    DATA: lv_poper        TYPE t009b-poper.
    DATA: lt_poper        TYPE TABLE OF t009b-poper.
    SELECT-OPTIONS: so_dat        FOR sy-datum.
    break fis-kemmer.
    lv_dat = so_dat-low.
    DO.
      CLEAR: lv_poper.
      CALL FUNCTION 'FI_PERIOD_DETERMINE'
        EXPORTING
          i_budat        = lv_dat
        IMPORTING
          e_poper        = lv_poper
        EXCEPTIONS
          fiscal_year    = 1
          period         = 2
          period_version = 3
          posting_period = 4
          special_period = 5
          version        = 6
          posting_date   = 7
          OTHERS         = 8.
      APPEND lv_poper TO lt_poper.
      lv_day    = lv_dat+6(2).
      lv_month  = lv_dat+4(2).
      lv_year   = lv_dat(4).
      lv_month = lv_month + 1.
      IF lv_month LE 9.
        CONCATENATE '0' lv_month INTO lv_month.
      ENDIF.
      CONCATENATE lv_year lv_month lv_day INTO lv_dat.
      IF lv_dat GT so_dat-high.
        EXIT.
      ENDIF.
    ENDDO.
    after that you have a list of all the FI periods in internal table LT_POPER.
    get the idea?

  • How to get values and not index in case of SOC?

    I have created a SOC and i need the values in the bean on valuechange event which are present in the dropdown(i.e 20,50,100). But in this case instead of value me getting the index value(i.e 0,1,2)
    How can i get the values and not the index value.
    Query which returns the value is as follow:
    SELECT Id,CODE FROM table_name WHERE TYPE = 'ROWS' AND NVL(DISABLED_FLAG,'N') !='Y' ORDER BY TO_NUMBER(CODE)
    <af:selectOneChoice value="#{bindings.Row.inputValue}"
    label="#{uiBundle.ROWS}"
    required="#{bindings.Row.hints.mandatory}"
    shortDesc="#{bindings.Row.hints.tooltip}"
    id="soc5" autoSubmit="true"
    valueChangeListener="#{pageFlowScope.Bean.rangeChanged}"
    binding="#{pageFlowScope.Bean.row}">
    <f:selectItems value="#{bindings.Row.items}" id="si5"/>
    </af:selectOneChoice>
    Thanks in advance.

    See if it helps:
    http://mjabr.wordpress.com/2011/03/19/reading-the-selected-value-of-a-select-list-in-java/

  • How to get a server name through the load balancer

    Hi.
    I'd like to get the server name where is my application installed. There are some servers and clients access there throuth the load balancer. When I try to get it with request.getServerName(), I get the virtual address of the load balancer.
    Any suggestions?
    Thanks.

    Dear Sikindar;
    THanks for your cooperation, but I believe that these Tcodes will eb helpful if I know the table name, actually we don't know its name and that's what I'm asking about, how can I get the table name for the ABAPer?
    Appreciating your cooperation.
    Best Regards;
    Lobna

  • How to get ther servlet name from the Httprequest / servletContext

    Hi,
    How can I get the servlet name from the Http Request / Servlet conext?
    Arthik

    I have a requirement to call the business logic either in local server / external server.
    Local / External server
    The original / main request is made to the server from the client and from the server if the main request requires some resource (second request from server side) available in the external server then I need to make a URL connection. If the requested resource is the local resource then I need to by-pass the HTTP call. So I need to verify the server name , port with the originally requested server.Then I need to check if the request servelt is available in local or not.
    Can you please help me.

  • How to get Date and time of the server?

    Hi, How can we get the date and time of the server while submitting a form using JSP? i.e I need the date and time , when the user is submittig a registration.
    Uma

    Upon receiving your data in your servlet, you can do the following to get the date,
    Calendar calendar = Calendar.getInstance();
    int dd = calendar.get(Calendar.DAY_OF_MONTH);
    int mm = calendar.get(Calendar.MONTH) + 1;
    int yyyy = calendar.get(Calendar.YEAR);
    String dd_mm_yyyy = dd + "/" + mm + "/" + yyyy;
    To get the time, simply take a look at the Calendar API to get the corresponding field.

  • How to get value by jstl?

    select IEPort,seqNo,IEDate,trafMode from TImport
    this is in hibernate hql
    List queryResult = dao.getList(session, form);so in the list is not a bean but an Object, so in the Object do not hava attribute name, i don't know how to get value by JSTL in the jsp, who can help me

    JSTL can figure out what the specific type of the Object is on its own. Just reference the attributes of your bean using the expression language like you would normally do. If you are uncertain print out the classname of the objects in the list like this:
    ${obj.class.name}where obj is an object from the list. This should print out the name of your beans if hibernate did its job properly. JSTL will know what properties these objects has even if you only pass it an Object reference.

  • How to get customer number and name from the SD document

    Hi All,
    Can you please let me know how to get Customer Number and Name from the SD Document?
    Thanks a lot....
    Anil

    Hi,
    It will be displayed in the SD (BIlling document) itself,  you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
    regards,
    radhika
    Edited by: kolipara radhika on Jul 10, 2009 5:32 AM

  • How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amo

    How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0

    Hi,
    Is your formula attached to basic salary element or some other element? You need to make sure that basic salary element has some value and is processed before this formula is called. Are you able to see value for basic salary element after payroll run?
    Regards,
    Pawan

  • Fully Qualified Domain Names (FQDN) error - How to get domain and extension

    I have created a Web Dynpro ABAP application. On executing it, I get Fully Qualified Domain Names (FQDN) error. I have host name of my server.
    I do not know domain name and extension name of my server. How can I detect it?
    I want to know in  Windows XP and Windows 7.
    Please help me asap.

    Hello,
    Right click on the my computer and click properties and then go to the tab computer name .
    there you will have full computer name and this should have your host name as well as the domain name.
    to check the domain name click on change a new popup will open ther domain will be metntioned.
    IF nothing is ther in the domain then add just .(dot) at the end of the computer name .
    and save it and then put the same name in the  ICM/host_name_full parameter in rz11 and try .
    thanks
    sarbjeet
    Edited by: sarbjeet  singh on Jan 23, 2011 10:26 AM

  • Although my ipod shows the number of steps, calories, and time, it no longer is saving it to the history. also when I open the history it takes me to May 2010 instead of the current date. Any ideas on how to get it to start recording the history again?

    Although my ipod shows the number of steps, calories, and time, it no longer is saving it to the history. Also when I open the history it takes me to May 2010 instead of the current date. Any ideas on how to get it to start recording the history again?

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable                     
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar
    The missing apps could have been done by setting the Restrictions that can hid those apps. If the backup was made with those retrictions set the the Restrictions are also restored.
    Thus, if you get it to work restore to factory settings/new iPod, not from backup                               
    You can redownload most iTunes purchases by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I just need to know how you get an iTunes library off the original hard drive of a mac and onto an external hard drive and still have it work normally?

    I just need to know how you get an iTunes library off the original hard drive of an imac and onto an external hard drive and still have it work as it normally would?

    http://support.apple.com/kb/HT1449

  • My dad has itunes on his PC. I don't have my own but I recently have an iPad mini and an iPod. I don't know how to get songs onto itunes on the PC, using a different account or at least private/ separate..

    My dad has itunes on his PC. I don't have my own but I recently have an iPad mini and an iPod. I don't know how to get songs onto itunes on the PC, using a different account or at least private/ separate..
    So how do I create a separate I tunes on a PC which already has itunes... Or if not can I plug my iPad to the PC and use itunes on my iPad, and drag mp3s from a computer.
    I'm not sure what the equivalent of a desktop is on the iPad.. And I don't actually know how to use the icloud either...
    Can anyone start me off, given it have a iPad and use of a PC - not mine with existing iplayer
    I do have spotify soundcloud so I could potentially use these.. If there is a route of getting either mp3's etc to end up on my iPad or iPod.
    Kind Regards

    iTunes 11
    If you  have iTunes 11 turn on the Sidebar.  Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar. The sidebar is where Devices appears. and Control+B to show the Menu bar
    To import music into your iTunes library on the computer go to iTunes>Help>iTunes Help>Add items to iTunes and follow the instructions
    To sync to your iPod go to iTunes>Help>iTunes Help>Sync your iPod....>Sync You Device and follow the instructions.

Maybe you are looking for

  • Best Buy Return Policy for Cell Phones

    I bought an LG G Flex on 1 July. I rooted it when I got home. A couple of days later, I found out that I would have to unroot it in order to get the KitKat update, so I returned it to stock condition and tried to get the update. It booted into Jellyb

  • How to change the text Transport id code in sus

    Hi, How to change the text Transport id code in sus while creating ASN Please advise. Regards, manu

  • Copy Files From Web

    What would be the best way to copy a file from the Web onto a user's hard drive? sh

  • Issues while upgrading from 9.2.0.6.0 to 10.2.0.4

    Hi Team, I am performing a db upgrade for 11i EBS aplplication. https://support.us.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=1135973.1. I am running the dbua. and am into 7% into it. I am getting Error " insufficient priveleges". I tried

  • Premiere freezes when generating peak file

    Hi, Anyone know who to solve this? I started a project in FCP 7 on a mac, exported an XML and imported it into a Win 7 64bit machine running PPro 5.03 to finish the edit. All media loads (about 500 files) but while generating the peak files eventuall