Problem creating a user defined function...

I have written a function in oracle as follows:
===========================
CREATE OR REPLACE
function getTeacherNameForHmroomAndSch(in_student_id STUDENTS.STU_ID%TYPE)
return varchar2 as
emp_full_name varchar2(64);
begin
     stu_school_id STUDENTS.STU_CURRENT_SCHOOL_ID%TYPE;
     stu_home_room STUDENTS.STU_HOMEROOM%TYPE;
     emp_id EMPLOYEES.EMPLOYEE_ID%TYPE;     
     select STU_CURRENT_SCHOOL_ID, STU_HOMEROOM INTO stu_school_id, stu_home_room from STUDENTS where STU_ID = in_student_id;
     select el1.TL_EMPLOYEE_ID into emp_id from EMPLOYEE_LOCATIONS el1
     where el1.TL_ID = (select max(el2.TL_ID) from (select el.TL_ID
     from EMPLOYEE_LOCATIONS el
     where el.TL_LOCATION_ID = stu_school_id
     and el.TL_HOMEROOM = stu_home_room) el2 group by el2.TL_ID);
     select case when FIRST_NAME is null then LAST_NAME else FIRST_NAME || ' ' || LAST_NAME end into emp_full_name from EMPLOYEES where EMPLOYEE_ID = emp_id;
     return emp_full_name;
     EXCEPTION
          WHEN NO_DATA_FOUND THEN
          RETURN null;
end getTeacherNameForHmroomAndSch;
===========================
When I am executing this create function i.e., compiling function in a SQL Editor, the SQL engine is throwing a warning message as follows:
===========================
Warnings: --->
W (1): Warning: execution completed with warning
<---
===========================
As a result, am not able to use this function in my SQL.
Please suggest a solution for my problem.
Thank You.
Shravan Kumar.M

Hello,
It is possible to create user fields using SDK on anykind of table but, sometimes in some Tables, adding them causes integrity problems and B1 cannot create the document of the Table, you can try that, but if there's an error when adding the bank statement you should erase it from the OBNK table using SDK again.
I've tried this on MRV1 (Inventory Revaluation Lines) and IPF2 (Landed Costs, Costs), when I tried to add the document (Inventory Revaluation or Landed Costs) appeared an error and B1 could not create the document, so i had to remove them with SDK again and the error was solved.
Best Regards hope it'll help you
Gabriela

