Custom function to return no_of_records

hello
i wrote a simple function
create or replace
FUNCTION "GET_COUNT"("TABLE_NAME" IN VARCHAR2) RETURN NUMBER IS
    no_of_records NUMBER := 0;
BEGIN
       select count(*)
       from TABLE_NAME
       into no_of_records;
    EXCEPTION
        WHEN OTHERS THEN
            return no_of_records; 
    RETURN no_of_records;
END;however it would not compile
error at the select statment;
id appreciate if anyone could point what is wrong with this function?
thank you
rgds

UserMB wrote:
i wrote a simple function
however it would not compileThis is not really the best of design approaches - it requires dynamic SQL and raises several interface and usability and security issues.
But assuming you are simply testing the water - it should look something like the following. Also note that uppercase is not abused and camelcase and pascalcase used as per the naming standards used by most languages, including .Net and Java.
create or replace function GetRowsInTable( tableName varchar2 ) return integer is
  cnt  integer;
begin
  execute immediate 'select count(*) from '||tableName into cnt;
  return( cnt );
end;The only exception that is likely to be raised is ORA-00942: table or view does not exist - you can decide to trap that exception and for example return a null to indicate no count exists, or simply leave it as is above and have the caller deal with the exception and decide how to re-act to it.
And please keep in mind - the above function is not how one should be designing code for an Oracle application.

