Pl sql procedure to retrieve user details based on the input

hi,
I am looking for an example which will retrieve the data based on what he requests. I mean: the user types in an request_name, the procedure will check if the request_name already exists. If yes, then it will retrieve the request_name and other columns from the table R. Else it will create a new request by adding request_name and other details to the table.
hope this is clear some1 could help me
thanks

If defaults are set for the request table fields and you can get by inserting only the request_name field, perhaps something like the below would work?
T_REQUEST is the table, REQUEST_NAME is the field you mentioned. If the function finds the record, it returns it as a record. If it doesn't, it inserts a blank record with REQUEST_NAME populated:
CREATE OR REPLACE FUNCTION REQUEST_LOOKUP
( V_REQUEST_NAME IN T_REQUEST.REQUEST_NAME%TYPE )
RETURN T_REQUEST%ROWTYPE
AS
    R_REQUEST T_REQUEST%ROWTYPE;
    CURSOR C_REQUEST IS
        SELECT *
        FROM T_REQUEST
     WHERE REQUEST_NAME = V_REQUEST_NAME;
BEGIN
    OPEN C_REQUEST;
        IF C_REQUEST%NOTFOUND
        THEN
            INSERT INTO T_REQUEST (REQUEST_NAME)
            VALUES (V_REQUEST_NAME);
     ELSE
            FETCH C_REQUEST INTO R_REQUEST;
            RETURN R_REQUEST;
     END IF;
    CLOSE C_REQUEST;
END REQUEST_LOOKUP;

