Custom Sentry Function

All,
Is there any documentation on writing custom sentry functions? I've been able to find some miscellaneous blog entries, but nothing definitive.
Thanks,
-David

Tyson,
I don't think authorization's the right line of thought, in this case.
Let me explain what I'm trying to do: I've set up our APEX applications to use a common authentication procedure (all applications redirect to a central "launchpad" application for authentication). However, some of our applications need the user to be authenticated against Oracle EBS (for authorization, populating the who columns, etc.), while others need the user authenticated against LDAP (since everyone has an LDAP account, but not necessarily an EBS one). I've built a table which maps applications to the necessary authentication method, and the custom authentication process looks at the FSP_AFTER_LOGIN_URL variable to figure out which application the user is trying to get to, authenticating appropriately. This all works.
However, if a user logs in to an EBS application and then tries to access an LDAP application, they're not currently forced to re-authenticate, as APEX doesn't know that they need to. (Remember, both applications use the launchpad's authentication, which sets a common cookie for all applications.) This is extremely problematic, for obvious reasons. So, my thought was to set up a post-authentication process to store session ID's, APP_USER, and the authentication method used, and a page sentry process that checks to make sure that the current session ID, APP_USER, and required authentication method actually match.
I feel like I've almost got this working. Here're my two functions:
procedure after_authentication is
     l_session_id number;
     l_username varchar2(250);
     l_authentication_method number := 0;
begin
     l_session_id := apex_custom_auth.get_session_id_from_cookie;
     l_username := apex_custom_auth.get_username;
     -- Since this runs as part of the Launchpad, we need to check where we're
     -- going instead of where we are.
     if v('FSP_AFTER_LOGIN_URL') is not null then
          -- Wrap this in begin/end to suppress exceptions.
          declare
               l_url varchar2(250) := v('FSP_AFTER_LOGIN_URL');
               l_start number; l_end number;
               l_app_id number;
          begin
               l_start := instr(l_url,'=')+1;
               l_end := instr(l_url,'|');
               l_app_id := substr(l_url,l_start,l_end-l_start);
               select authentication_method_id into l_authentication_method
               from apex_app_auth_map am
               where am.application_id = l_app_id;
          exception
               when others then
                    l_authentication_method := 1;
          end;
     end if;
     insert into apex_session_tracking( session_id, last_login_date, authentication_method, app_user )
     values( l_session_id, sysdate, l_authentication_method, l_username );
end after_authentication;
-- Page sentry function to check if the used authentication method matches the current one.
function page_sentry( p_apex_user in varchar2 ) return boolean is
     l_session_id number;
     l_username varchar2(250);
     l_valid_session number := 0;
begin
     -- check to ensure that we are running as the correct database user 
     if user != upper(p_apex_user) then  
          return false;  
     end if; 
     l_session_id := apex_custom_auth.get_session_id_from_cookie;
     l_username := apex_custom_auth.get_username;
     select count(*) into l_valid_session
     from apex_session_tracking ast,
          apex_app_auth_map am
     where ast.session_id = l_session_id
          and am.application_id = apex_application.g_flow_id
          and upper(ast.app_user) = l_username
          and am.authentication_method_id = ast.authentication_method;
     if l_valid_session = 1 then
          return true;
     else
          delete from apex_session_tracking ast where ast.session_id = l_session_id;
          return false;
     end if;
end page_sentry;From what I've been able to figure out, this should work. But it's not; the sentry function seems to constantly kick the user back to the login screen. Through testing, it seems like the post-authentication process and the sentry process are getting different session ID's back from apex_custom_auth, which I don't understand. And neither ID matches the session ID in the URL, which has me even more confused.
I'm about ready to punt and just rely on the APP_USER value to identify records in the apex_session_tracking table, but that seems like it'd be inherently less secure. But I'm not seeing what I'm doing wrong, either.
-David

Similar Messages

  • Apex 4.1: Error processing session sentry function. ORA-01403

    Hi,
    I have developed an application in Apex 4.0. I've translated the application into one additional language, and set the language to be derived from the browser. On the 4.0 instance, this works as expected (changing the preferred language in the browser and reloading a page uses the translated app).
    I then deployed the main app and the translated app to an Apex 4.1 (runtime-only) instance. If I access the application with the browser set to the primary language (English), it works, but if I change it to the secondary language and reload the page, I get:
    Error processing session sentry function.
    ORA-01403: no data foundThis also happens if I try to access the translated application directly via the URL.
    (I'm not sure what "session sentry function" means; in my application I have a custom authentication scheme with a custom "authentication function", but I have not specified anything for "session verify function" -- which is close but not exactly the same as "session sentry function", so I am not sure if they are the same thing.)
    Anyway, as this works on Apex 4.0 and not on Apex 4.1, I wonder if it is a bug... ?
    - Morten
    http://ora-00001.blogspot.com

    Anyway, as this works on Apex 4.0 and not on Apex 4.1, I wonder if it is a bug... ?Pretty sure it's a bug.
    I looked at APEX_040100.WWV_FLOWS and noticed that the AUTHENTICATION_ID column was NULL for my translated application (app id 301), whereas the main application (app id 300) has a value in that column. (This appears to be a new column for Apex 4.1.)
    The export file for the translated app creates my custom authentication scheme:
    wwv_flow_api.create_auth_setup (
      p_id=> 1711018744328150.301 + wwv_flow_api.g_id_offset,So what I did to fix this was to run:
      update apex_040100.wwv_flows
      set authentication_id = 1711018744328150.301
      where id = 301;That solved the problem, although the question still remains: Why didn't this get set automatically when importing the translated app?
    - Morten
    http://ora-00001.blogspot.com

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi,
    I have created custom action for Share functionality in document library.
    On Share action i'm showing Model pop up with Share form with addition functionality.
    I am developing custom share functionality because there is some addition functionality related to this.
    How to Implement custom share functionality in SharePoint 2013  document Lib pro-grammatically?
    Regards,
    - Siddhehswar

    Hi Siddhehswar:
    I would suggest that you use the
    Ribbon. Because this is a flexible way for SharePoint. In my project experience, I always suggest my customers to use it. In the feature, if my customers have customization about permission then i can accomplish this as soon
    as possible. Simple put, I utilize this perfect mechanism to resolve our complex project requirement. Maybe we customize Upload/ Edit/ Modify/ Barcode/ Send mail etc... For example:
    We customize <Edit> Ribbon. As shown below.
    When user click <Edit Item>, the system will
    render customized pop up window.
    Will

  • Is it possible to throw a BPELFault from a custom xpath function?

    I'm probably revealing my lack of java chops here, but I'd like to know if there's a way to throw a BPELFault from the "call" method within a custom xpath function.
    The interface for IXPathFunction seems to dictate that "call" throws only an XPathFunctionException and the bpel server doesn't handle this exception properly. It records the exception in the logs but then the process just dies.
    Right now I have this (simplified code):
    public Object call(IXPathContext context,
    List args) throws XPathFunctionException
    if (args.size() == 1)
    // do some stuff and return a value
    throw new XPathFunctionException( "hexToInt() requires one string argument." );
    What I want to have is something like this:
    public Object call(IXPathContext context,
    List args) throws BPELFault
    if (args.size() == 1)
    // do some stuff and return a value
    BPELFault fault = new BPELFault(
    new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2003/03/business-process/",
    "selectionFailure"));
    fault.setPart("code", "intToHex");
    fault.setPart("summary", "hexToInt() requires one string argument.");
    throw fault;
    If I do this, the compiler rejects it saying that "call" must throw XPathFunctionException. Is there a way to extend the IXPathFunction interface to allow it to throw a useful fault?
    Thanks!
    Sean

    Yeah, I'm using that patch (otherwise the process just crashes and you don't have a chance to catch the fault, even in a catchAll). Within the catchAll you can get the details from the error with something like this:
    <copy>
    <from expression="concat(ora:getFaultName(),'')"/>
    <to variable="processFault" part="payload" query="/ns4:summary"/>
    </copy>
    <copy>
    <from expression="concat(ora:getFaultAsString(),'')"/>
    <to variable="processFault" part="payload" query="/ns4:detail"/>
    </copy>

  • How can I call a custom javascript function when clicking on cfgrid cell.

    I would like to call a custom javascript function when
    clicking on a cell in an cfgrid (of html format). The closest thing
    I can find is to use the HREF="" attribute, but it doesn't seem to
    work with javascript inside it.
    Simple example:
    <cfgridcolumn name="Foo" header="Foo"
    href="javascript:customFunction(#ID#);">
    Do I need to tap into the underlying Ext JS funtionality? If
    so, where can I start?
    Thanks!

    Hi,
    According to your post, my understanding is that you want to hide/show list columns based on specify the permission for Users, SharePoint Groups or Active Directory Groups.
    Here is a solution from CodePlex for your reference:
    SharePoint 2013 Column & View Permission
    https://sp2013columnpermission.codeplex.com/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Error while creating Custom Defined Functions in Essbase

    <p>Hi All,<br>I am trying to create CDF(Custom Defined Functions) in Essbase. Iwant to create a function which take list of child member andreturn the first child. For this, i have created a java file called"ChildAccess.java" which contains the following code:<br>public class ChildAccess<br>{<br>public static char GetFirstMember(char [] members)<br>{<br>return members[0];<br>}<br>}<br>I have compiled and made jar file called"ChildAccess.jar" and pasted it at"ARBORPATH/java/udf". Then i restarted the Essbase Serverand run the following MaxL command to register the function<br>create or replace function '@ChildAccess' as<br>'ChildAccess.GetFirstMember'<br>spec '@ChildAccess(memberRange)'<br>comment 'adds list of input members'.<br>Till here i am not getting any error but when i am using thisfunction in my calc script as given below<br><br>FIX(@ChildAccess(@CHILDREN("Abc")))<br><br>it gives the following error<br>"Error:1200414 Error parsing formula for [FIX STATEMENT]<br>(line 2)"argument[1] may not have size[6] in function[@CHILDREN]"<br>NOTE: The SIZE[6] is giving the no. of child in member"ABC".<br><br>Thanks in Advance<br>Arpit</p>

    If you want to use the CDF in a FIX statement you need to make sure that it returns a member name rather than a number:<BR><i><BR>public class ChildAccess<BR>{<BR>    public static String GetFirstMember(String[] members)<BR>    {<BR>        return members[0];<BR>    }<BR>}<BR></i><BR>I prefer to define the function against a specific application rather than globally because you only need to restart the application in order to pick-up any modifications to the .jar file. So the MaxL function definition would be:<BR><i><BR>    create or replace function appname.'@_GETFIRSTMEMBER' as<BR>        'ChildAccess.GetFirstMember(String[])';<BR></i><BR>and in the calculation script the FIX statement would become:<BR><i><BR>    fix ( @member( @_GetFirstMember( @name( @children( "Abc" ) ) ) ) )<BR></i><BR>This looks a little messy so you can use a macro to simplify it:<BR><i><BR>    create or replace macro appname.'@GETFIRSTMEMBER'(single) <BR>        as '@member( @_GETFIRSTMEMBER( @name( @@1 ) ) )' <BR>        SPEC "@GETFIRSTMEMBER(memberRange)";<BR></i><BR>and then the FIX statement could be written:<BR><i><BR>    fix( @getfirstmember( @children( "PRODUCT" ) ) )<BR></i>

  • Bpel Server Does Not Catch Exceptions Thrown By Custom Xpath Functions

    Hi.
    I am using some custom xpath functions in a bpel process and whenever they fail I get an XPathExecutionError with summary:
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "<my function>", the reason is FOTY0001: type error.
    Please verify the xpath query.
    I am forcing my function to fail by giving a wrong input, which should result in an XPathFunctionException("Input does not respect format").
    There is a note on Metalink with ID 458434.1 on this subject which says that patch 5926809 should fix my problem.
    Patch 5926809 fixes Bug 5926809 - ORA:PARSEESCAPEDXML XPATH EXPRESSION FAILED TO EXECUTE FOTY0001: TYPE ERROR.
    I am using it, but it does not work :(
    I am using version 10.1.3.3.0 of App Server with various patch sets, including fix for bug 5926809.
    Has anyone suggestions on how to overcome this problem?
    Thanks

    Hello,
    I am trying to add a custom xpath function to the BPEL server, and I see that you made it work. I am using Oracle SOA Suite 10.1.3.3 and jDeveloper 10.1.3.4. I am using this function inside an xsl mapping file, although I am able to compile and deploy the Bpel Process to the server, it stops mapping where I placed the function and I have not seen any meaningful message from the domain/log/ files.
    Can you tell me how you did it?
    I think you will tell me faster than Oracle support, I already placed an SR but they just give me superficial advice.
    I appretiate your time and advice,
    Guillermo

  • Custom XSLT Functions Throw Exception

    Hi,
    I have following requirement-
    1. I have defined and configured some custom XSLT functions in Jdev and BPEL, which throw exception in case of an error.
    2. Now I want to catch that exception in my BPEL process
    3. In My BPEL process I have defined transformation step ( which is using those Custom XSLT functions) in a scope and added a catch branch to that
    4. But even XSLT java function throw an exception , it is not being catch by catch branch.
    Could you please help me regarding this and tell me any other way to catch an exception in BPEL process thrown by Custom XSLT function within transformation step?
    Thanks.

    Hi,
    Its the problem with the date. In the configuration file i used dateTime for java.util.Date, because of this i cant see "User Defined" option in Jdeveloper component pallete. I checked at XML data types i had seen dateTime for java.util.Date Class, but its not working.
    Do anyone created a custom xslt function which has date as parameter or return type?, If so wht they had used as data type for xml and java.
    Thanks,
    RR

  • Including customized xquery functions in XQuery/XSLT expression Editor-OSB

    Hi,
    I have written a customized xquery function. I want this to be included in the List of Xquery Functions which is displayed by Oracle Service Bus in the XQuery/XSLT
    Expression Editor. OSB displays the built in xquery functions in the XSLT/Xquey Expression Editor. Is there any way to add the customised xquery to this list, so that it can be dragged and dropped later?
    Thanks,
    Balaji.

    I doubt if that is exposed out side of Oracle Engineering (Not public/documented). Please raise a support ticket for enhancement. If PM should concur you might get the steps that need to be performed for this feature.
    Thanks
    Manoj
    Edited by: Manoj Neelapu on Jun 8, 2010 8:37 AM

  • Custom XPath Function not working - ORABPEL-09503 error

    I wrote a simple date conversion custom xpath function.
    1. Implemented IXPathFunction as mentioned in Clemens and Antony Reynolds blog.
    2. Also changed the xpath-functions.xml kept at C:\product\10.1.3.1\OracleAS_1\bpel\system\config\xpath-functions.xml and also at C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\config\xpath-functions.xml (Not sure why this xml is in two places)
    3. Placed my class file at C:\product\10.1.3.1\OracleAS_1\bpel\system\classes and also made a jar and placed in C:\product\10.1.3.1\OracleAS_1\j2ee\home\applib.
    But when I run the process which uses this custom function, it is throwing the following error
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>ORABPEL-09503 Invalid xpath expression. Error while parsing xpath expression "o2c:formatDateString('10/30/2007', 'MM/DD/yyyy', 'YYYY-MM-DD');", the reason is Error in expression: 'o2c:formatDateString('10/30/2007', 'MM/DD/yyyy', 'YYYY-MM-DD');'.. Please verify the xpath query "o2c:formatDateString('10/30/2007', 'MM/DD/yyyy', 'YYYY-MM-DD');" which is defined in BPEL process. </faultstring>
    </Fault>
    Can somebody help me to resolve this.

    My bad. I had a semi-colon after the expression. Now I am getting a different error
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>ORABPEL-09500 XPath expression failed to execute. Error while processing xpath expression, the expression is "o2c:formatDateString('10/30/2007', 'MM/DD/YYYY', 'YYYY-MM-DD')", the reason is FOTY0001: type error. Please verify the xpath query. </faultstring>
    </Fault>

  • Error in Debugging a Custom Planning Function

    Hi All,
    I have a custom Planning function which is an ABAP code. I wanted to test the planning function and hence i set a breakpoint at the first line of the code. But when i execute the program RSPLS_PLSEQ_EXECUTE to debug my planning function, once i give the planning sequence and press F8, it gives an error instead of pointing to the breakpoint i set. Please help me out. Any pointers over this are greatly appreciated.
    Thanks
    Swaroop

    Hi Swaroop,
    take a look at RSPLS_PLSEQ_EXECUTE in transaction SE38. You will see the following line of code
    PERFORM execute_plseq  TABLES g_t_return USING seqnm variant.
    . Set a break-point here and execute the report. The debugger will stop at the above mentioned line. Press F6 to execute the statement and than double click on g_t_return. This table contains the messages. Please take a look at them. You can see the technical name of the message. To see them in a more readable format you can use transaction SE91.
    Regards Matthias Nutt
    SAP Consulting Switzerland

  • Error using custom xpath function with XSL transformations in BPM

    Hi,
    We have created a custom xpath function for use with SOA Suite and BPM. This has been built as per specified within the http://docs.oracle.com/cd/E29597_01/dev.1111/e10224/bp_appx_functs.htm#SOASE11100. We have also reviewed the Oracle Sample for mapper-107-ExtensionFunctions (sample demonstrates the use of user-defined extension functions). This has been registered with jDeveloper and SOA within the oracle.soa.ext_11.1.1 (run ant to include in oracle.soa.ext.jar)
    We ideally want to use this is BPM within an xsl. However when consuming this function is either BPEL or BPM using an xsl, the xsl fails with an error such as:
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/gwCustomXpathUtil_rev1.0/xsl/Transformation_1.xsl<Line 9, Column 113>: XML-22043: (Error) Extension function error: Method not found 'getWeekDayDate'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
    In an Assign it operates fine and returns the expected result. We have included a combination of both of the Config files (ext-mapper-xpath-functions-config.xml and ext-soa-xpath-functions-config.xml) in the META-INF folder, however neither allow the use of this function in the XSL.
    I believe there may be an issue getting the custom xpath functions within XSL files. Hence I have also raised an SR. Has anyone experiences of this?
    Our SOA / BPM suite environment is using 11.1.1.6.4 and has the following patches applied:
    13801175
    14406487 (11.1.1.6.4 SOA Bundle)
    13896993
    13088538
    Regards Dave
    Edited by: DavidGaskell on Mar 14, 2013 10:08 PM

    Hi All,
    I am also facing the same issue...Experts can you please help us.
    hi DavidGaskell, did you find any resolution, if so can you share it with me.....
    Thanks,
    RR

  • Customer for function SP may not have account group in sap

    Dear All,
    Not open the sales order and error show in SAP
    Customer for function SP may not have account group.

    In IMG > SD > Basic Function > Set up Partner Determination
    Check the assignment of Partner Function with the Account Group in Account Groups - Function Assignment.
    Best Regards,
    Ankur

  • Custome Partner Function from SD to CO-PA

    Hi,
    I have created 3 custom partner functions and have assinged in customer master. I need these 3 custom partner function to be transfered to CO-PA during billing. Is there a easy way around to achieve this, coz there are some SAP notes which are sort of confusing and complex, since we are already live in production, we cant take a chance on the SAP Note.
    If somebody experienced like this, could you please share the knowledge, how to achieve this.
    Thanks.
    With Regards
    gj

    Hi Gj,
    There are no simple way around to get the customer partner function in to CO-PA during billing. You must follow the notes to get the correct value transfered to CO-PA. I will outline the steps below so that you do not miss anything.
    I am going to try to summarize the basic steps to add one or
    more new partner function(s).  For more detailed information
    please see the notes 36557, 32878, 12682 and 93658 although some o
    these notes are known for you.
    Add new domain/data element for the new partner function in the
    ABAP/4 Data Dictionary.
      Examples are the data elements KUNAG, KUNWE, KUNRE, KUNRG,
      SPDNR, and VRTNR in structure MCPARTNER. This is where the
      partner functions for the Standard Sales Information System are
      defined.
    Save the new partner field in structure MCPARTUSR (user part of
      structure MCPARTNER) or, if available extend structure
      MCPARTUSR by an append structure (ZAMCPARTUS).
    Make sure that the check tables and foreign key relationships are
      maintained for the new fields in structure MCPARTUSR
    Define the assignment of partner function <  > new partner
      field in the communication structure.
      Program RMCSUZ10, routine USR_PARTNER_GET.
      Add the line as in the example of note 12682 given.
    Include the corresponding field via transaction 'KEA0' from the
      structure PAPARTNER into the Profitability Analysis data structures
    If your new partnerrole is a representative/sales employee please
      apply note 32878.
    Should you have implemented note 43002 (to prevent a field overflow
      in pricing) please follow note 93658 and use userexit
      userexit_pricing_prepare_tkomp instead of
      userexit_pricing_prepare_tkomk.
      userexit_pricing_prepare_tkomp is contained in Include MV45AFZZ
      (sales order) and RV60AFZZ (billing)
    Add the new field to the structure 'KOMPAZ' as in note 93658
      described and  NOT  to the structure 'KOMKAZ' (note 36557)
      (you have used both structures)
    Generate the operating concern and check if the following entries
      are included in TKEZU:
      Charact.  BTran Table      Field name  Offset  Length
      XXXXX     KEDR  KOMP      YYYYY
      XXXXX     KEDR  KOMP      YYYYY
      XXXXX     KEDR  KOMP      YYYYY
      XXXXX = Field name of the partner function in the  profitability
      analysis
      YYYYY = Field name of the partner function in structure KOMP
    (these entries should be made automatically here).
    If you need more than one partner function please repeat the
    steps as described above for your need.
    Regards,
    Abhisek

  • Custom aggregate function inside a package.

    Hi there,
    I'm trying to write a custom aggregate function and group that function inside a package together with some other functions that I have. As an example (to simulate the problem I have) suppose my custom aggregation to do a summation of numbers looks like:
    CREATE OR REPLACE TYPE SUM_AGGREGATOR_TYPE AS OBJECT (
    summation NUMBER,
    STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
    SUM_AGGREGATOR_TYPE) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
    next_number IN NUMBER) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
    para_context IN SUM_AGGREGATOR_TYPE) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
    return_value OUT NUMBER, flags IN NUMBER) RETURN NUMBER
    CREATE OR REPLACE TYPE BODY SUM_AGGREGATOR_TYPE IS
    STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
    SUM_AGGREGATOR_TYPE)
    RETURN NUMBER IS
    BEGIN
    agg_context := SUM_AGGREGATOR_TYPE(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
    next_number IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    IF self.summation IS NULL THEN
    self.summation := next_number;
    ELSIF summation IS NOT NULL THEN
    self.summation := self.summation + next_number;
    END IF;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
    para_context IN SUM_AGGREGATOR_TYPE)
    RETURN NUMBER IS
    BEGIN
    self.summation := self.summation + para_context.summation;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
    return_value OUT NUMBER, flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    return_value := self.summation;
    return ODCIConst.Success;
    END;
    END;
    If I write the following function definition:
    CREATE OR REPLACE FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
    and corresponding type declaration to test:
    CREATE OR REPLACE TYPE VECTOR
    IS
    TABLE OF NUMBER;
    this statement:
    select my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
    gives the correct result of 70. However, creating a package with the function definition:
    CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
    FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
    END;
    and calling it via:
    select MY_FUNCTIONS.my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
    explodes with:
    ORA-00600: internal error code, arguments: [17090], [], [], [], [], [], [], [], [], [], [], []
    Is it possible to have custom aggregate functions nested inside package declarations?
    I'm using Oracle 11g, Release 2 (11.2.0.1.0).

    HiddenName wrote:
    Is it possible to have custom aggregate functions nested inside package declarations?Yes, it is possible, you have succesfuly created your function. Your problem is that the database throws ORA-600 on execute. And with ORA-600 you can do 2 things: 1) google ORA-600 17090 or 2) contact your Oracle Support.
    You could also try to declare the function without PARALLEL_ENABLE - just to try to see if it changes anything. You can also try to call your function against a regular table with rows and columns - not against an collection type with table() operator.
    Anyway - these 2 tests should be usefull for Oracle Support.
    I never tried to put a custom aggregate function into a package. First - the cases when you need a custom aggregate function to be written for your system are very rare. Second - even if I needed 1 then I never needed 2 or more custom aggregate functions on my system. And as I do not like to make my life more complex than necessary, I have created it as a stand-alone function. And it is works (slowly).I tried using a standard table as you suggested:
    CREATE TABLE TEST_DATA
    test_value NUMBER
    INSERT INTO TEST_DATA
    (SELECT column_value test_value from TABLE(vector(1, 2, 1, 45, 22, -1)));
    COMMIT;
    select my_sum(test_value) from test_data;
    select my_functions.my_sum(test_value) from test_data;
    I also tried removing the PARALLEL_ENABLE clause to create the package as follows:
    CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
    FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER AGGREGATE USING SUM_AGGREGATOR_TYPE;
    END;
    And unfortunately it still breaks with the following error: SQL Error: ORA-00600: internal error code, arguments: [17090]. This looks like an Oracle bug to me as the PL/SQL parsing engine should have disallowed me to even create this if it is not supported in Oracle. Instead, it allows me to create the package, and breaks when I call the function with this weird error (additionally cutting my connection from the database) instead of disallowing me to do this altogether and printing a nice error message telling me that Oracle doesn't support this. How would I go about logging a ticket for this?
    Edited by: wcmatthysen on Dec 1, 2010 12:51 PM

