Help required in writing UDF

Hi SDNers,
I have a requirement to write UDF, can anybody help me in acheiving the code.
Requirement:-
If I am getting 5 as my input to UDF, I need to generate five 001's to my output of UDF.
I tried to loop the input and used result.addValue("001"); but not working.
Please help in getting java logic for this udf.
Thanks
Jayaram.G

Hi Luis,
Thanks for your quick response.
I am using context in my udf.
My code is like this.
for(int i=0;i<var1.length;i++)
result.addValue("001");
As I am getting 5 as input and I am using Var1.length, the udf is generating only one 001. But I need five 001.
Regards,
Jayaram.G

Similar Messages

  • Help required in writing an sql to fetch the the difference of the data.

    Hi Gurus,
    Could some one help me in writing an sql to pull data the difference between two same structured tables from two different database and to store that data in an temperory table.
    many many thanks in advance

    Lets say you have two db SOURCE and DEST
    SOURCE is the DB that you have Logged in into. Now you do the following.
    1. Createa DBLink to DEST database.
    2. Check if the DBLink works properly.
    3. Then execute the following sql.
    select <column_list> from <table_name>
    minus
    select <column_list> from <table_name>@<dblink>
    union all
    select <column_list> from <table_name>@<dblink>
    minus
    select <column_list> from <table_name>

  • Help required in writing And Reading Xml From Database

    Hi
    i m new to java.
    i m facing problem while writing Xml file from Mysql Database in java i m using the WebRowSet
    and also for Reading WebRowSet
    after reading the Xml i have to save this in Database
    (required source code)
    is there any one to help me in this way
    regards
    aamir

    shadab_think_globally wrote:
    {noformat}*hi everybody,
    please send me a ajax with jsp application
    suppose i enter a word in text area ajax will populate/suggest all string from database ,who started
    from that entering character(s).like a google string search.
    please send full source code
    *{noformat}how about you do it yourself?

  • Help required in writing PCR's

    Hi All,
    Update on this is highly appreciable and points will be rewarded.
    Thanks & Regards,
    surya
    Hi All,
    To calculate OT as per the Client requirement two PCR's needs to be wriiten.
    1. OT should not be paid if it is less than 30 mins.
    2. OT should be calculated as follows:
    (basic2/26/8no. of hours).
    Your help in this regard is highly appreciable.
    Thanks & Regards,
    Surya
    Edited by: Surya Prakash Kanuru on Sep 15, 2008 9:55 AM

    Hi,
          No need to write to 2  PCR ,with one pcr itself it can be calculated . Here maintain  overtime hrs in 15 infotype ,such that overtime hrs will be  stored in a wage type say 9ovt . 
    Pcr can be build in this way
    90vt
    num = 90vt(where overtime hrs will be transfered to num)
    num?0.5
    < ( if the hrs is 30 mins )
    your logic
    = (30 mins )
    logic calc
    >  (30 min)
    amt = 1001 (basic wage type)
    amt = 1001 div 2
    some calc
    div ana (for dividing with the no of hrs and passing the overtime value to the amt)
    addwt *
    Hope it helps u
    Regards,
    Prince Elvis

  • Help required in writing an sql querry

    Hi guys,
    Could any one hlep me out in writing an sql querry for the below requirement.
    the requirement is: for a perticular ID if we have different names then we need to get it out as multiple else the name itselef. I have given the sample input and the expected output.
    ID Name
    1 A
    1 B
    2 F
    2 F
    3 C
    4 D
    4 E
    Out put should look like
    ID Name
    1 Multiple
    2 F
    3 C
    4 Multiple
    Thanks in advance
    Shylender.
    Edited by: 959345 on Nov 22, 2012 10:13 PM

    May be this:
    WITH t AS
            (SELECT 1 id, 'A' str FROM DUAL
             UNION ALL
             SELECT 1, 'B' FROM DUAL
             UNION ALL
             SELECT 2, 'F' FROM DUAL
             UNION ALL
             SELECT 2, 'F' FROM DUAL
             UNION ALL
             SELECT 3, 'C' FROM DUAL
             UNION ALL
             SELECT 4, 'D' FROM DUAL
             UNION ALL
             SELECT 4, 'E' FROM DUAL),
         t1 AS
            (SELECT id,
                    CASE
                       WHEN COUNT (DISTINCT str) OVER (PARTITION BY id) > 1 THEN
                          'MULTIPLE'
                       ELSE
                          str
                    END
                       str
               FROM t)
      SELECT id, str
        FROM t1
    GROUP BY id, str
    ORDER BY 1;Cheers,
    Manik.

  • Help required in writing a query

    hi
    Consider a table (ShogenValue) with following data:
    Model_Id header_id Serial_no shogen_no si_val
    4329 1 40001 A0001 1
    4329 1 40001 B0001 2
    4329 1 50300 B0001 3
    4329 1 40001 C0001 4
    4329 1 50300 C0001 5
    4329 1 60001 C0001 6
    Select
         si_val
    From
         ShogenValue
    Where
    model_id = 4329
    And
         header_id = 1
    And
    serial_no = '60001'
    Is it possible to write a modified version of above query which will bring the following result:
    Model_Id header_id Serial_no shogen_no si_val
    4329 1 40001 A0001 1
    4329 1 50300 B0001 3
    4329 1 60001 C0001 6
    Meaning if a record exists for a particular shogen_no (Shogen_no C0001 has value corrosponding to '60001' in above query), pick it up, if it
    does not exist (Shogen_no B0001 does not have value corrosponding to '60001' in above case) then pick a record with one level less serial number ('50300' in above case) and so on.
    Thanx
    Regards
    Omer Imtiaz

    This should help, although it will probably not perform. Try it and see what the plan for it is.
    SELECT
    FROM
      shogenvalue sv,
      (SELECT
        max(serial_no) serial_no_max,
        shogen_no
      FROM
        shogenvalue
      WHERE
        model_id = 4329
        AND header_id = 1
        AND serial_no <= '60001'
      GROUP BY
        shogen_no
      ) svm
    WHERE
      sv.serial_no = svm.serial_no_max
      AND sv.shogen_no = svm.shogen_no
    ;HTH,
    Lennert

  • Help required in writing the query

    I have the following level accounts
    10000
    11000
    11100
    11101
    11200
    11201
    12000
    12100
    12101
    12102
    12103
    20000
    21000
    21100
    21101
    22000
    22101
    21200
    21201
    I have to take the amount of the child account and sum it to the parent account as below:
    11100 = 11101 + 11102 - 11103+.........
    11000 = 11100 + 11200 + 11300+.........
    10000 = 11000 + 12000 + 13000+.........
    21100 = 21101 + 21102 - 21103+.........
    21000 = 21100 + 21200 + 21300+.........
    20000 = 21000 + 22000 + 23000+.........
    Please help...
    Thanks in advance.

    SQL> with t as (
      2             select 10000 ACCOUNT, NULL BEG_BAL, NULL END_BAL from dual union all
      3             select 11000,NULL,NULL from dual union all
      4             select 11100,NULL,NULL from dual union all
      5             select 11101,1750.00,4150.00 from dual union all
      6             select 11102,1550.00,3150.00 from dual union all
      7             select 11103,1650.00,3200.00 from dual union all
      8             select 11200,NULL,NULL from dual union all
      9             select 11201,800.00,1250.00 from dual union all
    10             select 11202,1550.00,3150.00 from dual union all
    11             select 12000,NULL,NULL from dual union all
    12             select 12100,NULL,NULL from dual union all
    13             select 12101,1200.00,5000.00 from dual union all
    14             select 12102,1500.00,3000.00 from dual union all
    15             select 12103,1550.00,2750.00 from dual union all
    16             select 20000,NULL,NULL from dual union all
    17             select 21000,NULL,NULL from dual union all
    18             select 21100,NULL,NULL from dual union all
    19             select 21101,2000.00,6500.00 from dual union all
    20             select 21102,1500.00,3500.00 from dual union all
    21             select 21103,1750.00,3550.00 from dual union all
    22             select 22000,NULL,NULL from dual union all
    23             select 22100,NULL,NULL from dual union all
    24             select 22101,1550.00,3550.00 from dual union all
    25             select 22102,2550.00,5550.00 from dual union all
    26             select 21200,NULL,NULL from dual union all
    27             select 21201,2550.00,6500.00 from dual union all
    28             select 21202,3550.00,7500.00 from dual
    29            )
    30  select  account,
    31          beg_bal,
    32          end_bal,
    33          sum(beg_bal) over(order by account range between current row and grouping_window follow
    ing) group_beg_bal,
    34          sum(end_bal) over(order by account range between current row and grouping_window follow
    ing) group_end_bal
    35    from  (
    36           select  t.*,
    37                   case
    38                     when account / 10000 = trunc(account / 10000) then 9999
    39                     when account / 1000 = trunc(account / 1000) then 999
    40                     when account / 100 = trunc(account / 100) then 99
    41                     when account / 10 = trunc(account / 10) then 9
    42                     else 0
    43                   end grouping_window
    44             from  t
    45          )
    46  order by account
    47  /
       ACCOUNT    BEG_BAL    END_BAL GROUP_BEG_BAL GROUP_END_BAL
         10000                               11550         25650
         11000                                7300         14900
         11100                                4950         10500
         11101       1750       4150          1750          4150
         11102       1550       3150          1550          3150
         11103       1650       3200          1650          3200
         11200                                2350          4400
         11201        800       1250           800          1250
         11202       1550       3150          1550          3150
         12000                                4250         10750
         12100                                4250         10750
       ACCOUNT    BEG_BAL    END_BAL GROUP_BEG_BAL GROUP_END_BAL
         12101       1200       5000          1200          5000
         12102       1500       3000          1500          3000
         12103       1550       2750          1550          2750
         20000                               15450         36650
         21000                               11350         27550
         21100                                5250         13550
         21101       2000       6500          2000          6500
         21102       1500       3500          1500          3500
         21103       1750       3550          1750          3550
         21200                                6100         14000
         21201       2550       6500          2550          6500
       ACCOUNT    BEG_BAL    END_BAL GROUP_BEG_BAL GROUP_END_BAL
         21202       3550       7500          3550          7500
         22000                                4100          9100
         22100                                4100          9100
         22101       1550       3550          1550          3550
         22102       2550       5550          2550          5550
    27 rows selected.
    SQL> SY.

  • Help Required in writing a small program

    Create ajava program to manage vehicles.the class vehicle must have five attributes

    maybe he cant figure out what five attributes a
    vehicle class can have :-)boolean hasSpinnningRims;boolean isPimped;int noOf Wheels;
    public final int LEFT_IN_MANCHESTER = 0;
    public final int LEFT_IN_BRADFORD= 1;
    public final int DELL_BOY = 3;

  • XSLT mapping Help Required.

    XSLT mapping Help Required.
    Hi Experts,
    I am New to XSLT Mapping. I am practising the below Example:
    InputXML File:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    XSL StyleSheet File:
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
    Xmlns:ns1=”http://XYZ.com/Test”>
    <xsl:template match="/">
    <ns1:MT_XSLT_Target>
    <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
    <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
    </Name>
    <Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
    ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
    <City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
    </ns1:MT_XSLT_Target>
    </xsl:template>
    </xsl:stylesheet>
    The Desired Output shuold be:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
    <Title>Male</Title>
    <Name>Anshul Chowdhary</Name>
    <Street>83/b 2nd Main</Street>
    <City>Mysore</City>
    </ns1:MT_XSLT_Target>
    I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
    Anshul Chowdhary Male 2nd Main 83/b Mysore
    I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
    Regards,
    GIRIDHAR

    Hi,
    I have used below for testing.
    Input xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    xsl code:
    <?xml version='1.0' encoding="UTF-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen" 
        xmlns:ns1="http://XYZ.com/Test"> 
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 
        <xsl:template match="/"> 
            <ns1:MT_XSLT_Target> 
                <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title> 
                <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/> 
                </Name> 
                <Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '), 
                    /ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street> 
                <City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City> 
            </ns1:MT_XSLT_Target> 
        </xsl:template> 
    </xsl:stylesheet>
    For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
    Regards
    Venkat

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Urgent help required: Query regarding LC Variables

    Hi All
    Sometime earlier I was working on a performance issue raised by a customer. It was shell script that was taking almost 8-9 hrs to complete. During my research I came across a fact that there were some variables which were not set, the LC variables were impacting the sort funnel operations because of which the script was taking a long time to execute.
    I asked them to export the following commands, after which the program went on smoothly and finished in a couple of mins:
    export LC_COLLATE=en_US.ISO8859-1
    export LC_MESSAGES=C
    export LC_MONETARY=en_US.ISO8859-1
    export LC_MONETARY=en_US.ISO8859-1
    export HZ=100
    export LC_CTYPE=en_US.ISO8859-1
    export LANG=en_US.UTF-8
    Later I did recover that setting the LC_COLLATE to C, is not helping and the program was again taking a lot of time. Few questions that I want to ask are:
    1. Can someone please tell me, what each of these variable mean and how these values make a difference.
    2. When I exported LC_COLLATE=en_US.ISO8859-1, it worked fine, but when i tried with the defalut value LC_COLLATE=C, then why the program didnt work.
    As this issue is still going on, hence I would request All to provide their valuable inputs and let me know as much as possible.
    Appreciate your help in this regard.
    Thanks
    Amit
    Hi All
    A new development in this regard. The customer has send us a screen shot in which they were trying to export the locale variable using the commands which I have pasted above. I can see in the screen shot that while exporting LC_COLLATE and LC_TYPE, they get a message that ""ksh: export: couldn't set locale correctly"".
    Request everyone to please give their inputs as it's a bit urgent.
    Thanks for all the help in advance.
    Thanks
    Amit
    Some help required please...
    Edited by: amitsinhaengg on Jul 22, 2009 2:03 AM
    Edited by: amitsinhaengg on Jul 22, 2009 2:06 AM

    LC_CTYPE
    Controls the behavior of character handling functions.
    LC_TIME
    Specifies date and time formats, including month names, days of the week, and common full and abbreviated representations.
    LC_MONETARY
    Specifies monetary formats, including the currency symbol for the locale, thousands separator, sign position, the number of fractional digits, and so forth.
    LC_NUMERIC
    Specifies the decimal delimiter (or radix character), the thousands separator, and the grouping.
    LC_COLLATE
    Specifies a collation order and regular expression definition for the locale.
    LC_MESSAGES
    Specifies the language in which the localized messages are written, and affirmative and negative responses of the locale (yes and no strings and expressions).
    You can use command
    # locale -k LC_CTYPE
    to see more detail about each type.

  • Help required - Sales order item is partially delivered but the item grayed

    I have a sales order 123 having say item10 with qty 1, item20 with qty 10 , item 30 qty 12
    Item 1 confirmed qty 1 and delivered qty is 1
    Item 2 confirmed qty 10 and delivered qty 10
    Item 3 confirmed qty 1 and delivered qty is 1
    Now the item3 still has open requirements of 11 to be delivered. But the item is GRAYED OUT already.
    even if I do ATP the qty is not confirming for the remaining 11 pieces.
    Why is that? How to make that item out from GRAY.
    How to confirm the remaining 11 qty for that item.
    Help required as early as possible.
    Appreciate ur help guys
    Radha

    hi Radha, how are you ?
         ---the partial deliveries in master data must have not been mentioned.
         ---the deliveries should be upto target quantity.
         ---check order type, item category and schedule line category.
         ---check unrestricted stock availability.
    thank you
    regards
    Khera.

  • Search Help with in a serach help required in SRM 4.0

    Hi,                                                     
    Requirement: Search help required for Product Category field in the Search help for Product(BBPH_PRODUCT) in SRM portal.
    This search help is used in Create shopping Cart transaction. The hyper link on Internal Goods/Services leads to the search help BBPH_PRODUCT. 
    My analysis:           
    The field Product Category (CATEGORY_ID) has search help(COM_CAT_HIER) attached to its data element. When I single test the search help BBPH_PRODUCT in SAP GUI,I can see the search help for field product category in the selection dialogue box. However the same does not appear on the corresponding screen in HTML.
    Please let me know whether I need to do some thing to make the search help appear on the HTML screen?
    With Regards,         
    Prakash Kamath

    Hi Prakash,
    I have the same problem but with another field. Unloading point. Could you please tell me how did you solve this problem with displaying F4 help on html/ SRM portal?
    Thank you very much.
    Best regards,
    Danijela ZIvanovic

  • Help needed in writing query

    Hi,
    Could anyone help me in writing below query without syntax errors.
    I tried but no luck
    select xmlelement("g", XMLATTRIBUTES(g.contentgroup_id as "id",g.groupname as "label",
    (select xmlagg(xmlelement ("c",XMLATTRIBUTES(c.title as "title",c.content_id as "id")))) as "A"))
    as "A" from
    (SELECT g.contentgroup_id AS id, g.groupname AS label, c.title AS label, c.content_id AS id
    FROM content_ec c FULL OUTER JOIN contentgroup_ec g ON c.group_id = g.contentgroup_id
    oRDER BY g.groupname ,c.title ASC );
    Any help really appreciated.
    Thanks

    Few tips to get your question answered here
    1. Give your database version. Some thing that does not work in one version works fine in the next. And 8i,9i or 10g is not version. best way to give the version is to query your v$version table like this.
    SQL> select * from v$version where rownum = 1
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod2. You should understand we don't have what you have, meaning you should provide your data structure and some sample data for us to help.
    3. "I got an error"... "Its not working"... and the list goes on. Sentences like this does not help. If you got a error past the entire error. If stuff does not work, tell us the details.
    4. Just don't throw some output and say i want it. Please explain to every one how you derive it.
    5. And the most important thing. Use \...\ tag to format. Please.. Please.. Please.. use it. It helps every one a lot. When you use it your SQL looks some thing like this.
    SELECT xmlelement("g", XMLATTRIBUTES(g.contentgroup_id as "id",g.groupname as "label",
         (select xmlagg(xmlelement ("c",XMLATTRIBUTES(c.title as "title",c.content_id as "id")))) as "A")) as "A"
       FROM (SELECT g.contentgroup_id AS id,
                 g.groupname AS label,
                 c.title AS label,
                 c.content_id AS id
            FROM content_ec c
            FULL OUTER JOIN contentgroup_ec g
              ON c.group_id = g.contentgroup_id
           ORDER BY g.groupname ,c.title ASC );6. And also do search this forum. Most of your my queries are answered by simple search.
    Thanks,
    Karthick.

  • Help needed in writing a function.

    I am using Oracle 11g and SQL plus. I am a complete newbie, so I need some help here in writing a function. I guess my question is more about writing the trigonometric functions within the function.
    latA, longA latB, longB // these are the four input parameters,
    theta = longA - longB
    distX = sin( latA * PI / 180) * sin ( latB * PI /180) + cos ( latA * PI/180) * cos ( latB * PI/180) * cos ( theta * PI / 180)
    distY = acos(distX) // this is arc cosine
    distZ = distY * 180 / PI // PI refers to the mathematical PI
    distP = distZ * 60 * 1.1515; // this value should be returned. Of course the intermediate variable names don't matter.
    Please help. Thanks.

    CREATE OR REPLACE FUNCTION fucntion_name(latA IN NUMBER, longA IN NUMBER, latB IN NUMBER, longB IN NUMBER) RETURN NUMBER
    IS
    pi      CONSTANT NUMBER:=3.14159;
    theta NUMBER;
    distX  NUMBER;
    distY  NUMBER;
    distZ  NUMBER;
    distP  NUMBER;
    BEGIN
    theta :=longA - longB;
    distX :=sin( latA * PI /180) * sin ( latB * PI /180) + cos ( latA * PI/180) * cos ( latB * PI/180) * cos ( theta * PI / 180);
    distY :=acos(distX); --this is arc cosine
    distZ :=distY * 180/PI;  --PI refers to the mathematical PI
    distP :=distZ * 60 * 1.1515; --this value should be returned. Of course the intermediate variable names don't matter.
    RETURN distP;
    END;Edited by: Ora on May 3, 2011 11:46 PM

Maybe you are looking for

  • Location of Podcast downloads correct but name is wrong

    Recently when I download Podcasts into iTunes they show up with an exclamation point indicating that the location can not be found and offering me the opportunity to locate the file. I can go into the correct directory and the file is there but it is

  • Bug in ios 7 music app

    Hello community, I have a problem with the ios 7 iphone 5 music app. I have a lot of albums with various artists. The various artists are in the wrong genre... For example genre->classical->various artists->Dr.Dre albums... All various albums are in

  • Insufficient Priviliege on updating wwv_flow_file_objects$

    Hello, I created a file upload form. After the file being uploaded, I need to change the file name in wwv_flow_file_objects$. But it shows insufficient prvilliege. Is there anyway I can do it? UPDATE wwv_flow_files SET FILENAME = filename WHERE NAME

  • Proft centre error

    hi while goods inward im getting error 'profit centre xxx doesnt exist for 3.12.2007' we maintained profit centre in material, but error showing with other prifit centre number  doesnt exis. plz give me solution urgent, advance thanks, reddy

  • BADI & OO ABAP Material

    hi can any one send me the material Regarding BADI & OO ABAP Concepts........ Thanks in advance........ my mail id is: <b>[email protected]</b> Regards, Ravi