How to create a generic SP for this requirment

Hi all,
i have a requirment like .....i have 10 sp's (sp1,sp2,sp3.....sp10) in a package named as 'generic_pkg'.
procedure sp1 (abc IN varchar2,
parameter IN varchar2,
sp_out1 OUT varchar2);
procedure sp2 (xyz IN varchar2,
parameter IN varchar2,
sp_out1 OUT varchar2,
sp_out2 OUT varchar2);
procedure sp3 (pqr IN varchar2,
parameter IN varchar2,
sp_out1 OUT varchar2,
sp_out2 OUT varchar2,
sp_out3 OUT varchar2);
procedure sp10 (pqr IN varchar2,
parameter IN varchar2,
sp_out1 OUT varchar2,
sp_out2 OUT varchar2,
sp_out3 OUT varchar2,
sp_out4 OUT varchar2,
sp_out5 OUT varchar2,
sp_out6 OUT varchar2,
sp_out7 OUT varchar2,
sp_out8 OUT varchar2,
sp_out9 OUT varchar2,
sp_out10 OUT varchar2);
now i want to create a new SP. the new sp is having input parameters as
procedure new_sp (sp_name IN varchar2,
parameter IN varchar2,
sp_output OUT varchar2);
now i will get sp name as input parameter and i have to check whether that sp is there on generic_pkg package or not.
if sp found , then i have to call that sp and have to return output.
the new_sp should be generic(i.e the new_sp should compatable to call any sp in the package 'generic_pkg'). my doubt is all the 10 sp's are having same inputs, but different no of outputs. How can i make new_sp as a generic sp?
procedure new_sp (sp_name IN varchar2,
parameter IN varchar2,
sp_output OUT varchar2); ---- ? how to handle?
please anybody can guid me with example....
thanks in advance.....
Edited by: user9041629 on Sep 7, 2010 6:01 AM