Maybe you are looking for

  • Problems in Retrieve Server's Data from Client through RMI

    //I feel that this question quite challenging for me. maybe it is easy for you all. anyway, so anybody if know it, pls point out my mistake and give some opinion on my programs.thanks.... /*I have written one retrieve method in my server that is goin

  • I cannot open or install CS2 to my Mac (2010) What is going on?

    Process:         Adobe Reader 7.0 [349] Path:            /Volumes/Adobe Creative Suite/Adobe Reader 7.0/Adobe Reader 7.0.app/Contents/MacOS/Adobe Reader 7.0 Identifier:      Adobe Reader 7.0 Installer by Netopsystems AG Version:         Adobe Reader

  • Won't load on XP

    I was excited to download and try LR/4 but completely disappointed that it won't load or run under Window's XP. The error message says that I need Vista or later. The very last thing I would ever to is to "upgrade" to Vista. Adobe, get real! Yes, Win

  • Error when searching music in iTunes

    On my iPad (purchased in Los Angeles where I use it) when I have iTunes open and I want to search for music to download, I use the upper-right search window. When I type in an artist's name, say Ray Charles for instance, iTunes shows a long list of o

  • Apply strictfp globally

    Hi all, Is there a way of applying the strictfp flag globally with the following JVM: java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) I looking for the equiva