Similar Messages

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • Reading user input from a form within a workflow and perform actions in workflow based on the input

    Sharepoint 2013
    Need to get input from a user based on some condition within a workflow and based on the input received continue with the workflow. It can be a form with a text box and button to which i can redirect and when user enters a value and clicks on the button
    ,I should come back to the workflow and perform other processing. I should also be able to manually start this workflow from VS.
    Tried different approaches like initiation forms ,user input action of SP2010 etc all of these approaches either add some tasks to task list or force me to click on the workflow link to get input from a user.
    Any suggestions on this?

    Hello
    Thanks for the code, but I don't need an array of beans. By the way this code make a bean and an arraylist everytime it's called?
    I was looking for something like this:
    <form action="myjsp.jsp" method="post">
    ...so after submitting the result will go to the myjsp.jsp file and in the myjsp.jsp file
    <jsp:useBean id="value" class"myBean">
    <jsp:setpropertiy name"value" ....>so everytime I click the add button the values will go the mysjp.jsp file and that will set them in the javabean file. this method uses two files but I was looking for doing this in the same jsp file and not sending it to another file.
    chers
    Ehsan

  • Master Recipe details\ Inspection details based on the ECR number

    HI All,
    Could you please help me in finding one FM which gives Master Recipe details\ Inspection details based on the ECR number which is created in CC31.
    In the Transaction CC31 for a given Change Number,  there is a Master Recipe and Inspection in the Objects button -> Task list . We need Master Recipe and Inspection details associated with that particular change number.
    Awaiting your response
    Thanks,
    Chetan

    HI,
    Check this FM MRTRS300_MASTER_RECIPE_READ

  • Return the user detail after validate the SSO token

    Hi all ,
    Iam new to Oracle CRM on demand. I want to know is there a way to get user details when validating the SSO token. After SSO validation success then need to return the user detail (User first name, email, last name, etc ).
    Please help me

    Hi Vikas,
    I have done the same setup as your sample application. I am using
    <br>
    Branch URL : <br>
    f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.::::::#&P1_ANCHOR.
    <br>
    Computation for P1_ANCHOR:<br>
    case :REQUEST
    WHEN 'P1_A_SCN' THEN 'P1_A_SCN'
    ELSE NULL
    end
    <br>
    Anchor Code in region header for item P1_A_SCN:<br>
    < a name="P1_A_SCN">< /a >
    <br>
    When I use the select list it wont come back to the region where the select list P1_A_SCN is located. I checked for the value in P1_ANCHOR in the session state and it correctly shows as 'P1_A_SCN'. But the page URL after the submit does <b>not</b> show the anchor like<br>
    ......f?p=206:1:14418154115565883485::::::#P1_A_SCN it shows <br>
    ......f?p=206:1:14418154115565883485::::::
    <br>
    When I but the branch URL as <br>
    f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.::::::&P1_ANCHOR. without the '#' it shows the page URL as<br>
    ......f?p=206:1:14418154115565883485::::P1_A_SCN
    <br>
    Do you what is causing the anchor to not show up in the page URL and thereby the intra page branch to not work.
    Thanks,
    Swaroop

  • Search Fields value based on the input.

    Hi Experts,
    I was trying to develop a web dynpro with two  input-fields and process the logic based on the input-fields.
    The scenario is,have two Input fields, the value for the first input-field a static search help is assigned and for the second input-field the value are populated on the based of the values selected in the first input-fields.
    so here the values for second input-field depends on the first input-field.
    Please put in your thoughts or suggestion for the scenario.
    Thanks
    Best Regards,
    Lalitkumar.
    Moderator message: wrong forum, please post again in Webdynpro forum.
    Edited by: Thomas Zloch on Jul 9, 2010 1:36 PM

    Please refer the following for achieving the same.
    http://wiki.sdn.sap.com/wiki/display/Snippets/OVSsearchhelp

  • Dynamic structure creating based on the input parameter

    Hi all,
                 How to create a dynamic structure based on the input parameter given in the selection screen. I have a file path given and it contains three fields in common, but after that depending upon the input given the fields get changed. For example, i have 0002 infotype given in the selection screen, my file path structure should contain pernr begda endda and PS0002 structure, if the infotype is changed the PS structure has to be changed dynamcially.
    Thank you,
    Usha.

    Ans

  • Identiying the Profiles based on the input of Info provider

    Hi BW Experts,
    Right now i know the Info Provider Name.I just want to identify the profile name based on the input of Info Provider.
    Can you suggest me any TCODES for identiying the profiles.
    Thanks,
    Jelina.

    Hi,
    I'm explainning below the steps I usually take.
    You'll need to:
    1) Access RSSTOBJDIR table.
    2) Fill INFOCUBE parameter with the infocube's technical name and the AKTPS one with 'X'.
    3) Get the authorization(s) object(s) - OBJECT column.
    4) Go to the AGR_1251 table.
    5) Fill OBJECT parameter with the value(s) of step 3.
    It will be returned a list with the required profiles to access the infocubes entered on step 2.
    Regards,
    Tiago.

  • Retrieving User details

    Hi,
    I am using the wwsec_api.person_info function passing in a user id to retrieve a portal users details. I am able to retrieve details such as first name, last name , email address. I need to get the 'Department' that the user is in but can't seem to retrieve this. An ideas on how to do this?
    Also within portal, if i edit a users details and put entries into telephone, department, first name etc and then look in the view wwsec_person, none of these details are recorded against the specific user. Is this normal?
    Any help would be appriecated.

    These are all stored within the LDAP. You can use dbms_ldap calls to retrieve them, or select from the ODS.DS_ATTRSTORE table directly where attname is the attribute you are looking for.

  • Retrieving user detail, group name for all users

    Hi,
    How can I retrieve User name, email, authentication, user group name
    for all users using SDK.
    It is possible to create this report in webi or CR?
    Thank you for reply,
    Gregor

    Use the following code to retrieve this information:
    IInfoObjects users = oInfoStore.query("select * from ci_systemobjects where si_kind='user'");
    for (int i=0; i<users.size(); i++)
             IUser user = (IUser)users.get(i);
             // user.getTitle(); for user name
             // user.getFullName(); for user's full name
             //  user.getEmailAddress(); for user's email address
             //  for authentication type:
             IUserAliases alises = user.getAliases();
             for(int j=0; j<aliases.size();j++)
                       IUserAlias alias = alises.get(j);
                       // alias.getAuthentication() for authentication associated with this alias, since same user can have more than 1 authentication. e.g. Enterprise and Ldap.
             // for user group memberships:
             java.util.Set groups = user.getGroups();        
             // the groups Set object will contain SI_ID of all the user groups that this uses is member of. You need to query by the SI_ID of the usergroup to get the group names.
    //  e.g.
    //    oInfoStore.query("select si_id, si_name from ci_systemobjects where si_kind='usergroup' and si_id in (a,b,c....)");
    where a,b,c are the SI_IDs of the usergroups.
    To create a report based on the above fetched data, there are several methods such as:
    you can use Java resultset where in you create the report structure in designer and push the data at runtime using java result set objects. Another way is to push this info in Excel or Access and design your report based on that excel\access.

  • Restrict Org details based on the User in Business partner creation..

    Hi Gurus,.
    I have to assign Sales Org , DIV, Distribution Channel to the Business Partner in Sales Area data.  When I try system shows entire Org structure. But I want the Org structure should be displayed based on the user log on. Assume that, I am assigned to Shangai and creating Business partner for Shangai, the system should not show Beijing or other Org Unit since I belong to Shangai.  How to address this scenario thro standard customization?
    Is it common problem in CRM Webui(6.0 and 7.0).
    My Org Structure:
    Global
      China
         Shangai
         Beijing
       Nanjing.
    Thanks in Advance....

    Hi Denis,
       Thanks for your reply. I believe Org determination rule is applicable for Transaction types not for Account Creation. I want to get Sales area data based on login user. It shows complete Sales Area(Sales Org IDDistribution ChannelDivision) when I create an Account.. Assume that you are an employee and assigned to Newyork, when you create New Customer in Newyork, system should not show Boston, Washington Sales areas...Please throw some light on this...
    Thanks in Advance.,

  • Not able to Retrieve Transaction Data based on the property of master data

    Hi,
    I am trying to retrieve transaction data based on property of Master Data for ACCOUNT (property  ACCTYPE = ‘EXP’)
    in BPC 10 version for netweaver.
    Transaction data is present at backend, But I am not getting data in Internal table after running RSDRI Query.
    I am using this code.
    DATA: lt_sel TYPE uj0_t_sel,
    ls_sel TYPE uj0_s_sel.
    ls_sel-dimension = 'ACCOUNT'.
    ls_sel-attribute = 'ACCTYPE'.
    ls_sel-sign = 'I'.
    ls_sel-option = 'EQ'.
    ls_sel-low = 'EXP'.
    APPEND ls_sel TO lt_sel.
    lo_query = cl_ujo_query_factory=>get_query_adapter(
    i_appset_id = lv_environment_id
    i_appl_id = lv_application_id ).
    lo_query->run_rsdri_query(
    EXPORTING
    it_dim_name = lt_dim_list " BPC: Dimension List
    it_range = lt_sel" BPC: Selection condition
    if_check_security = ABAP_FALSE " BPC: Generic indicator
        IMPORTING
    et_data = <lt_query_result>
        et_message = lt_message
    Data is coming if i use ID of ACCOUNT directly, for e.g.
    ls_sel-dimension = 'ACCOUNT'.
    ls_sel-attribute = 'ID'.
    ls_sel-sign = 'I'.
    ls_sel-option = 'EQ'.
    ls_sel-low = 'PL110.
    APPEND ls_sel TO lt_sel.
    so in this case data is coming , but it is not coming for property.
    So Please can you help me on this.
    Thanks,
    Rishi

    Hi Rishi,
    There are 2 steps you need to do,.
    1. read all the master data with the property you required into a internal table.  in your case use ACCTYPE' = EXP
    2. read transaction data with the masterdata you just selected.
    Then you will get all your results.
    Andy

  • How to use pl/sql procedure or function as part of validate the entity obj?

    Hi,
    we are migrating from oracle forms to jdeveloper 11g.
    I have a req. that,i wanted to use oracle pl/sql procedure to validate a attribute in an entity created with ADF BC?
    Is it possible to implement this?
    And how to show the error message from pl/sql procedure?
    Regards
    Murali.

    Hi,
    It is possible by using a method validator for the entity attribute.
    Create a transient attribute 'X'.
    In the validation section of the attribute to be validate, choose method validator.
    In the Error Message tab set error message as {0}.
    Below the value for tokentoken should source.X (X is the transient attribute name)
    In the java code of method validator, call the stored procedure and set the value of transient attribute X with the error message from SP.
    Use setX("ErrorMessage").
    Regards,
    Srinidhi

  • Breakdown details based on the cause, damage on equipemnts

    Dear all
    We have one requirements with users. Presently we have the Breakdown analysis report, there we can see the equipment, date, object, damage, activities, downtime hours in text.
    For this presently the Input is equipment or planner group, work center , date .
    But users want objects, damage, cause will be input according to this they wants to collect the data like
    equipment, date, object, damage, activities, downtime hours in ouput.
    Please have some idea

    Hi,
    You need to define customised info structure for this.Then you need to pull together all these  objects, damage, cause as characteristics into same field catalog.This will be Z field catalog and with this you need to define your customised info structure.This will append existing communication structure for reporting and used for report data updation in customised info structure.After this you need to define updating definitions to update info structure regularly.
    at last you need to do statistical data set up for old data then normal data updation will happen.This is how standard SAP reports work.
    Regds,
    atul

  • Output list based on the input at selection screen by checkbox

    i have three fields  in the selection screen .each  one has  a checkbox and by default every checkbox is unchecked .based on the user's selection the output list will display the results.if he had selected two fields  the list will show him values pertaining to those fields.
    plz  revert back with the solution.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

    Check the below program :
    REPORT ZSAI1.
    parameters: p_check as checkbox default 'X',
                 p_check1 as checkbox default 'X',
    p_check2 as checkbox default 'X'.
    start-of-selection.
    if p_check = 'X'.
    write:/ 'First check box selected'.
    endif.
    if p_check1 = 'X'.
    write:/ 'Second check box selected'.
    endif.
    if p_check2 = 'X'.
    write:/ 'Third check box selected'.
    endif.
    Thanks
    Seshu

Maybe you are looking for

  • Intel/nVidia troubles for Razer Blade 14

    Hi, I've been trying to setup the switchable graphics for the Razer Blade 14 (nVidia 765M) but no luck. I've been reading several posts but still no dice. I'm using nvidia, bbswitch, linux-ck and bumblebee. nvidia-config was saved at /etc/bumblebee/x

  • Missing plugin message in all browsers

    Hello, Has anybody else encountered this?  Today when using Chrome all of a sudden instead of videos I got a message that says missing plugin.  Of course, Chrome claims that Adobe is automatic.  I tried both IE and Firefox, and they both said I neede

  • Too much security

    Have four computers I maintain, all running 10.4.9. There seems to be too much security on a couple of them (I guess actually within the user account), but I can't put my finger on the specific thing that's causing this issue. Example – when a file i

  • Using wildcard certificate

    hi, I have a wildcard certificate, *.contoso.com, with no SAN description. I use this certificate for all web server. It's possibile to use this certificate for connect mobile users to lync 2013? Thanks Bruno Bruno Ausiello

  • Gratuitous advice from a hurting user:

    Hi all -- if you're here, you've likely been poking around through various pieces of advice and tips. I want to add, explicitly, the following: ***NEVER, EVER format a hard drive without FIRST UNPLUGGING EVERY SINGLE OTHER DEVICE you are not using at