Is there any recursive function in DB2

Hi all,
Could you please tell me is there any recursive function in DB2 and if yes then please provide me a sample code.
I want to write a function as below but it's giving me following error:
>[Error] Script lines: 1-33 -
( DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884, SQLERRMC: SCF_MC2;FUNCTION
Message: No authorized routine named "SCF_MC2" of type "FUNCTION" having compatible arguments was found.
Line: 11 )
create FUNCTION scf_mc2 (@@certname varCHAR(20),@@assignee varCHAR(20),@@currentUser     varCHAR(20), @@javaLocale
varCHAR(20) )RETURNS float
LANGUAGE SQL
READS SQL
DATA format:
BEGIN ATOMIC 
    declare @n_cost float;
    declare @n_cost1 float;
    set @n_cost1 =0.00;
FOR @n_cost as
    select
    COALESCE ((CASE substr(ep.part_id,1,5) when 'cours' then tp2.scf_nc(ep.part_id,@@assignee,@@currentUser,@@javaLocale)  else
    tp2.scf_mc2(ep.part_id,@@assignee,@@currentUser,@@javaLocale) end ),0) cost
    from
    tpt_ext_ce_certification certi
    inner join tpt_ext_ce_track tr  on tr.certification_id = certi.id
    inner join tpt_ext_ce_group gr  ON gr.track_id = tr.id
    inner join tpt_ce_education_plan ep  ON ep.owner_id = gr.id
    WHERE
    tr.locale_id = @@javaLocale
    AND
    gr.locale_id = @@javaLocale
    AND
    certi.locale_id = @@javaLocale
    and
    substr(tr.flags,2,1) = '1'
    and
    certi.id=@@certname
DO
SET @n_cost1 = @n_cost+@n_cost1;
END FOR;
return @n_cost1;
end format
Regards
Vishal

Java is an object-oriented language, so you're not just searching for a method to do what you want, but for a Class, that provides that ability.
And since you don't define what "the date that I want" means I can only guess.
If you've got the date value in a String in some format, then you might look into the DateFormat or SimpleDateFormat classes.