Your 'requirement' of being able to submit a procedure name as parameter will result in using dynamic SQL all over the place.
Consequently you violate the very reason why PL/SQL was invented: to diminish parsing
I pray you don't have any customers who are going to buy this 'product'. They are not to be envied.
I pray also you have a good lawyer.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • How should i write a pcr for this requirement?

    Dear Friends,
           Can any tell me whether we can write a pcr in such a way that if the person resigns the company on any day after 15th his full absence quota(for that month) should be accrued.
          if yes can you tell me  
          what are the key decision parameters i have to use in writing the pcr.
            waiting for you kind reply.
    Regards,
    Sai Prasad.

    Hai Prasad,
    I can give you the logic, cannot write exact rules.
    While genegarting absence quota
    - Check for termination action using OUTWPMASSN
        - If yes
              Check for Action year current year. (HRS=YSAY, HRS?CURYR)
                  - If its equal to 0
                      Check for current month (HRS=YSAO, HRS?CURMO)
                           - if its equal to 0
                                  check for current day (HRS=YSAA, HRS?CURDY
                                        - if its >=15
                                             generate quota
                           - Exit
    (Note: for this logic you have to generate monthly quota)
    With regards
    Shyam V

  • How to use time series functions for this requirement

    we are on OBIEE 11g (11.1.1.5)
    Any pointers and links are really helpful.
    I have a requirement where YTD sales are displayed in a column. We wan to compare that number to what that number was last year at the same time. Tried to use TODATE, AGO and it did not work.
    || used for column seperation below.
    ProductGroup || YTD Sales Rev||YTD Sales Rev 1 Year Ago||YTD Sales Rev 2 Years Ago
    Climate Solutions || 1.7 mil (1/1/2011 - 7/1/2011) || 1.45 mil (1/1/2010 - 7/1/2010) || 1.15 mil (1/1/2009 - 7/1/2009)
    Thanks in advance
    kris
    Edited by: user566193 on Aug 10, 2011 6:06 PM

    Kris,
    Basically you want to combine the 2 time series functions here i.e. TODATE & AGO.
    Here you go..
    You can create first a YTD logical column in BMM say YTD Sales Rev..Then create another logical column with calculation as AGO(YTD Sales Rev, YEARDIM, 1) or AGO(YTD Sales Rev, MONTHDIM, 12).
    Similarly, you create other measures...OBIEE 11g has time series function in Answers as well but I'd say try to create using RPD as you to calculate 1 logical column based on another. Better to push it on RPD side.
    Hope this helps

  • How to write optimized select statements for this requirement

    I.     G/L Account No. Info: Get all the list of G/L Account no. , company code and the corresponding long description from SKB1 & SKAT tables based on the G/L Account no. and company code values entered in the selection screen.
    II.     No. of transactions posted: For each of the Company code & Posting date or fiscal year/ period combination, select all document numbers from BKPF table into an internal table. For each of the company code, GL Account no combination find out no. of distinct records in the BSEG table (or combination of BSIK, BSAK, BSID, BSAD, BSIS & BSAS tables) to get the No. of transactions posted.
    III.     For Last posting FY/period: for each G/L account, Company code combination, determine the MAX (Doc. No) in BSEG, and look up the corresponding document in BKPF table to get the last posting FY/Period.
    Thanks,
    Prakash.

    I) with a query (sq01/2) and logical database SDF
    or standard abap RFSKVZ00
    II)a) select bkpf
       b) select count( * ) from bsik...
    III) a)select max( belnr ) from bseg...
         b) selec single monat from bkpf
    A.

  • How to create a special view for sharepoint list A and deploy this view to specific user personal view?

    How to create a public view for sharepoint list A and deploy this view to specific user personal view? Is that possible OOTB?

    Views cannot be exported or moved. Can you elaborate your requirement?
    --Cheers

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • How to create the generic extractors in sap R/3?,pabitra

    Hi,
         How to create the generic extractors in sap R/3?
    Though it comes under cross application and the types of generic extractors are functional module ,db view,infoset query etc.Do u think the g.e can be built of one of the is types.plz tell correctly
    Advance thanks
    regards
    pabitra

    Hi,
    this is for DB view ,
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
    this is for infoset query,
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/cb43b2455611d189710000e8322d00/frameset.htm
    Good day,
    regards
    Arun

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • How to create a daily report for sales order

    hi
    how to create a daily report for sales order. what fields it must consists of. what are the tables it need?

    Hi
    You have to use the sales order tables VBAK,VBAP and VBEP
    So keep date field on selection screen
    and treat this date as Order creation data audat field in VBAK.
    based on this fetch the data from VBAK and VBAP  with the following fields like
    VBELN, KUNNR,NETWR,POSNR, MATNR,ARKTX,KWMENG,WAERS  etc and display in the report
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to create different log files for each of web applications deployed in OC4J

    Hi All,
    I am using OC4J(from Oracle) v1.0.2.2 and Windows2000. Now I want to know
    1. how to create different log files for each of my deployed web applications ?
    2. what are the advantages in running multiple instances of oc4j and in what case we should run
    multiple instances of OC4J ?
    3. how to run OC4J as Windows2000 Service rather than Windows2000 Application ?
    Thanks and Regards,
    Kumar.

    Hi Avi,
    First of all I have given a first reading to log4j and I think there will some more easy way of logging debugging messages than log4j (If you could provide me a detailed explanation of a servlet,jsp,java bean that uses log4j and how to use log4j then it will be very helpful for me). The other easy ways (if I am not using log4j) to my problem i.e creating different log files for each of web applications deployed in oc4j are
    I have created multiple instances of OC4J that are configured to run on different ports and so on each instance I have deployed a single web application . And I started the 2 oc4j instances by transferring thier error/log messages to a file. And the other way is ..
    I have download from jakarta site a package called servhelper . This servhelper is a thread that is started in a startup servlet and stopped in the destroy method of that startup servlet. So this thread will automatically capture all the system.out.println's and will print those to a file. I believe that this thread program is synchronized. So in this method I need not run multiple instances of OC4J instead each deployed web application on single instance of oc4j uses the same thread program (ofcourse a copy of thread program is put in each of the deployed web applications directories) to log messages on to different log files.
    Can you comment on my above 2 approached to logging debugging messages and a compartive explanation to LOG4J and how to use LOG4J using a simple servlet, simple jsp is appreciated ...
    Thanks and Regards,
    Ravi.

  • How to create the Access sequence for the Vendor+material+plant combination

    Hi all
    Please let me know How to create the Access sequence for the Vendormaterialplant combination..
    Whats the use? What its effect in purhcase and taxe..
    brief me please

    Hi,
    you are asked to maintain the access sequence for the tax condition for which you are putting 7.5%.
    goto OBQ1 or img..financial accounting new...global settings.... taxes on sales and purchases ......basic settings.....
    find the tax condition type. see in it which access sequence is attached.
    if there is none then use JTAX used for taxes in India.
    or you can create the similar one for your.
    to create the same goto OBQ2.
    new entry or copy JTAX.
    and assign the access sequence to condition type.
    this will resolve your problem if you just need to assign the access sequence.
    regards,
    Adwait Bachuwar

  • How to create an inspection lot for each line item of the Purchase order?

    Hi,
    How to create an inspection lot for each line item of the Purchase order ?
    In detail if possible.

    Hi
       please check this
    [thread|Create Inspection Lot;

  • How to create a custom measure for each level of a dimension

    Hi all!
    Can Anyone please explain me with an example, how to create a custom measure for each level for a dimension? I dont mine if you use
    one or more measures.
    thanks in advance
    hope someone helps me.

    For example:I create a dimension for product_dim witch has 4 levels:total, class, family and item:
    d_aben18
    n1_aben18
    n2_aben18
    n3_aben18
    n4_aben18
    herarchy:h_aben18
    cube:cubo_aben18
    measure:med_aben18
    I create this code to fetch the data to the dimension:
    TRAP ON CLEANUP
    SQL DECLARE c1 CURSOR FOR SELECT-
    total_product_id,1,'N1_ABEN18',total_product_dsc,-
    class_id,1,'N2_ABEN18',total_product_id,class_dsc,-
    family_id,1,'N3_ABEN18', class_id, family_dsc,-
    item_id,1,'N4_ABEN18',family_id,item_dsc-
    FROM PRODUCT_DIM
    "OPEN THE CURSOR
    SQL OPEN c1
    "FETCH THE DATA
    SQL FETCH c1 LOOP INTO-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N1_aben18_LEVELDEF,:D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N2_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N3_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N4_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    "SAVE THE CHANGES
    UPDATE
    COMMIT
    CLEANUP:
    SQL CLOSE c1
    SHOW 'KK2'
    Then I create a cube with use compression off, and in rules sum for example.
    After, I create a measure and I select Override the aggregation specification for the cube, in rules I put nonadditive and I would like to create aprogram to assign distinct values to each level of the dimension. For example, I put 1, 2 3, and 4 values, but at the end I would like to put count(distinct(values)).
    for that I create another program:
    VRB D_RETURN DECIMAL
    if D_ABEN18_N1_ABEN18_LEVELDEF eq 'N1_ABEN18'
    then D_RETURN = 1
    if D_ABEN18_N2_ABEN18_LEVELDEF eq 'N2_ABEN18'
    then D_RETURN = 2
    if D_ABEN18_N3_ABEN18_LEVELDEF eq 'N3_ABEN18'
    then D_RETURN = 3
    if D_ABEN18_N4_ABEN18_LEVELDEF eq 'N4_ABEN18'
    then D_RETURN = 4
    else d_return=26
    return d_return
    "SHOW D_RETURN
    cubo_aben18_med_aben18_stored=d_return
    but it doesnt work.I dont know how to put to assign or to see what I want.
    I report the measure, or I report the program, but then how can I see the values of the measure?
    thanks in advance

  • How to create an Internal Customer  for Ineterplant stock Transfer

    Daer Gurus,
    Please tell me how to create an Internal Customer for Interplant stock transfer.
    Actually I have three plants out of them two plants are providing goods to third plant. Also both the plants do the stock transfer in eachother.
    How to maintain the Two plants as supplier and third one as a receiver plant. 
    which account group I should use and what details I have to use for it ?  Do I need to maintain all three plants under same account group? I know the theoratical process only for stock transfer please guide me on this Internal customer issue.
    thanks in advance
    regards,
    Sanjay

    Hi,
    Take your three plants as AAAA, BBBB and CCCC.... and these 3 plants may be assigned to the Sales Area of AAA 10 10, BBB 10 10 and CCC 10 10.
    Your STO will have following 4 flows.
    1. AAAA - CCCC
    2. AAAA - BBBB
    3. BBBB- CCCC
    4. BBBB- AAAA
    you need to do the following settings...
    1. Assign the Sales Area for the Shipping Plants... for ex (AAAA - AAA 10 10 and BBBB - BBB 10 10)
    2. You need to Create a Internal Customer for every Rec. Plant and need to assign the same to the Rec Plant. And Also note that this customer needs to be created in the Sales Area which is assigned in the Shipping Plant.
    (Note that CCCC will be Rec Plant from Both AAAA and BBBB... So you need to extend that customer for both the Sales Area of the plants AAAA and BBBB)
    Following is the example settings required for our scenario 1.
    AAAA will be a supplying plant and CCCC will be rec. plant....  for this you need to create a internal Customer (for ex C1000) in Sales area AAA 10 10 (which is assigned to the plant AAAA) and assign the Customer number (C1000) to Plant CCCC.
    Now you created a plant CCCC as a customer in Sales Area AAA 10 10 (which is nothing but plant AAAA)...
    Also here you need assign the Sales Area AAA 10 10 to the Plant AAAA.
    Hope this will be useful to you.
    Thanks,
    Muthu

  • How to create a new field for Q3 - QM notification in Header and item level

    Dear All,
    l
               Sub: How to create a new field for Q3 - QM notification in Header and item level
    Ref. the link --> Quality Notification
    We want to create a new field in header level and item level.
    As per the thread the solution is given below.
    In the IMG Config: Quality Management -> Quality Notification -> Notification Types -> Define screen areas for notification types Then Choose 'Define screen areas' Then Click on 'New entries' button Now, select the relevant Notification Type and click in 'Enter'. Select the 'Iten Cases' register and remember to setup the Tabstrip Header, Icon, etc. Set the 'Tabstrip active' flag. Then Save.
    Quality Notification -> Notification Types -> Define screen areas for notification types
    WE ARE UNABLE TO FIND IN CUSTOMIZATION PATH --> DEFINE SCREEN AREAS FOR NOTIFICATION TYPES.
    Please help.
    Question No. 2 :
    THE REQUIREMENT IS GIVEN BELOW.
    We want to hide the field in Q3 - QM Notification
    In header --> Reference tab --> Item (sub heading) --> "DEFECT LOCATION" FIELD TO BE ELIMINATED (HIDE)
    Ref the link --> Quality notification
    The solutiion is given below.
    Hi Sami,
    We can hide the collumns using the Transaction OQM1 and Program Name SAPLIQS0.
    Lets say Defect location need to be hidden, the field TXTCDOT need to have the radio button HIDE.
    Hope this will suffice your requirement.
    Kindly ask me if you need any other details.
    Thanks & Regards,
    Srinivas.D
    Hi Sami,
    We can hide the collumns using the Transaction OQM1 and Program Name SAPLIQS0.
    Lets say Defect location need to be hidden, the field TXTCDOT need to have the radio button HIDE.
    Hope this will suffice your requirement.
    Kindly ask me if you need any other details.
    Thanks & Regards,
    Srinivas.D
    By double clicking the "DEFECTIVE QUANTITY (EXTERNAL), WE COULD NOT GET --> field TXTCDOT .
    Plese do the needful.
    We are using ECC6.0 Ehp3 and Ehp4.
    With Best Regards,
    Raghu Sharma

    Dear Pushpa,
    Transaction Code :SHD0 is working fine.
    Please accept my sincere thanks for your sharing your Knowledge.
    I am able to fulfill my
    Regarding the enhancement, I have not tried.
    Once I will complete, I will award the fulll marks to you.
    With Best Regards,
    Raghu Sharma

Maybe you are looking for

  • FF67-Business Area Automatic Derivation

    Dear Experts, We have activated Business Area wise balance sheet. Kindly let me know if  there is any possibilities of deriving Business Area automatically in FF67 from the Payment Document no entered in "Bank Reference. Thanks !

  • Tape-Op 100 quotes from past 100 issues related to recording/mixing/engineering

    Tape-Op the creative recording magazine  (free) For their 100th issue Tape-Op offers 100 quotes from guests they've interviewed. http://tapeop.com/articles/100/100-issues-100-quotes/ I have nothing to do with the magazine, just a public service annou

  • Reason to set MaxErrorCount along with Propogate value for Excel Files

    Hi, I had an ETL earlier which processed CSV files from a folder. The requirement was to load the error files into a Rejected folder but continue to process all the files from the source Folder. This requirement was satisfied by setting the value of 

  • Error Cancelling Release of Basic Type

    Hi, Im using WE30 to make changes to a BASIC type. So in the menu EDIT->Cancel Release an error prompted these messages: The release of the basis types cannot be reset Message no. EA506 Diagnosis The release can only be reset if the basis type has be

  • IPod Nano 6th gen. Not "properly identified" by iTunes since 11.3 update

    Running Windows 8 Worked properly prior to update receive error :""An iPod has been detected, but it could not be identified properly. Please disconnect and reconnect the iPod, then try again." Have followed Apple recommended support page regarding t