Similar Messages

  • How do you create a user defined functions  UDF and passing a value like a ID to GEt a Value.

    How do you create a user defined functions UDF and passing a
    value like a ID to GEt a Value.
    using a query.
    are there example.
    Thanks

    tons of examples at cflib.org - good place to start, even
    though many
    udfs there are a bit outdated in their code...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • How to call User defined functions in Mathscript Node ?

    Hi,
    I have created a user defined function and saved it to Search path of Labview as an M file. If I run my program in Math script window, the function is recognized and the program works properly. If I do the same with MathScript node , the user defined functions are not identified.
    Kindly help me with this problem. Thanks in advance
    Cheers
    Lenord Melvix

    This page may help:
    http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/caveats_recommendations_ms_search_...
    Kevin C.

  • User Defined Function is not recognizing java class in IR.

    Hi All,
    i have written one normal java class, and i imported that java class into IR using imported Archive as a .jar file,
    it will add just two values .
    now in message mapping i created one user defined function in that
    iam trying to call this java class. while testing it is showing error as cannot resolve symbol java class name
    so experts please help me in this or it would be appreciate if any one will provide
    step by step process of one java class and one USD just to add two numbers.
    thanks in advance,
    jasmine .

    Hi,
    The steps are as follows:
    1) Create a java file with .java extension.
    2)Compile it to create a .class file.
    3) Create a zip file for this .class file using any compressed archive program(ex-winrar)
    4) Upload this zip file as an imported archive ,save and activate.
    When you go to this archive,below , you can see your .class file with the older path,for below ex:
    ObjRecord.class     jxl/biff/drawing/
    you have to give following entry in imports section:
    jxl.biff.drawing.ObjRecord;
    Please try this and let us know if this works.
    Thanks.
    Regards,
    Shweta

  • User-defined function in FILTER clause

    hi,
    can i create the user-defined functions and use them in the FILTER clause in the sem_match function? there are some built-in functions for the FILTER clasue. however, only one function (DATATYPE(literal)) support for date/time in the built-in functions. i want to implement some user-defined funcitons in the FILTER clause which can check time intervals in ontology. there are some functions about valid time in the WorkSpace Manager such as WM_OVERLAPS, WM_CONTAINS,WM_MEETS, etc. so, can i write some functions using the these valid time functions in WM and use them in the FILTER clause? thanks a lot in advance.
    hong

    Hi Hong,
    You don't need user-defined functions to do time interval comparisons. You can directly compare xsd:dateTime values with the built-in comparison operators: <, >, =, !=, <=, >=
    For example, the query pattern below could find events that happened during event1 if we have data such as:
    :event1 :startTime "2013-01-01T03:15:00Z"^^xsd:dateTime .
    :event1 :endTime "2013-02-01T02:15:00Z"^^xsd:dateTime .
    :event2 :startTime "2013-01-11T14:15:00Z"^^xsd:dateTime .
    :event2 :startTime "2013-01-14T12:15:00Z"^^xsd:dateTime .
    SELECT ?e2
    WHERE
    { :event1 :startTime ?e1_st; :endTime ?e1_et .
    ?e2 :startTime ?e2_st; endTime ?e2_et .
    FILTER (?e1_st < ?e2_st && ?e2_et < ?e1_et) }
    In general, it is trivial to convert interval relations such as meets and overlaps to conditions on start and end times.
    Hope this helps.
    - Matt

  • User Defined Function Error - Can't find function

    Hi All,
    Version: 11.1.1.4
    I created a user defined function and added it to one of my BPEL Processes. I can see the function in JDeveloper and can compile the project without issue. We placed the jar file out on the SOA Server following the oracle user defined function examples. After placing the file out on weblogic I was able to successfully deploy the project.
    Oracle Deployment Steps:
    To deploy user-defined functions to runtime:
    1. Copy the user-defined function JAR files to BEA_Home/user_projects/domains/domain_name/lib or a subdirectory of lib.  Where domain_name is the name of the Oracle WebLogic Server domain (for example, soainfra).
    2. Restart the Oracle WebLogic Server.However, when I try to run the composite application I get the below error. I am not really sure why it can't find the Function? The jar is out on the server and the jar was added to the project?
    Error:
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is pnl:GetManager(string(bpws:getVariableData('inputVariable','payload','/client:process/client:input'))). The XPath expression failed to execute; the reason was: Function 'GetManager' not found.. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>Any suggestions would be greatly appreciated!
    Thanks,
    S
    Edited by: Scarpacci on Apr 1, 2011 6:06 AM

    try putting the jar location explicitly in weblogic server's classpath i.e. add BEA_Home/user_projects/domains/domain_name/lib to wls classpath and restart server.

  • USER DEFINED FUNCTION in the formula editor

    How do you create a USER DEFINED FUNCTION in the formula editor using BADI

    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/frameset.htm">This</a> may help.

  • Error in User defined function

    I have created a user defined function to make a call to SAP using JCo.
    But I am getting an error "package com.sap.mw.jco does not exist"
    Do we need to install JCo on our server?
    Thanks in advance

    Hallo Vijaya Kumari,
    if you use XI3.0 then you should check csn note 753294: 
    Symptom                                                                         
    A message mapping contains a user-defined function that uses a class            
    from the "com.sap.mw.jco", "sapxmltoolkit" or "com.sap.tc.Logging"              
    library. An error stating that the source code contains syntax errors           
    occurs when you test or activate the message mapping. When you use a            
    class from "com.sap.mw.jco", the system reports, for example, "package          
    com.sap.mw.jco does not exist".                                                 
    This error only occurs in systems containing a Support Package lower            
    than 5.                                                                               
    Solution                                                                        
    Import Support Package 5 or higher.                                             
    You can use the following workaround as a short-term solution: Upload           
    the library that is referenced in the message mapping into the software         
    component of the message mapping as an "imported archive". Do not               
    activate the "imported archive" with the library since it is not needed         
    for the runtime. The only purpose of the archive is to allow the message        
    mapping to be compiled. To avoid version conflicts with newer libraries,        
    you should delete the archive again after you import Support Package 5          
    or higher.
    In your case you will find the relevant jar file in the path
    [sap_j2ee_engine_installaltion_path]\cluster\server0\bin\ext\com.sap.mw.jco\jrfc.jar
    Regards Franz

  • How to use pl/sql code as ODI user defined function

    Hi All,
    i have a pl/sql code and i want to create ODI user defined function using this code .
    please find the pl/sql code below:
    ============================
    declare
    v_no_of_duplicate_rec number := 0;
    begin
    select count(*)
    into v_no_of_duplicate_rec
    from ( select 1
    from temp_pre_selections
    group by svb_number, selection_id
    having count(*) > 1);
    if v_no_of_duplicate_rec = 0 then
    return 'N';
    else
    return 'Y';
    end if;
    end if;
    ==========================
    please help me how to achieve the same .
    Thanks
    Vinod

    2 ways:
    a. implement logic in odi function directly: getCount, Oracle implementation:
    select case count(1) when 0 then 'N' else 'Y' end
    from hr.employees
    when you use this function to refresh a variable, the refresh statement should only be getCount, you shoueld not write select getCount from dual, otherwise it will become
    select select .... from ... from dual
    b. if your logic is complex, I suggest to write function directly in your database, then call this function in your ODI function
    eg:
    CREATE OR REPLACE FUNCTION hr.test RETURN varchar2 IS
    tmpVar NUMBER;
    BEGIN
    select count(1) into tmpVar from hr.employees;
    if tmpVar=0 then
    return 'N';
    else
    return 'Y';
    end if;
    END test;
    then create a ODI function, Oracle implementation is
    hr.test
    in your variable refresh statement, you can write select getCount from dual
    if you use the odi function in other locations expect for refreshing variable, the idea is similar

  • User-defined function in message mappings

    Hi experts,
    I'm a senior c++ programmer, but I never write program by abap/java.
    I want to create a user-defined function for mapping. Who can give me some instruction?
    Many thanks.

    SDN can. A simple search on SDN could provide you the steps and code as well. Try a search and come up with more specific doubts. I am sure most of the doubts would be gone.
    Regards,
    Prateek

  • Getting "Unexpected end of formula" error in user-defined function

    I created a user-defined function and registered it successfully in Discoverer Admin (10g), and it shows up in Discoverer Plus. However, when I call the function, I get this error:
    "Error in formula -- unexpected end of formula"
    If I hard-code in parameters, I can successfully run the function as such from Oracle SQL Developer:
    SELECT PAYLINETOT('2324', '111', to_date('01-Sep-2010'), to_date('31-Oct-2010'))
    FROM DUAL;
    But I still get the same error if I enter this in the calculation dialog in Discoverer:
    PAYLINETOT('2324', '111', to_date('01-Sep-2010'), to_date('31-Oct-2010'))
    Any idea what's going on and how to get this to work?

    Michael,
    I tried your suggestion, and this time I got a different error message that said that the function had not been registered with the EUL. I thought I had registered it, but when I checked, the return data type was wrong. I corrected it, and the function is "valid" in Discoverer Admin. Yet, when I go back to Discoverer Plus and attempt to use the function (and yes, I logged out and logged back in), I get the same error message:
    "Error in formula - unexpected end of formula - Error: Function PAYLINETOT has not been registered with the EUL."
    Any idea where the disconnect is? Are these two separate errors? How could Discoverer Admin tell me that the function is registered and Discoverer Plus tell me otherwise? And yes, I've made sure that the "Available in Desktop/Plus" checkbox is checked.

  • Matscript node void ouputs when calling user-defined functions

    Hi,
    I have a (for most of you, probably simple) problem with calling user defined function within a mathscript node.
    I have a script inside a MathScript node which calls three UD functions. When I try to output variables, LabView sets their type to void, so I cannot use them further. this would imply, that the script is nondeterministic, (since the types would get set at runtime). However, if I replace the call to the UD function with the actual contents of the function, the variable becomes deterministic. Now, since I have several call to these functions, I have no desire in writing all of them many time, introducing many variables etc. What would you advise me to do?
    Find attached my scripts and functions.
    I need this script running on a RT Target, and have been battling this for weeks, with almost no success!
    Thanks, Regards,
    Luka
    Attachments:
    Scripts.zip ‏2 KB

    MArtin, hello!
    As far as I know, LabView checks the syntax as you write in the MS Node, and since there is no X mark next to the line number, it indicates, that the syntax is correct. Since i have set the path to the UDF in both the VI options and in the general MAthScript setting, how does adding the path command help? even if I add path('directory') command, a yellow exclamation mark appears, saying the command is slowing down performance.
    (this is the original help explanation:
    The warning glyph indicates that LabVIEW operates with reduced error checking at edit time and slower run-time performance for the MathScript Node. The following conditions cause the warning glyph to appear. To remove the warning glyph from the MathScript Node and improve run-time performance, modify your script as follows to resolve the condition in your script:
    Your script calls addpath or pathremove (legacy name rmpath), or calls cd, path, or userpath with one or more inputs, which change the MathScript search path list at run time. Remove these functions and use the MathScript page to configure the default search path)
     Could you please post a screenshot of your VI, just to see, if you've got anything different set up?
    I am running LV2012.
    Luka

  • About User defined Functions

    Hi,
    Do anyone know what are user defined functions .. and what's the procedure to create a user defined function in sql or pl/sql ??
    Regards

    Is this Seshu or someone else asking with his login? The reason for this is earlier there was a post from some Param Reddy from Kurnool asking with his login.
    If it is Seshu himself, I've seen you using the word 'function' a couple of time earlier.
    Re: Comma separation
    and
    Re: Data Hiding
    If you go and see in SQL Reference, you find two types of functions. SQL built-in and User-defined.
    Cheers
    Sarma.

  • How to migrate User Define Function to another mapping in other namespace

    Hi Everybody
    I have define many User Define Functions in mapping
    How can i use them in other mapping
    Thank you in advance

    Hi,
    I tried to explain the steps.
    1. Take the JAVA code of your User-Defined Functions
    2. Go to a JAVA editor (e.g NWDS, Eclipse, etc...)
    2.1. create a Java project
    2.2. create a Java class
    2.3. inside your Java class, put each JAVA code of your User-Defined Function inside a Method
    2.4. Export your Java class to a JAR file (e.g my_tools.jar)
    3. Go to IR
    3.1 create an Imported Archive (IA) and upload your JAR file.
    3.2 in this IA, you see your Java class which contains all your methods.
    4. inside your mapping,
    4.1 create a User-Defined Function <u>and import</u> your class
    4.2 use your method.
    So, you define in only one place your code (thanks to a IA) and you will be able to use it inside several mappings.
    I hope I don't forget steps...
    Advantage: if tomorrow, you want to create a new function, just add a new method to your Java class and re-import your JAR file
    Oh, I missed: your IA must be created inside a specific Software Component (SC__TOOLS) and this one must be linked with the others by a "Usage dependency", else your IA will be recognise only in one Software Component (and maybe only in one namespace)
    Mickael

  • Idoc to cXMLmapping..user defined function help

    hello Everybody,
                              I am new to XI and I am working on a new mapping.  In a nutshell, the requirement is to concat the TDLine of segment E1EDPT2 and map the data to comments of the cXML. The segment E1EDPT2 is segment in E1EDP01( Purchase Order line item segment) This the data that is coming from the vendor text of the SRM system.  This needs to repeat for each line item in the Purchase Order.  I have created a user defined function which concats the TD lines but I am not able to differenciate the tD line for other line items.  Please help.  I would appreciate it if anyone could share the User Defined function which suits my needs.
    Thanks!
    <E1EDP01>  (PO lIne Item 1)
         <E1EDPT1 SEGMENT="1">
              <TDID>F01</TDID>
              <TSSPRAS>E</TSSPRAS>
              <TSSPRAS_ISO>EN</TSSPRAS_ISO>
           <E1EDPT2 SEGMENT="1">
                 <TDLINE>XI mapping test - Newline1</TDLINE>
                 <TDFORMAT>*</TDFORMAT>
           </E1EDPT2>
           <E1EDPT2 SEGMENT="1">
                 <TDLINE>Line1- text2 end</TDLINE>
                 <TDFORMAT>*</TDFORMAT>
           </E1EDPT2>
           <E1EDPT2 SEGMENT="1">
                 <TDLINE>Line1 - text3</TDLINE>
                <TDFORMAT>*</TDFORMAT>
           </E1EDPT2>
         </E1EDPT1>
    </E1EDP01>
    <E1EDP01>  ( PO lien item 2)   
         <E1EDPT1 SEGMENT="1">
              <TDID>F01</TDID>
              <TSSPRAS>E</TSSPRAS>
              <TSSPRAS_ISO>EN</TSSPRAS_ISO>
         <E1EDPT2 SEGMENT="1">
               <TDLINE>XI mapping test - line2</TDLINE>
               <TDFORMAT>*</TDFORMAT>
         </E1EDPT2>
      </E1EDPT1>
    </E1EDP01>

    Hi,
    Please create context UDF which will concatenate all TDLine. Afterwards pass to this function TDLine with changed context to E1EDPT1.
    In this function you need to concat full input array.
    Regards,
    Wojciech

Maybe you are looking for

  • Process order sceduling parameters

    Dear gurus, In my process order ,in scheduling the time is not being taken though we have maintained parameters in resource and recipe. Can anybody help?

  • One Application that does everything?

    Why can't Microsoft gives an application that do everything, not forcing anyone to use the cloud like a simple file transfer which a symbian phone can do by PCsuites alone? I believe its pretty dumb going around just to transfer file aside from video

  • Contract Management

    Hi All, Can anyone help me out with the documents related to Contract Management in SRM like config guides and other doc's. please send them to my id <removed by moderator> Thanks, James

  • Adding New field to structure GOITEM in MIGO transaction

    Hello everyone, I am in need to add fields ekpo-uebto ,ekpo-untto to GOITEM and want it to get display in migo tablecontrol under header detail. How it  can  be done, please tell me. Hope I am clear. Regards, Jeet Chauhan

  • Why does my iphone not show in tunes when on same wireless network

    why does my ipad, and my two iphones not show in itunes on the same wireless network