Similar Messages

  • Custom function to return Record Selection Criteria

    <p>Here&#39;s what I need to do. There will be two prompts for range of dates; say, Begin date and End Date on almost all of the reports here. But it is not mandatory to enter Begin Date nor end date. So depending on the data the user enters we have to build the where clause.</p><p>So, to achive this I am trying to write a custom function which accepts the column name , and data from the parameters in the report. </p><p>my_func(col_nme, bgn_date, end_date) .. </p><p>This function does all the validations and returns a string depending on the data entered by the user. </p><p> Eg., if user entered only begin date then it will return col_nme <= bgn_date<br />      if user entered both dates then col_nme between bgn_date and end_date</p><p> And I am trying to user this complete clause in my record selection of the report. </p><p>In Record Selection call my_func({Query.Eff_date},p_bgn_date,p_end_date) </p><p>It is not accepting it since the function returns it as a string and the Reord selection should return a bolean. </p><p>Can any one let me know how to get this functionality in my report. </p><p>&#160;</p><p>ANy other suggestions to achieve this would be a great help<br />Thanks a lot in advance. </p>

    as long as you have discrete and multi values checked on for the parameter, the resulting array is all you need.
    In the RSF, the desired results will be returned by a REALLY simple boolean statement
    {table.field} in {?my param}
    "Like" may replace "in"Â for some cases.
    Try it, you'll like it. :)Â
         - Kathryn Webster (Report Design Consultant)
               Kat&#39;s News: http://diamond.businessobjects.com/blog/279

  • Using Custom function in Validation

    I have a custome function that returns a varchar of TRUE or FALSE.
    I have tested the function and even hardcoded with TRUE.
    However when I use it in the Validation and even thought all lines return True they get pushed into the Fail table.
    I have the rule Enabled and action on Fail is set to "Send To Fail"
    I have printed out the data being returned and all Pass so why are they being sent to the Fail.
    I call the function like this.
    So I assume that if the vlaue returned is True it should go to the true table.
    P2CMM01_LKP_STORAGE_LOC("Material Type(MTART)", "+STORAGE_LOCATION","+MATERIAL_NUMBER") = 'True'

    what is the value returned by the function True or False or TRUE or FALSE ?
    you will have to do a case-sensitive comparision
    TRUE = True  will fail

  • How to define a function that returns a void?

    Hi all,
    How can I define a custom function that returns a void?
    My understanding is simple UDF can only return a string.
    Is there any way around this limitation?
    Thanks.
    Ron

    > Hi,
    > User Defined Function in XI always return a String.
    >
    > If you requirement is that you want to perfrom some
    > operation in an user defined function, one option is
    > to move it to the Java Section in your mapping and do
    > it in the intialization / clean up section.
    >
    > Else, wite a UDF that will return a Blank string as
    > the output, and map it to the root node of the
    > target.
    >
    Hi all,
    Thank you all for your kind responses.
    The scenario I have is I need to insert the value of a particular field into a database table. E.g. MessageId, to keep track of the messages going through XI.
    Naturally, such operations return void. These operations are already encapsulated in a custom jar file.
    My purpose of using a UDF is solely to invoke the operation.
    But I realized I each UDF has to have a return type, and the output of this UDF must be mapped to a node in the outgoing message.
    Currently, my UDF returns an empty string, by using the implementation as below, I manage to perform my desired operation without affecting the result:
    MessageId -- UDF -- CONCAT -
    InstitutionCD_Transformed
    InstitutionCode_____
    But as you can see, this is not an elegant way of doing things.
    That's why I'm seeking alternative solutions for this problem.
    Bhavesh, you mentioned something about doing the operation in the initialization/cleanup section.
    Can you please explain more?
    Thanks.
    Ron

  • SSRS - Pass Field Value List To Custom Function Assembly And Display Result

    I have written a SQL Server Reporting Services custom function as a C# assembly DLL and added it to my report. The purpose of the function is to search for outlier records in a collection of data. The data is represented as an array of floating point -tuplets
    (float[][]). In a medical patient database, these might be things such as blood pressure, cholesterol, hight, weight, waist measurement, etc.
    Several user input parameters are provided in the report, including numeric seed values for this particular algorithm. One multivalued parameter is a list of the numeric columns to be used as input to the algorithm because, importantly,
    the user can choose any subset of the value columns. I have a tablix that will display columns from the dataset conditionally, based on which of those columns are chosen.
    At this point, there are two issues I'm having difficulty with:
    How do I, in the course of running the report, take just the numeric columns that the user has chosen (ignoring all others in the dataset) and pass them as a float[][] to my custom function? Or is there something in the
    Microsoft.ReportingServices namespace that I should use to query an input dataset and convert it to an array in my C# code?
    How can I present the array subset returned by my custom function in a tablix in the report?
    Note: One thought that occurs to me is that outlier records tablix could be contained in a subreport, but I'm not clear on the logistics of passing dataset field results from a master report to a subreport.
    I envision a final report when run to be similar to the following:
    - Mark Z.

    Hi Mark,
    Sorry for the delay.
    From your description, you want to pass the dataset data to a custom code array, and return the subset of the array, right? In this case, you can use a custom function to add the data to array, and use the a custom function to sort the data base on your
    requirement and then use a function to get the subset of the array. Here are some sample custom code for your reference.
    Add to arryay
    Dim values As System.Collections.ArrayList=New System.Collections.ArrayList()
    Function SetText(ByVal value As Integer) As Integer
        values.Add(value)
        return value
    End Function
    Sort array
    Function Sort()
    Dim i as Integer
    Dim j as Integer
    Dim t as Integer
    Dim n as Integer=values.Count-1
    For i=n To 1 Step-1
     For j=0 To i-1
     if values(j)<values(j+1) Then
        t=values(j)
        values(j)=values(j+1)
        values(j+1)=t
     End if
     Next j
    Next i
    End Function
    Return value.
    Function Rank(ByVal value As Integer)
       return values(value)
    End Function
    Assume that you pass [Weight] field to array, you can use the expression below on the Weight column:
    =Code.SetText(Fields!Weight.Value)
    Then use the expression below to get the values.
    PatientID:=Sort() & Lookup(Code.Rank(0),Fields!Weight.Value,Fields.Patient.Value,"Dataset")
    Height:=Lookup(Code.Rank(0),Fields!Weight.Value,Fields.Height.Value,"Dataset")
    Weight:=Code.Rank(0)
    Hope this helps.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Issue with calling custom function in merge command -10g

    Hi,
    I have ran into issue while calling a custom function in merge command.
    It throws error 'Invalid identifier'. Oracle doesnt understand that it is a function and take the function name as column name.
    Since no such collumn name exists, it throws 'Invalid identifier'.
    Interestingly, merge command works fine when it has a oracle function (replace, decode).
    The oracle version is 10.2.0.3
    It is very urgent.
    Any pointers will be helpful.
    Regards,
    Ravi

    I don't have privileges to create dblink, but this is working for me.
    So, i don't think function can be a issue here.
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:01.02
    satyaki>
    satyaki>
    satyaki>create table hist_tab
      2     as
      3       select * from emp
      4       where sal between 2000 and 4000;
    Table created.
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>select * from hist_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>update hist_tab
      2     set mgr = 7794;
    1 row updated.
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>commit;
    Commit complete.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from hist_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7794 08-SEP-81       2178          0         30 SALESMAN
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>
    satyaki>
    satyaki>create table tran_tab
      2     as
      3       select * from emp
      4       where sal between 2000 and 7000;
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from tran_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
          7902 FORD       ANALYST         7566 03-DEC-81    5270.76                    20 ANALYST
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  create or replace function fun(c_in number)
      2     return number
      3     is
      4       c_out number(4);
      5     begin
      6       if c_in < 7900 then
      7          c_out := 0;
      8       else
      9         c_out := 1;
    10       end if;
    11       return c_out;
    12*    end;
    13  /
    Function created.
    Elapsed: 00:00:01.00
    satyaki>
    satyaki>merge into hist_tab o
      2  using (
      3     select empno,
      4            ename,
      5            job,
      6            mgr,
      7            hiredate,
      8            sal,
      9            comm,
    10            deptno,
    11            job1,
    12            dob
    13     from (
    14              select k.*,
    15                     rank() over(order by fun(k.empno)) rn
    16              from tran_tab k
    17          )
    18     where rn = 1
    19     ) n
    20  on ( o.empno = n.empno)
    21  when matched then
    22    update set o.ename = n.ename,
    23               o.job = n.job,
    24               o.mgr = n.mgr,
    25               o.hiredate = n.hiredate,
    26               o.sal = n.sal,
    27               o.comm = n.comm,
    28               o.deptno = n.deptno,
    29               o.job1 = n.job1,
    30               o.dob = n.dob
    31  when not matched then
    32    insert(
    33            o.empno,
    34            o.ename,
    35            o.job,
    36            o.mgr,
    37            o.hiredate,
    38            o.sal,
    39            o.comm,
    40            o.deptno,
    41            o.job1,
    42            o.dob
    43          )
    44    values(
    45            n.empno,
    46            n.ename,
    47            n.job,
    48            n.mgr,
    49            n.hiredate,
    50            n.sal,
    51            n.comm,
    52            n.deptno,
    53            n.job1,
    54            n.dob
    55          );
    1 row merged.
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>select * from hist_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
    Elapsed: 00:00:00.00
    satyaki>You can check the final output with old output. It is working perfectly - i guess.
    Regards.
    Satyaki De.

  • Help on custom function...

    Hi all
    I'm having a problem with this custom function/report posted on TechNet while back for ConfigMgr 2007
    http://social.technet.microsoft.com/wiki/contents/articles/7870.sccm-2007-create-report-of-upcoming-maintenance-windows-by-client.aspx
    I've made the needed changes according to this blog post:
    https://sccmfaq.wordpress.com/2013/08/22/sccm-2012-show-next-effective-maintenance-window/
    ..but when using maintenance windows that occurs for example 1st tuesday of every 1 months, the function returns the date week ahead. For example now (on 28th of Feb) next maintenance window should be on Tuesday March 3rd, but instead the report is showing
    Tuesday March 10th.
    Any help on modifying the function would be appreciated, I saw that there comments on the original post about the recurrence type 4 (monthly by weekday as noted here https://msdn.microsoft.com/en-us/library/cc143300.aspx) not working correctly in the function.
    It seems that the function now returns the weekday of first full week of the month instead of the correct day.
    The function is this:
    CREATE FUNCTION [dbo].[SCCM_GetNextServiceWindow](@ScheduleToken AS CHAR(16), @RecurrenceType AS INT) RETURNS @NextServiceWindow TABLE (ScheduleToken CHAR(16), RecurrenceType INT, NextServiceWindow DATETIME, Duration INT, IsGMTTime BIT) AS BEGIN
    --1 Occurs on 1/1/2012 12:00 AM 00011A8500080000
    --2 Occurs every 3 day(s) effective 1/1/2012 8:00 PM 02811A8040100018
    --3 Occurs every 3 week(s) on Saturday effective 1/1/2012 8:00 PM 02811A80401F6000
    --3 Occurs every 1 week(s) on Saturday effective 1/1/2012 8:00 PM 02811A80401F2000
    --5 Occurs day 2 of every 2 month(s) effective 1/1/2012 8:00 PM 02811A8040288800
    --5 Occurs day 31 of every 1 month(s) effective 1/1/2012 8:00 PM 02811A80402FC400
    --5 Occurs the last day of every 3 months effective 1/1/2012 8:00 PM 02811A8040280C00
    --5 Occurs the last day of every 1 months effective 1/1/2012 8:00 PM 02811A8040280400
    --4 Occurs the Third Monday of every 1 month(s) effective 1/1/2012 4:00 AM 00811A9E08221600
    --4 Occurs the Last Wednesday of every 1 month(s) effective 1/1/2012 8:00 PM 02811A8040241000
    --4 Occurs the Fourth Wednesday of every 1 month(s) effective 1/1/2012 8:00 PM 02811A8040241800
    --4 Occurs the Last Monday of every 1 month(s) effective 1/1/2012 8:00 PM 02811A8040221000
    --3 Occurs every 1 week(s) on Monday effective 1/1/2012 4:00 AM 00811A9E081A2000
    -- http://msdn.microsoft.com/en-us/library/cc143300.aspx [This link is external to TechNet Wiki. It will open in a new window.]
    DECLARE @RecurrenceType_NONE INT
    , @RecurrenceType_DAILY INT
    , @RecurrenceType_WEEKLY INT
    , @RecurrenceType_MONTHLYBYWEEKDAY INT
    , @RecurrenceType_MONTHLYBYDATE INT
    SELECT @RecurrenceType_NONE = 1
    , @RecurrenceType_DAILY = 2
    , @RecurrenceType_WEEKLY = 3
    , @RecurrenceType_MONTHLYBYWEEKDAY = 4
    , @RecurrenceType_MONTHLYBYDATE = 5
    -- http://msdn.microsoft.com/en-us/library/cc143505.aspx [This link is external to TechNet Wiki. It will open in a new window.]
    --DECLARE @RecurrenceType INT; SET @RecurrenceType = @RecurrenceType_WEEKLY
    --DECLARE @ScheduleToken CHAR(16); SET @ScheduleToken = '00811A9E081A2000'
    DECLARE @ScheduleStartTime INT; SET @ScheduleStartTime = CAST(CONVERT(BINARY(4), LEFT(@ScheduleToken, 8), 2) AS INT)
    DECLARE @ScheduleDuration INT; SET @ScheduleDuration = CAST(CONVERT(BINARY(4), RIGHT(@ScheduleToken, 8), 2) AS INT)
    -- Duration is in minutes
    DECLARE @Duration INT; SET @Duration = @ScheduleStartTime % POWER(2, 6)
    -- Calculate the start time
    DECLARE @StartTime DATETIME; SET @StartTime = CONVERT(DATETIME, '01/01/1970 00:00:00')
    SET @StartTime = DATEADD(YEAR, (@ScheduleStartTime / POWER(2,6)) % POWER(2, 6), @StartTime)
    SET @StartTime = DATEADD(MONTH, ((@ScheduleStartTime / POWER(2,12)) % POWER(2, 4)) - 1, @StartTime)
    SET @StartTime = DATEADD(DAY, ((@ScheduleStartTime / POWER(2,16)) % POWER(2, 5)) - 1, @StartTime)
    SET @StartTime = DATEADD(HOUR, (@ScheduleStartTime / POWER(2,21)) % POWER(2, 5), @StartTime)
    SET @StartTime = DATEADD(MINUTE, (@ScheduleStartTime / POWER(2,26)) % POWER(2, 5), @StartTime)
    -- Determinte UTC and Flags
    DECLARE @IsGMTTime BIT; SET @IsGMTTime = CAST(@ScheduleDuration % POWER(2, 1) AS BIT)
    DECLARE @Flags INT; SET @Flags = (@ScheduleDuration / POWER(2,19)) % POWER(2, 3)
    -- Calculate the total duration in minutes
    SET @Duration = @Duration + ((@ScheduleDuration / POWER(2,22)) % POWER(2, 5)) * 24 * 60 -- DAYS
    SET @Duration = @Duration + ((@ScheduleDuration / POWER(2,27)) % POWER(2, 5)) * 60 -- HOURS
    DECLARE @Now DATETIME
    IF @IsGMTTime = 1 BEGIN
    SET @Now = GETUTCDATE()
    END ELSE BEGIN
    SET @Now = GETDATE()
    END
    DECLARE @NextMaintenanceWindow DATETIME
    IF @RecurrenceType = @RecurrenceType_NONE BEGIN
    IF DATEADD(MINUTE, @Duration, @StartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @StartTime
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_DAILY BEGIN
    IF DATEADD(MINUTE, @Duration, @StartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @StartTime
    END ELSE BEGIN
    -- Calculate the daily interval in minutes
    DECLARE @DailyInterval INT
    SET @DailyInterval = ((@ScheduleDuration / POWER(2,3)) % POWER(2, 5)) * 24 * 60
    SET @DailyInterval = @DailyInterval + ((@ScheduleDuration / POWER(2,8)) % POWER(2, 5)) * 60
    SET @DailyInterval = @DailyInterval + (@ScheduleDuration / POWER(2,13)) % POWER(2, 6)
    -- Calculate the total number of completed intervals
    DECLARE @DailyNumberOfCompletedIntervals INT; SET @DailyNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MINUTE, @StartTime, @Now) AS DECIMAL) / @DailyInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @DailyNextInterval DATETIME; SET @DailyNextInterval = DATEADD(MINUTE, @DailyNumberOfCompletedIntervals * @DailyInterval, @StartTime)
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @DailyNextInterval) < @Now BEGIN
    SET @DailyNextInterval = DATEADD(MINUTE, (@DailyNumberOfCompletedIntervals + 1) * @DailyInterval, @StartTime)
    END
    SET @NextMaintenanceWindow = @DailyNextInterval
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_WEEKLY BEGIN
    DECLARE @WeeklyInterval INT; SET @WeeklyInterval = (@ScheduleDuration / POWER(2,13)) % POWER(2, 3)
    DECLARE @WeeklyDoW INT; SET @WeeklyDoW = (@ScheduleDuration / POWER(2,16)) % POWER(2, 3)
    -- Adjust the start time to match the next day of week that matches the interval
    DECLARE @WeeklyStartTime DATETIME; SET @WeeklyStartTime = DATEADD(DAY, (7 - DATEPART(WEEKDAY, @StartTime) + @WeeklyDoW % 7), @StartTime)
    IF DATEADD(MINUTE, @Duration, @WeeklyStartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @WeeklyStartTime
    END ELSE BEGIN
    -- Calculate the total number of completed intervals
    DECLARE @WeeklyNumberOfCompletedIntervals INT; SET @WeeklyNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(WEEK, @WeeklyStartTime, @Now) AS DECIMAL) / @WeeklyInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @WeeklyNextInterval DATETIME; SET @WeeklyNextInterval = DATEADD(WEEK, @WeeklyNumberOfCompletedIntervals * @WeeklyInterval, @WeeklyStartTime)
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @WeeklyNextInterval) < @Now BEGIN
    SET @WeeklyNextInterval = DATEADD(WEEK, (@WeeklyNumberOfCompletedIntervals + 1) * @WeeklyInterval, @WeeklyStartTime)
    END
    SET @NextMaintenanceWindow = @WeeklyNextInterval
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_MONTHLYBYWEEKDAY BEGIN
    DECLARE @MonthlyBWWeek INT; SET @MonthlyBWWeek = (@ScheduleDuration / POWER(2,9)) % POWER(2, 3)
    DECLARE @MontlhyBWInterval INT; SET @MontlhyBWInterval = (@ScheduleDuration / POWER(2,12)) % POWER(2, 4)
    DECLARE @MonthlyBWDoW INT; SET @MonthlyBWDoW = (@ScheduleDuration / POWER(2,16)) % POWER(2, 3)
    -- Calculate the total number of completed intervals
    DECLARE @MonthlyBWNumberOfCompletedIntervals INT; SET @MonthlyBWNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MONTH, @StartTime, @Now) AS DECIMAL) / @MontlhyBWInterval, 0, 0)
    IF @MonthlyBWWeek = 0 BEGIN
    -- Calculate the next interval
    DECLARE @MonthlyBWLDOMNextInterval DATETIME; SET @MonthlyBWLDOMNextInterval = DATEADD(MONTH, @MonthlyBWNumberOfCompletedIntervals * @MontlhyBWInterval, @StartTime)
    -- Calculate last day of month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBWLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, @MonthlyBWLDOMNextInterval) + 1, 0))), @MonthlyBWLDOMNextInterval)
    -- Calculate the last day of the week for the month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, -(7 - DATEPART(WEEKDAY, @MonthlyBWLDOMNextInterval) + @MonthlyBWDoW % 7), @MonthlyBWLDOMNextInterval)
    IF DATEADD(MINUTE, @Duration, @MonthlyBWLDOMNextInterval) < @Now BEGIN
    -- Recalc for the next month interval
    SET @MonthlyBWLDOMNextInterval = DATEADD(MONTH, (@MonthlyBWNumberOfCompletedIntervals + 1) * @MontlhyBWInterval, @StartTime)
    -- Calculate last day of month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBWLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, @MonthlyBWLDOMNextInterval) + 1, 0))), @MonthlyBWLDOMNextInterval)
    -- Calculate the last day of the week for the month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, -(7 - DATEPART(WEEKDAY, @MonthlyBWLDOMNextInterval) + @MonthlyBWDoW % 7), @MonthlyBWLDOMNextInterval)
    END
    SET @NextMaintenanceWindow = @MonthlyBWLDOMNextInterval
    END ELSE BEGIN
    -- Calculate the next interval
    DECLARE @MonthlyBWNextInterval DATETIME; SET @MonthlyBWNextInterval = DATEADD(MONTH, @MonthlyBWNumberOfCompletedIntervals * @MontlhyBWInterval, @StartTime)
    -- Set the date to the first day of the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, -(DAY(@MonthlyBWNextInterval) - 1), @MonthlyBWNextInterval)
    -- Set the date to the first day of week in the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, (7 - DATEPART(WEEKDAY, @MonthlyBWNextInterval) + @MonthlyBWDoW) % 7, @MonthlyBWNextInterval)
    -- Calculate date based on the week number to add
    SET @MonthlyBWNextInterval = DATEADD(WEEK, @MonthlyBWWeek-1, @MonthlyBWNextInterval)
    IF DATEADD(MINUTE, @Duration, @MonthlyBWNextInterval) < @Now BEGIN
    -- Recalc for the next month interval
    SET @MonthlyBWNextInterval = DATEADD(MONTH, (@MonthlyBWNumberOfCompletedIntervals + 1) * @MontlhyBWInterval, @StartTime)
    -- Set the date to the first day of the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, -(DAY(@MonthlyBWNextInterval) - 1), @MonthlyBWNextInterval)
    -- Set the date to the first day of week in the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, (7 - DATEPART(WEEKDAY, @MonthlyBWNextInterval) + @MonthlyBWDoW % 7), @MonthlyBWNextInterval)
    -- Calculate date based on the week number to add
    SET @MonthlyBWNextInterval = DATEADD(WEEK, @MonthlyBWWeek-1, @MonthlyBWNextInterval)
    END
    SET @NextMaintenanceWindow = @MonthlyBWNextInterval
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_MONTHLYBYDATE BEGIN
    DECLARE @MontlhyBDInterval INT; SET @MontlhyBDInterval = (@ScheduleDuration / POWER(2,10)) % POWER(2, 4)
    DECLARE @MonthlyBDDoM INT; SET @MonthlyBDDoM = (@ScheduleDuration / POWER(2,14)) % POWER(2, 5)
    IF @MonthlyBDDoM = 0 BEGIN
    /* This is the last day of month logic */
    -- Calculate the total number of completed intervals
    DECLARE @MonthlyBDLDOMNumberOfCompletedIntervals INT; SET @MonthlyBDLDOMNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MONTH, @StartTime, @Now) AS DECIMAL) / @MontlhyBDInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @MonthlyBDLDOMNextInterval DATETIME; SET @MonthlyBDLDOMNextInterval = DATEADD(MONTH, @MonthlyBDLDOMNumberOfCompletedIntervals * @MontlhyBDInterval, @StartTime)
    -- Calculate last day of month
    SET @MonthlyBDLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBDLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, @MonthlyBDLDOMNextInterval) + 1, 0))), @MonthlyBDLDOMNextInterval)
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @MonthlyBDLDOMNextInterval) < @Now BEGIN
    SET @MonthlyBDLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBDLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, DATEADD(MONTH, (@MonthlyBDLDOMNumberOfCompletedIntervals + 1) * @MontlhyBDInterval, @StartTime)) + 1, 0))), @MonthlyBDLDOMNextInterval)
    END
    SET @NextMaintenanceWindow = @MonthlyBDLDOMNextInterval
    END ELSE BEGIN
    -- Check to make sure we won't loop forever if more than 31 days some how ends up in the token
    IF @MonthlyBDDoM > 31 SET @MonthlyBDDoM = 31
    -- Adjust the start time to match the next day of month that matches the interval
    DECLARE @MonthlyBDStartTime DATETIME; SET @MonthlyBDStartTime = DATEADD(DAY, (31 - DATEPART(DAY, @StartTime) + @MonthlyBDDoM % 31), @StartTime)
    -- This loop is used multiple times to search for the next valid date that falls on the desired day of month
    WHILE(DATEPART(DAY, @MonthlyBDStartTime) <> @MonthlyBDDoM) BEGIN
    SET @MonthlyBDStartTime = DATEADD(DAY, (31 - DATEPART(DAY, @MonthlyBDStartTime) + @MonthlyBDDoM) % 31, @MonthlyBDStartTime)
    END
    IF DATEADD(MINUTE, @Duration, @MonthlyBDStartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @MonthlyBDStartTime
    END ELSE BEGIN
    -- Calculate the total number of completed intervals
    DECLARE @MonthlyBDNumberOfCompletedIntervals INT; SET @MonthlyBDNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MONTH, @MonthlyBDStartTime, @Now) AS DECIMAL) / @MontlhyBDInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @MonthlyBDNextInterval DATETIME; SET @MonthlyBDNextInterval = DATEADD(MONTH, @MonthlyBDNumberOfCompletedIntervals * @MontlhyBDInterval, @MonthlyBDStartTime)
    WHILE(DATEPART(DAY, @MonthlyBDNextInterval) <> @MonthlyBDDoM) BEGIN
    SET @MonthlyBDNextInterval = DATEADD(DAY, (31 - DATEPART(DAY, @MonthlyBDNextInterval) + @MonthlyBDDoM % 31), @MonthlyBDNextInterval)
    END
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @MonthlyBDNextInterval) < @Now BEGIN
    SET @MonthlyBDNextInterval = DATEADD(MONTH, (@MonthlyBDNumberOfCompletedIntervals + 1) * @MontlhyBDInterval, @MonthlyBDNextInterval)
    WHILE(DATEPART(DAY, @MonthlyBDNextInterval) <> @MonthlyBDDoM) BEGIN
    SET @MonthlyBDNextInterval = DATEADD(DAY, (31 - DATEPART(DAY, @MonthlyBDNextInterval) + @MonthlyBDDoM % 31), @MonthlyBDNextInterval)
    END
    END
    SET @NextMaintenanceWindow = @MonthlyBDNextInterval
    END
    END
    END
    INSERT INTO @NextServiceWindow VALUES (@ScheduleToken, @RecurrenceType, @NextMaintenanceWindow, @Duration, @IsGMTTime)
    RETURN
    END
    Thanks in advance for any suggestions!

    What an ungodly amount of the code for the task!
    I tried
    SELECT * FROM SCCM_GetNextServiceWindow('00811A9E08221600', 4)
    Which is said mean "Occurs the Third Monday of every 1 month(s)" and it returned 2015-03-17. Which is a Tuesday. But it is the third Tuesday.
    Turns out that I have British settings on that instance, DATEFIRST is 1. If do SET DATEFIRST 7, I get 2015-03-23. Which is a Monday, but the wrong one.
    The current setting of DATEFIRST can be detected with @@DATEFIRST, and that would make the code even more complex.
    My gut reaction would be to start over and do it all in C#, where at least I don't have to bother about SET DATEFIRST.
    Or maybe first inspect that the ScheduleToken is correct. Maybe it is, but to me that is just an incomprehensible hex string.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Cr XIR1 to create a custom function to change the timestamp of a field

    Post Author: palm
    CA Forum: Crystal Reports
    Hi,
    I am trying to create a custom function to change the timezone of a field in the report depending on the timezone selected by the user in the prompt
    I wrote a SQL Expression to do this , but i ended up creating a bunch of expressions for each time zone ,
    So i am thinking of custom fuction some thing like
    TimeZoneConvertor:
    Fuction(TimeStampField ,  Timezone)
    Returns: Timestamp field with newtimezone as selected by user
    Hope you get this and please give me some kind of ideas to acheive this
    Thanks in Advance!!!!!!!!

    Hi
    goto se37...here u need to create a function group... then u need to create a function module. inside assign import/export parameters. assign tables/exceptions. activate the same. now write ur code within the function module
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
    Look at the below SAP HELP links, These links will show you the way to create a Function Module
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

  • Time Stamp via Custom Function

    This is such a basic concept for a custom function that I am assuming someone out there has done it already. I have never created a custom function for Essbase, though I have programmed in a variety of languages and I'm assuming getting the current date/time in Java is not exactly rocket science. I have reviewed the docs for creating and registering custom functions and that also appears relatively simple, especially with the examples available.<BR><BR>What I want is a function that returns a Double in the form of a Date/Time that I can retrieve into Excel and display as a Date/Time. We want a simpler, more effective way of time stamping the running of calculations, more effective than combing through the app logs when we need to know if/when a calc ran a week or a month or two ago.<BR><BR>Does anyone have some sample code and/or insights to share on this topic? I would greatly appreciate it if you do.<BR><BR>Thanks,<BR><BR>James

    fyi - I ended up implementing a solution in Perl/Maxl that gives a timestamp to the second in a format that can be retrieved intelligently into Excel. I use the Perl time() function (Unix server) to get the GMT epoch time as a long int. Then I convert it into the floating point DATE format for Windows, with the hard-coded assumption of what time zone my server is in. Then I run a calc from MaxL that sets this value. I build the calc string in Perl and pass it into MaxL. Pretty cool. The calc uses two sub vars, one for the members to fix on and the other for the Scenario to timestamp. This way the perl/maxl is database independent.<BR><BR>Just thought someone might want to know...

  • Export tables in custom function module

    I am creating a custom function module and want to return a table of contacts i_contacts.
    In the global data area I created a structure
    TYPES: BEGIN OF t_contacts,
              prsnr       TYPE knvk-prsnr,
              contactinfo TYPE adr6-smtp_addr,
           END OF t_contacts.
    And then in my interface I am trying to include as a table
    i_contacts like t_contacts
    But it keeps saying t_contacts not defined. Does that mean I have to define t_contacts as a global structure in SE11. Isnt there another way to define an internal table in the interface. Please advice.

    Hi..
    Declare like this..
    Data: i_contacts type standard table of t_contacts.
    i_contacts like t_contacts does not work because t_contacts is not an internal table with header line.
    Hope this helps.
    regards,
    chaithanya.

  • Export, Import and Table declaration in custom function module

    I am creating a custom function module. Parameters needed are export internal table and one data field from the internal table.
    What do i need to fill for 'associated type' for these export parameters since size of the internal table and type for the data field from the internal table vary.

    Hello Albert
    If the function module need not be RFC-enabled then you have many ways to define such dynamic parameters, e.g.:
    FUNCTION ZUS_SDN_DYNAMIC_PARAMS.
    *"*"Local Interface:
    *"  EXPORTING
    *"     REFERENCE(ET_ITAB) TYPE  TABLE
    *"     REFERENCE(ET_ITAB_1) TYPE  ANY
    *"     REFERENCE(ET_ITAB_2)
    *"     REFERENCE(ED_DATA) TYPE  CLIKE
    *"     REFERENCE(ED_DATA_1) TYPE  ANY
    *"     REFERENCE(ED_DATA_2)
    ENDFUNCTION.
    See also: How to return back a structure of dynamic tables in a Function Module
    Regards
      Uwe

  • Is there a custom function available which can be used for logging errors captured in a sp in a sql table

    Is there a custom function  available which can be used for logging errors captured in a sp during and after execution in a sql table?
    Basically we  would like to utilize such function  in every sp and log errors of each sp in a error log table
    Mudassar

    Thanks .
    I was able to write this however I am thinking I am missing something
    CREATE FUNCTION testfunction1()
    RETURNS @temp_error TABLE (
    id int identity(1,1),
    procedure_name varchar(255),
    line_number int,
    error_number int,
    error_message varchar(max),
    error_state int,
    error_severity int,
    occurence_datetime datetime default current_timestamp,
    user_name sysname default suser_name(),
    login_name sysname default suser_name()
    AS
    BEGIN
    insert @temp_error(procedure_name,line_number,error_number,error_message,error_state,error_severity)
    select error_procedure(),error_line(),error_number(),error_message(),error_state(),error_severity()
    RETURN;
    END;
    CREATE TYPE test_type AS TABLE(
    id int identity(1,1),
    procedure_name varchar(255),
    line_number int,
    error_number int,
    error_message varchar(max),
    error_state int,
    error_severity int,
    occurence_datetime datetime default current_timestamp,
    user_name sysname default suser_name(),
    login_name sysname default suser_name()
    GO
    create proc usp_error_test
    @test_type AS test_type READONLY
    as
    begin
    begin try
    select 1/0
    end try
    begin catch
    select * from testfunction1(@test_type)
    end catch
    end
    Mudassar

  • View or function to return the full path hierarchy of an organization

    Hi,
    The customer is asking to provide a report showing for each assignment of each employees the corresponding organization where it is assigned and the full path of the organization hierarchy.
    The organization hierarchy is at most 6 level deep, so they want to produce the report with the columns:
    root_organization | org_level1 | org_level2 | org_level3 | org_level4 | org_level5 | org_level6 | person_name | assignment_date
    if the person is assigned in an organization lower than the 6th level, the remainin columns should be empty.
    I see that the view HRFG_ORGANIZATION_HIERARCHIES returns only one step in the organizations hierarchy: Parent_organization_name, Child_organization_name.
    Is there any view or function as well which returns the full path of an organization in the hierarchy? At least a function which returns the full path parents of the organization delimited by commas.
    Thank you

    Hi,
    Yes, I wrote a custom code but is running a bit slowly for around 1000 organizations and more than 15 version of hierarcy (so 15000 rows of this view). I wanted to know if there is any optimized code provided by Oracle.
    Thank you.

  • How to pass OAF filed data as a argument to custom function

    Hi All,
    I am doing controller extension. I have the following doubt will you please solve my doubt.
    My doubt is how to pass the standard page filed data as an argument to custom function.
    Let us assume that in my standard page i have item details (item number, description and uom.......)
    and i need to pass item number as an argument to my custom function.
    How to do this?
    Please help me on this.
    Regards
    Zaheer.

    Hi
    Thanks a lot for replying me, Thanks again and again.
    The error which i am getting is as follows:
    Actually iam extending egocancelapplypagebuttonbarco.
    in this co we have code on Apply button iam writing my code there.
    My code is as follows:
    package oracle.apps.ego.common.webui;
    import java.sql.*;
    import oracle.apps.ego.item.eu.util.EgoItemContext;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OABreadCrumbsBean;
    import oracle.jbo.Transaction;
    import oracle.cabo.ui.beans.layout.PageLayoutBean;
    import oracle.cabo.ui.beans.nav.LinkBean;
    import oracle.jbo.ApplicationModule;
    // Referenced classes of package oracle.apps.ego.common.webui:
    // EgoCancelApplyPGButtonBarCO
    public class EgoCancelApplyPGButtonBarEXTCO extends EgoCancelApplyPGButtonBarCO
    public EgoCancelApplyPGButtonBarEXTCO()
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
         String s = null;
    OAFormValueBean oaformvaluebean = (OAFormValueBean)oapagecontext.getPageLayoutBean().findChildRecursive("cancelDestinationHidden");
    if(oaformvaluebean != null)
    s = (String)oaformvaluebean.getValue(oapagecontext);
    if(s == null)
    OABreadCrumbsBean oabreadcrumbsbean = (OABreadCrumbsBean)oapagecontext.getPageLayoutBean().getLocation();
    if(oabreadcrumbsbean != null)
    int i = oabreadcrumbsbean.getLinkCount();
    if(i >= 2)
    s = oabreadcrumbsbean.getLinkDestination(i - 2);
    if(oapagecontext.getSessionValue("EgoCritTempListPgUrl") != null && s == null)
    s = (String)oapagecontext.getSessionValue("EgoCritTempListPgUrl");
    if(s == null)
    s = oapagecontext.getCurrentUrlForRedirect();
    OAButtonBean oabuttonbean = (OAButtonBean)oawebbean.findIndexedChildRecursive("cancelButton");
    oabuttonbean.setWarnAboutChanges(false);
    oabuttonbean.setDestination(s);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    byte byte0 = 4;
    super.processFormRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    if(oapagecontext.getParameter("applyButton") != null)
    oapagecontext.getApplicationModule(oawebbean).getTransaction().commit();
    String s = null;
    if(oapagecontext.getTransactionTransientValue("OverrideEgoCancelApplyPGButtonBarCODestination") == null)
    OAFormValueBean oaformvaluebean = (OAFormValueBean)oapagecontext.getPageLayoutBean().findChildRecursive("applyDestinationHidden");
    if(oaformvaluebean != null)
    s = (String)oaformvaluebean.getValue(oapagecontext);
    if(s == null)
    OAButtonBean oabuttonbean = (OAButtonBean)oawebbean.findIndexedChildRecursive("cancelButton");
    s = oabuttonbean.getDestination();
    try
    oapagecontext.sendRedirect(s);
    return;
    catch(Exception exception)
    return;
    if(byte0 == 4)
    EgoItemContext egoitemcontext = EgoItemContext.getItemContextObject(oapagecontext);
    String s1 = egoitemcontext.getItemNumber();
    try
    CallableStatement callablestatement = oaapplicationmodule.getOADBTransaction().getJdbcConnection().prepareCall("{XXNRITEMUPDATE(?)}");
    callablestatement.setString(1, s1);
    callablestatement.execute();
    callablestatement.close();
    catch(SQLException sqlexception)
    sqlexception.printStackTrace();
    And my error is as follows
    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.processRequest(OAPageButtonBarBean.java:351) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:980) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353) at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at oa_html._OA._jspService(_OA.java:82) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:595) ## Detail 0 ##
    java.lang.NullPointerException at oracle.apps.ego.common.webui.EgoCancelApplyPGButtonBarCO.processRequest(EgoCancelApplyPGButtonBarCO.java:81) at oracle.apps.ego.common.webui.EgoCancelApplyPGButtonBarEXTCO.processRequest(EgoCancelApplyPGButtonBarEXTCO.java:31) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.processRequest(OAPageButtonBarBean.java:351) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:980) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353) at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at oa_html._OA._jspService(_OA.java:82) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:595)
    I hope that u will help me untill i got the solution for this issue.
    Regards
    Zaheer.

  • ICM custom function

    Hi,
    I am using ICM vestion 9.0. I have a requirement to route calls depending on keyword from sentense. Say for example system retunrs a sentense "I need information on foreign exchange" and I am saving the data in PV1. Now if the sentense has a word "foreign" I need to give different priority. So far I could not find any icm built-in function through which I can achieve this. I decided to build a custom function and I never develop custom function before so need help on building a custom function.
    Please let me know if I build the custom function using below expression will it work. Here string1 is the sentense which I will get from PV1 and string2 is the keyword
    Name = SearchFunction(string1,string2)
    Parameters =  2
    Function =     String[] Sentence = %1%.split();
                        for(String word: sentence)
                            if(word.equals(%2%))
                                return ture;
                        return false;
    Thanks,
    Ashfaque.

    Hi,
    I think I can achieve the same by using below formula
    (find("Foreign","PV1")>0
    Thanks,
    Ashfaque.

Maybe you are looking for

  • How to back up phone with apps purchased with multiple iTunes accounts

    It's a long story, but my iPhone has apps that were purchased through multiple iTunes account.  Is it possible to create a backup of my phone that accounts for all of these apps?  Last time I tried backup in iTunes, it only backed up the apps purchas

  • AIR Badge with in flash site

    Hello, need some advice / help. I currently have a flash site and I have an AIR app. I need to use the badge within my flash site. Does anyone know if there is anyway of using the AIR Badge within the .swf or will I need to create a normal .html page

  • Bugs in jdoc and jdoclet Ant tasks?

    (The relevant lines in the build.xml file are at the end of this message.) I encountered a problem with the jdoc Ant task: - I added a description for a class in the metadata file. Everything rans fine. Then I added another class to the metadata file

  • ORA-02074 in oracle 8 Worked fine in 7.x

    Executing a plsql string from msaccess via an odbc passthrough query.. for some reason the oracle8 odbc driver is enforcing a transaction is there a known work around????? ORA-02074 cannot string in a distributed transaction Cause: A commit or rollba

  • Can u please tell which book or site is good learning abap webdynpro

    can u please tell which book or site is good learning abap webdynpro and workflow........................