Similar Messages

  • Is there any inbuilt function to split a comma seperated text

    Dear Friends,
    Is there any inbuilt function to split a comma seperated text for inserting the values thus split in to a table.
    Text Ex: Mango, Orange, Pinapple, Jack Fruit
    Output: Mango
    Orange
    Pineapple
    Jack Fruit
    Thanking you,
    With regards,
    Franklin

    Using DBMS_UTILITY.COMMA_TO_TABLE:--
    DECLARE
    l_tab dbms_utility.uncl_array;
    l_tablen number;
    BEGIN
    dbms_utility.comma_to_table('A,B,C', l_tablen, l_tab);
    dbms_output.put_line('TABLE LENGTH : '|| l_tablen);
    dbms_output.put_line('TABLE COUNT : '|| l_tab.COUNT);
    for i in 1..l_tablen
    loop
    dbms_output.put_line(l_tab(i));
    end loop;
    END;
    source --google.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Is there any manual about using DB2 as storage of Oracle BPEL Manager?

    Hi
    thank you for reading my post
    Is there any manual about using DB2 as database of ORACLE BPEL manager ?
    any one tried to port and test the system on DB2?
    Thanks.

    Hi,
    as you can read in the manual:
    http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28980/overview.htm#sthref26
    Oracle Database Lite, if you use the SOA Suite Basic installation option
    Oracle Database Lite is configured to support Unicode. DB_CHAR_ENCODING is defaulted to UTF8 in the polite.ini file.
    Oracle9i Database Server
    Oracle Database 10g
    The BPEL schema includes PL/SQL packages. They will not run on DB2...
    The datasources are configured to Oracle. You will have to change them to DB2...
    and it is not supported ;-)

  • Is there any RFC function module to read domain fixed value

    Hi,
    Is there any RFC function module to read domain fixed value from remote system in basis layer?
    As we cannot simply wrap DD_DOMVALUES_GET with a new RFC module,because remote system will not install our component, our wrap function module is not there.
    We may need a RFC fm from basis layer.

    HI,
    Try using Function Module:
    DD_DOMA_GET , If it is RFC enabled it can be used for reading the domain,
    Kindlly go through this link below:
    How to get "Fixed Domain Values" from other system by RFC-Call?
    Hope it helps,
    Regards
    Mansi

  • Is there any standard function available for generation of RIN number.

    Hi experts,
    RIN is Renewable Identifiaction Number.
    Structure for a RIN is a 34-character numeric code in the format:
         YYYYCCCCFFFFFBBBBBRRDKSSSSSSEEEEEE
    YYYY  = Year of Batch Production (when it leaves the facility)
    CCCC = Company registration ID
    FFFFF = Facility registration ID
    BBBBB = Producer assigned Batch Number
    RR  = Equivalence Value for the renewable fuel
    D = Renewable Type Flag (1 - cellulosic; 2 - non-cellulosic)
    K = RIN Type Flag (1 - standard, 2 - extra-value)
    SSSSSS  = RIN Block Starting Gallon Number 
    EEEEEE  = RIN Block Ending Gallon Number 
    Is there any standard function avaiable in R3 to generate such number?
    Please reply asap.
    Thank you in advance.

    Hi deepak,
    1. we can use the FM
    DATE_CHECK_PLAUSIBILITY
    regards,
    amit m.

  • Is there any registry functions available in Flex

    Is there any registry functions available in Flex:
    So that it can be useful...to make a application to start during startup

    I dont think so through Flash player security constraint you can access registry on local.

  • Are there any JCOP functionality to measure performance within card ?

    Hello,
    We are trying to measure some functions performances. Bu we dont have any specific tool for that.
    We made some tests with PC applications, but it is not precise(as you know there are some scard library delays).
    Is there any internal card(jcop) functionality to estimate the time interval for our card functionalities, or do you you have any other suggestions ?
    Thank you in advance.

    Hi,
    Given a card does not have a real time clock it is not really aware of time in this way and adding a measurement would affect the performance as well (note there is some timing in the crypto chip to help protect against certain attacks, but this is not exposed to the JC API).
    The best you can do it measure the time before and after transmitting an APDU at the lowest level possible. It is safe enough to assume that the PC/SC overhead is going to be consistent for the same amount of data. You could even benchmark just sending data to the card without doing anything with it to measure the time for transmitting your data. This is not generally needed as you are interested in the performance as perceived by a client application or a user and this transmission overhead is a part of that as well.
    Just my $0.02 anyway.
    Cheers,
    Shane

  • Is there any bapi/Function module to change only header text in fb02

    Hi ,
    I want to change only header text in FB02 .the header text will come  from a internal table.My Requirement is
    1. open a document in FB02
    2.change the header text of the document.
    Right now i'm doing this through an BDC.but i'm looking for a BAPI /FM.
    I Tried bapi_acc_gl_posting_post, fI_document_change..
    is there any BAPI/FM for this???
    Thanks,
    Challa

    You can use SAVE_TEXT FM
    Thanks
    Seshu

  • Is there any predefined functions to get the current month info?

    Hi,
    I have a business rule which is used to calculate the budget of current month. Right now, I set the current month as a variable, which will need to be changed every month, I know it's stupid, I am new to this area, so I am thinking is there any better way to do this?
    Any inputs is appreciated.
    Thanks
    Tony

    Using substitution variables for current month is perfectly acceptable and widely used.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Is there Any Standard Function Module that populates mail in SAP inbox

    Hello Experts,
                         The scenario that we are working is , Email Integration in SOLMAN.That is the done using XI , first the mails  raised for  Support Desk issues from Outlook are read and collected in XI ,now the requirement is from XI we have to populate the mails into SOLMAN's Inbox. So is there any standard FM that can be used in XI for this purpose.
       Or is there any other way in which the mails can come into Solman's Inbox,If someone has worked on this , please give me your valuable suggestions ASAP.
    Thanks & Regards,
    Mohana

    Hi deepak,
    1. we can use the FM
    DATE_CHECK_PLAUSIBILITY
    regards,
    amit m.

  • SSAS- DAX expression : Is there any DAX function that can return multiple values ?

    Hi,
    Iam in search of a DAX function that can return multiple values as result. please find below scenario where i want to implement the same.
    I have three  Tables: Table A (typeid, Cost, Qty ) ,Table B (typeid, Cost, Qty ) , Table C ( typeid,Typename ) .
    Table A                                       Table B                               
    Table C
    type id  cost  Qty             type id   Cost    Qty                 
    typeid  typename
    1           100    100                3         300     
    300                  1           aa
    2           200    200                4          400    
    400                  2           bb
                                                                                             3           cc
                                                                                             4          
    dd 
    i have to club cost and Qty of two tables(four measures)  as two measures in the  UI report. There are more columns in these tables that restrict the  UNION of the tables.(for the sake
    of understanding , i have not mentioned the othr columns). In the UI report(Execl 2013-power pivot) iam plotting these measures against the
    Table C.Typeid. Hence the measures drill down against each 
    Table C. Typeid as shown below:
    Typeid  Table A.cost  Table A.Qty  TableB.cost  TableB.Qty                              
    1              100             100
    2              200             200
    3                                                    
    300             300      
    4                                                    
    400             400
    My requirement is to club these measures so that the report will be as below
    Type id  cost   Qty
    1          100    100
    2          200    200
    3         300     300
    4         400      400
    Since i cannot club these in model,as a work around, i created a calculated measure in excel(Analyze tab->Calculations->olap tools->calculated measure) with the condition as below:
    new cost = IIF (ISEMPTY(TableA.cost)="TRUE",TableB.cost,TableA.cost)
    new Qty = IIF(ISEMPTY(TableA.Qty)="TRUE",TableB.Qty,TableA.Qty) and dragged these new measures into the report. It was working fine as expected.
    But  this functionality of Creating calculatedmeasure in excel report is possible only in 2013 excel version.
    Now the requirement is to get the same result in 2010 excel. Can you please help me in implementing the same in 2010 excel? or any other alternative method to bring the columns in model itself. I tried to create a measure in table A with DAX expression as
    : new cost :=CALCULATE(SUM(Table B.cost),ISBLANK(TableA.cost)) -> but this will return only 1 result .i need Sum(Table A.cost) also if it is not blank.
    Thanks in advance

    You can use SUMX ( 'Table A', 'Table A'[Cost] + 'Table B'[cost] )
    However, if you install the latest version of Power Pivot in Excel 2010, it supports the ISEMPTY function, too.
    http://support.microsoft.com/kb/2954099/en-us
    Marco Russo http://www.sqlbi.com http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo

  • Is there any encryption function in Single Language Windows 8.1?

    Looking to install a data encryption utility on my Single Language Windows 8.1
    Truecrypt only seems to work on Windows 7, and there is no Bitlocker or EFS on my version of 8.1.
    Any recommendations?
    If you find my response helpful, please click on the "Vote as Helpful" button!Thank you!
    My Blog

    BitLocker Drive Encryption is only available in Windows 8.1 Pro and Windows 8.1 Enterprise editions.
    But check this
    Help protect your files with device encryption
    Hetti Arachchige V Aravinda | Network & System Administrator (B.Sc, Microsoft Small Business Specialist, MCP, MCTS, MCSA, MCSE,MCITP, CCNA, CEH, MBCS)

  • Is there any Sum function in chart enviornment ?

    Guru's I am looking Sum option/functio in Xcelsius Chart Component ? After drivng the data from combo box (with filterd rows in Data Insertion) I have to display the value (sum) into  Chart as well I have to drill down the chart values n showing in to table / list view too.

    Hi stsrin,
    Till now i had created few dashboards, but as far my knowledge  there is no such component which would perform +/*/- or any such calculations. The Xcelsius components will just display the data from the excel sheet. All that you have to do is to apply suitable formulas in excel sheet and then map the result into suitable component. So all calculations or any other operations must be performed in excel only.
    Wel the drill down features is available in almost all components. Go through the available samples to get better hands on approach in it.
    If you have any further queries plz let me know.
    Thanks,
    Rajesh

  • Is there any smart function so I can search for top 10-20 most sold christian or other genre of muziek?

    I am searching for popular music in several genres to listen to previews and then deside to buy or not. However I have not found any search where you can select all genres like christian music. Also I would like to be able to define the period over when these songs were most downloaded, e.g. select; last week, last month, or last year.
    Kind regards,
    LLaurens

    I am searching for popular music in several genres to listen to previews and then deside to buy or not. However I have not found any search where you can select all genres like christian music. Also I would like to be able to define the period over when these songs were most downloaded, e.g. select; last week, last month, or last year.
    Kind regards,
    LLaurens

  • Is there any batch function module for '/SAPAPO/MSNP_GET_DRPIO_READ' in APO

    Hi,
    Iam developing a report for APO, wherein I pass matid & locid to the function module '/SAPAPO/MSNP_GET_DRPIO_READ' and get the order details as the o/p from the function module, now these takes place in a loop..endloop for more than 60,000 records which takes much of the processing time, can this be avoided by passing full table of matid,locid to the function module or rather a batch FM for the above mentioned function module.
    Thanks & Regards,
    Sanjay

    HI,
    Try using Function Module:
    DD_DOMA_GET , If it is RFC enabled it can be used for reading the domain,
    Kindlly go through this link below:
    How to get "Fixed Domain Values" from other system by RFC-Call?
    Hope it helps,
    Regards
    Mansi

Maybe you are looking for

  • Can i register 2 iphones on 1 itunes account

    Can I register 2 iphones (my wife & I) with 1 itunes account?

  • Upgrade from 10.1.2 to Tiger (can it be done)

    I have a relative who is still using 10.1.2. He is using a flat panel G4 with 512k ram and 40GB HD. he would like to upgrade but he still has some old system 9 apps that he uses and does not want to lose them plus he still wants his iMac to work. Can

  • In clamshell mode, must I connect to a monitor?

    I just got a keyboard, and I was told that when attached, if I closed my macbook, it would either just go into clamshell mode, or ask.  I connected to a TV via the DVI adaptor and when I closed the macbook, it just said, no signal.  Keyboard & mouse

  • Why is my iPhone 4 screen not displaying properly?

    Hello everyone, I have had my iPhone 4 now for a few months and it has worked fine until today. The screen suddenly displayed multi-coloured moving lines and coloured blocks randomly in succession, before turning bright green. I plugged it into my co

  • How to show timestamp along with date in LOV dropdown

    Hi, We have a requirement to show timestamp along with date as a display column in a LOV drop down. Type of the date column in VVO is set to timestamp. But still it is showing only date in the UI. But it is showing timestamp when we run it through AM