Executing DB2 Functions

Hi ,
Is there a way to execute DB2 functions or procedures as part of process flow. OWB 11.2 allows to import but how is it executed ??
Connection is Native via JDBC drivers.
Thanks,
Jason.

Hi David
Thanks for the reply. Can the function be published as web service and called in process flow ? There is an option when i right click the function but when i try to publish it throws error. Is that only for Oracle functions ?
Thanks
Jason

Similar Messages

  • Is it possible to excute DB2 function from ODI

    Is it possible to execute DB2 function from ODI.
    If it is could you please help me how to proceed
    Thanks

    if it is a function which is used in SQL, then you just use it in the mapping, as you would normally.
    If it is a stored procedure, then you may need to execute it in a procedure.

  • Error while executing the function module BAPI_RE_CN_CREATE

    Dear All
    I was using the the function module BAPI_RE_CN_CREATE.  When I am trying to execute the function module I am getting the error message u201CBusiness transaction RECN doest existu201D. While inputting the parameters for the function module I have given RECN   In the input field TRANS. Requesting you to please kindly suggest.
    Regards.
    Varaprasad

    Hi Varaprasad,
    please try the following.
    1. Create a contract manually in the system
    2. Use BAPI_RE_CN_GET_DETAIL to show how the fields and structures are filled.
    3. Check and change the parameters for BAPI_RE_CN_CREATE accordingly.
    Hope that helps.
    Regards, Franz

  • Error while executing the function

    hi,
    I have a table with the following data.
    T_1          T_2 T_3        T_4
    a.1            1 aa         ff
    a.1            2 ab         ff
    a.2            1 ba         ff
    a.2            2 bb         ff
    a.2            3 bc         ff
    a.2            4 bd         ff
    a.3            1 ca         ff
    a.3            3 cc         ff
    a.4            2 db         ffi want the data in the following way.
    col_1       col_2         col3
    a.1         1,2             aa ,ab
    a.2         1,2 ,3,4       ba,bb,bc,bd
    a.3         1,3             ca,cc
    a.4         2                db         For this , i have written a package as shown below.
    create or replace package t_emp_pkg as
    type typ_emp is record
    tv_t_1 t_Emp.t_1%type,
    tv_t_2 varchar2(20),
    tv_t_3 varchar2(20));
    type typ_emp_tab is table of typ_emp;
    function t_emp_func(pv_value in varchar2) return typ_emp_tab;
    end t_emp_pkg;
    create or replace package body t_emp_pkg as
    function t_emp_func(pv_value in varchar2) return typ_emp_Tab is
    cursor c1(v_value varchar2) is
    select distinct t_1 from t_emp where t_4 = v_value ;
    cursor c2(pv_t_1 varchar2) is
    select t_2,t_3 from t_emp
    where t_1 = pv_t_1;
    typ_emp_table typ_emp_tab := typ_emp_tab();
    t_count number := 0;
    c1_cur_rec c1%rowtype;
    c2_cur_rec c2%rowtype;
    v_temp_value1 varchar2(30);
    v_temp_value2 varchar2(30);
    begin
    open c1(pv_value);
    loop
    fetch c1 into c1_cur_rec;
    exit when c1%notfound;
    v_temp_value1 := null;
    v_temp_value2 := null;
    open c2(c1_cur_rec.t_1);
    loop
    fetch c2 into c2_cur_rec;
    exit when c2%notfound;
    v_temp_value1 := v_temp_value1||','||c2_cur_rec.t_2;
    v_temp_value2 := v_temp_value2||','||c2_cur_rec.t_3;
    end loop;
    --close c2;
    t_count := t_count+1;
    typ_emp_table(t_count).tv_t_1 := c1_cur_rec.t_1;
    typ_emp_table(t_count).tv_t_2 := v_temp_value1;
    typ_emp_table(t_count).tv_t_3 := v_temp_value2;
    --dbms_output.put_line(typ_emp_table(t_count).tv_t_1);
    --dbms_output.put_line(typ_emp_table(t_count).tv_t_2);
    --dbms_output.put_line(typ_emp_table(t_count).tv_t_3);
    end loop;
    close c1;
    return typ_emp_table;
    end;
    end;
    When i executed the function , i got the following error.
    SQL> declare
    2 v t_emp_pkg.typ_emp_tab := t_emp_pkg.typ_emp_tab();
    3 begin
    4 v := t_emp_pkg.t_emp_func('ff');
    5 for i in v.first..v.last loop
    6 dbms_output.put_line(v(i).tv_t_1 ||', '||v(i).tv_t_2||', '||v(i).tv_t_3);
    7 end loop;
    8 end;
    9 /
    declare
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at "SCOTT.T_EMP_PKG", line 30
    ORA-06512: at line 4
    but when i am running this queries in anonymous block (i.e) using declare,begin,end , i am getting the data correctly.
      1  declare
      2  pv_value varchar2(5) := 'ff';
      3   cursor c1(v_value varchar2) is
      4  select distinct t_1 from t_emp where t_4 = v_value ;
      5  cursor c2(pv_t_1 varchar2) is
      6  select t_2,t_3 from t_emp
      7  where t_1 = pv_t_1;
      8  --typ_emp_table typ_emp_tab := typ_emp_tab();
      9  t_count number := 0;
    10  c1_cur_rec c1%rowtype;
    11  c2_cur_rec c2%rowtype;
    12  v_temp_value1 varchar2(300);
    13  v_temp_value2 varchar2(300);
    14  begin
    15  open c1(pv_value);
    16  loop
    17  fetch c1 into c1_cur_rec;
    18  exit when c1%notfound;
    19  v_temp_value1 := null;
    20  v_temp_value2 := null;
    21  open c2(c1_cur_rec.t_1);
    22  loop
    23  fetch c2 into c2_cur_rec;
    24  exit when c2%notfound;
    25  v_temp_value1 := v_temp_value1||','||c2_cur_rec.t_2;
    26  v_temp_value2 := v_temp_value2||','||c2_cur_rec.t_3;
    27  end loop;
    28  close c2;
    29  t_count := t_count+1;
    30  --typ_emp_table(t_count).tv_t_1 := c1_cur_rec.t_1;
    31  --typ_emp_table(t_count).tv_t_2 := v_temp_value1;
    32  --typ_emp_table(t_count).tv_t_3 := v_temp_value2;
    33  dbms_output.put_line(c1_cur_rec.t_1);
    34  dbms_output.put_line(v_temp_value1);
    35  dbms_output.put_line(v_temp_value2);
    36  end loop;
    37  close c1;
    38* end;
    39  /
    a.2
    ,1,2,3,4
    ,ba,bb,bc,bd
    a.3
    ,1,3
    ,ca,cc
    a.4
    ,2
    ,db
    a.1
    ,1,2
    ,aa,ab
    PL/SQL procedure successfully completed.So can anybody tell me why it is not executing correctly when executing as a function.
    Thanks in advance.

    hi devmiral,
    I am not sure exactly where i am making the mistake. I have modified the package but still i am getting the error.
    create or replace package body t_emp_pkg as
    function t_emp_func(pv_value in varchar2) return typ_emp_Tab is
    cursor c1(v_value varchar2) is
    select distinct t_1 from t_emp where t_4 = v_value ;
    cursor c2(pv_t_1 varchar2) is
    select t_2,t_3 from t_emp
    where t_1 = pv_t_1;
    typ_emp_table typ_emp_tab ;
    --:= typ_emp_tab();
    t_count number := 0;
    c1_cur_rec c1%rowtype;
    c2_cur_rec c2%rowtype;
    v_temp_value1 varchar2(30);
    v_temp_value2 varchar2(30);
    begin
    open c1(pv_value);
    loop
    fetch c1 into c1_cur_rec;
    exit when c1%notfound;
    v_temp_value1 := null;
    v_temp_value2 := null;
    open c2(c1_cur_rec.t_1);
    loop
    fetch c2 into c2_cur_rec;
    exit when c2%notfound;
    v_temp_value1 := v_temp_value1||','||c2_cur_rec.t_2;
    v_temp_value2 := v_temp_value2||','||c2_cur_rec.t_3;
    end loop;
    --close c2;
    t_count := t_count+1;
    typ_emp_table(t_count).tv_t_1 := c1_cur_rec.t_1;
    typ_emp_table(t_count).tv_t_2 := v_temp_value1;
    typ_emp_table(t_count).tv_t_3 := v_temp_value2;
    typ_emp_table := typ_emp_tab(c1_cur_rec.t_1,v_temp_value1,v_temp_value2);
    typ_emp_table.extend;
    end loop;
    close c1;
    return typ_emp_table;
    end;
    end;
    SQL> @t_emp_pkg_body.sql
    Warning: Package Body created with compilation errors.
    SQL> sho err
    Errors for PACKAGE BODY T_EMP_PKG:
    LINE/COL ERROR
    36/1     PL/SQL: Statement ignored
    36/18    PLS-00306: wrong number or types of arguments in call to
             'TYP_EMP_TAB'
    36/18    PLS-00306: wrong number or types of arguments in call to
             'TYP_EMP_TAB'
    36/18    PLS-00306: wrong number or types of arguments in call to
             'TYP_EMP_TAB'Thanks in advance.

  • Error while executing planning Function

    Hi All,
    I'm getting some error while executing planning function. Below are errors. Please check and provide solution.
    Errors occurred when executing planning function RTFMPF01/RTFMPG01
    Value 08 of chara Region does not correspond to the attrib.val MI of chara Store
    Value 10 of chara Region does not correspond to the attrib.val RM of chara Store
    Value 11 of chara Region does not correspond to the attrib.val NA of chara Store
    Thanks,
    Vamsi

    Hi,
    Value 08 of chara Region does not correspond to the attrib.val MI of chara Store
    Looks like there is a characteristics relationship which derives the attribute store from Region.
    Check the master data for Region for attribute Store and the corresponding values.
    The values that are maintained in the master data will only be allowed to enter in the cube.
    Thanks
    pratyush

  • Macro Error while executing planning functions or saving data

    Dear All,
    I am getting following error in BEx Analyzer while executing planning function or pressing a save button.
    Note: Excel is 2007 version.
    Cannot run the macro "XXXXXX.xlsx". The macro may not be available in this workbook or all macros may be disabled.
    I changed the settings in Macro Settings (Office Button -> Excel Options -> Trust Center -> Trust Center Settings-> Macro Settings) eventhough it is showing that above message.
    selected ->
    Enalble all macros
    Trust access to VBA project object model.
    If anybody faced this issue kindly reply to this.
    Best Regards,
    SG

    Hello everybody,
    i am facing exactlythe same issue! I am currently running GUI Patch Level 14 and BI Add on Patch Level 10.
    I have also adjusted all necessary settings in Excel Options like Activate all Macros and Trust VBA Coding.
    Does anybody have another Solution.
    As mentioned before Gui Patch 13 and BI Add On Patch 10 obviously arent the solutiuon.
    Best regards
    Janos

  • How to create and execute a function whose return value is  a table

    hi folks ,
    i would like know how to create and execute a function whose return value is a table ,
    am new to pl/sql ,
    my statement for the function is
    SELECT ct.credential_code, c.expiration_date
    FROM certifications c, credential_types ct
    WHERE ct.crdnt_id = c.crdnt_id
    AND c.person_id = person_id;
    i would like to have the result of the above query as return value for the function.
    Thanks in advance ,
    Ashok.c

    hi Ps ,
    Can you please do small sample ,
    that would help me in clear understanding
    thanks in advance
    ashok.c

  • Can I execute a function module in my  Webdynpro App ?

    Hi,
    Can I execute a function module in my Webdynpro App ?  I mean, it's not a BAPI.
    Is it possible ?   which is the procedure to follow ?  (comparing to a bapi procedure).
    Thanks for your help !
    Regards from Mexico.  =)
    Diego

    Hi Diego,
    the warning icon indicates that you're using a function module that has not been externally released. If the corresponding function module has been defined by SAP, its interface might be changed in an incompatible way within one of the next releases, e.g. removing / renaming a parameter or structure field. Stability is only guaranteed for BAPIs or external released function modules.
    From the point of view of the model import it does not make any difference. If import does not work, there seems to be some other problem. Maybe the function module has not been activated in the R/3 system. Or check the log file or the import log page which will be the last page of the import wizard.
    You might want to import some other none external released function module in order to verify that model import of these kind of function module works.
    Kind regards,
    Lothar Bender

  • How to use db2 function in the HQL

    hello
    i am newbie to hibernate, now i am choosing a solution for my project, in this project, it use db2 function in the sql clause as follow:
    insert into idstool.access(userid,node,password) values('userid','nodename',encrypt('password','nodename'));
    i wonder if i can implement such function by using hibernate, that is if hibrenate can use the db2 function, or user-defined sql functions? if yes, how?
    thanks for any helps

    I think you'll find that you can do this through HQL. You also have the option of invoking a stored procedure or invoking native SQL in tandem with the normal Hibernate options.

  • Calling and executing a function module in the Portal iview development

    Hello Portal development gurus...
        I am very new to portal iview development and am learning a lot of stuff.. I now have a requirement to do the following:
      1. I need to use the NWDS to create java code in developing an iview
      2. I need to call and execute a function module and display the parameters pulled in from the function module onto a Jsp.
    3. I need to create an iview based on this deployed component.
    Could anybody please explain me how to do the coding on this front?
    I appreciate if anybody can share documentation about this kind of a development.
    As always, points galore for useful and helpful suggestions.
    Regards,
    ~~~LB

    Hi,
    Firstly Have you searched in SDN for the same, anyhow please go through the link to work on the requirement
    [/docs/DOC-8061#15|/docs/DOC-8061#15]
    Go through the thread which will talk in detail
    [https://forums.sdn.sap.com/click.jspa?searchID=19551584&messageID=6348955|https://forums.sdn.sap.com/click.jspa?searchID=19551584&messageID=6348955]
    Hope this helps.
    Cheers-
    Pramod

  • How to execute a function and return the result into a bind variable

    Hi,
    I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
    create or replace function total_income
    +(v_job_id IN varchar2)+
    RETURN number IS
    v_total number(6);
    cursor get_sal is
    select salary from employees
    where job_id = v_job_id;
    BEGIN
    v_total := 0;
    for emp in get_sal
    loop
    v_total := v_total emp.salary;+
    end loop;
    dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
    return v_total;
    END;
    Now I woud like to execute this function and assign the returned value into a bind variable test_sal
    variable test_sal number(6)
    SELECT total_income('AD_VP') into :test_sal FROM DUAL;
    dbms_output.put_line('Total Sal:'||:test_sal);
    This is returning the below errors:
    SELECT total_income('AD_VP') into :test_sal FROM DUAL
    *+
    Error at line 0
    ORA-01036: illegal variable name/number
    dbms_output.put_line('Total Sal:'||:test_sal);
    Error at line 3
    ORA-00900: invalid SQL statement
    Could someone help me what could be the problem?? Thanks for your time...

    Dear,
    If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
    The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
    So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
    Best regards
    Mohamed Houri

  • Re-executing a function in IP web: buffer problem

    Hello everybody,
    we have performed 2 changes to our application:
    1. for performance reasons we replaced a FOX function with an IP exit function and
    2. to limit the number of entires appearing in F4 (000's) in the web application when selecting mater data for filtering we inserted a new InfoObject for the selection with only a few (about 10) master data entries and then passed the variable values to the original infoobject
    Both changes work well but there is a nasty side effect.
    The INITIAL execution of the query (variable pop-up) and filtering in the web application works fine. The user enters data manually and executes a function performing some caluculations (was FOX, is now an IP exit function).
    After this initial execution of the function it is not possible to re-execute the function. If e.g. the user performs a few more manual changes and then tries to execute the function again nothing happens. Only be logging off and on again (i.e. a new session) the user can execute the function again.
    Cache mode for the query (in RSRT) is set to 0 (=inactive).
    It is obviously a  buffer problem (some sort of delta/plan buffer conflict) and I have had this before but I cannot recall how to solve it ... its the age!
    Grateful for any assistance
    Edited by: Martin Helmstein on Nov 10, 2010 11:07 AM
    Clarification: if the user repeats inputting data under the INITIAL filter selection state and executes the function again it works. The problem only occurs if the user changes the filters (drop down boxes in the web application), inputs data and attempts to execute the function with this new selection.

    Hi Martin,
    One easy way of solving is to include the WAD command TRANSFER_STATE at the end of all the Planning function / Sequence commands attached to the Button.
    This will refresh the WAD layout without having to reenter the variable values if any.
    The other Option is to reset all the variables associated with the execution of Planning function after every execution.
    This can be included under Web template Properties so this happens after every refresh of the layout.
    Hope this helps.
    Regards.
    Shafi.

  • Execute a function in SQL Worksheet

    How can I execute a function in SQL Worksheet.
    The function takes in two parameters of type varchar2 and returns a boolean.
    the syntax is:
    set serveroutput on
    VARIABLE x BOOLEAN;
    EXECUTE :x := check_number('78','A');
    PRINT x ;
    my error is:
    SP2-0552: Bind variable "X" not declared.
    I have also tried:
    set serveroutput on
    select check_number('78','A')
    from dual;
    my error is:
    ERROR at line 1:
    ORA-06552: PL/SQL: Statement ignored
    ORA-06553: PLS-382: expression is of wrong type
    thanks.

    You could even cut out the variable:
    SQL> CREATE OR REPLACE FUNCTION is_true
      2     ( p1 VARCHAR2
      3     , p2 VARCHAR2 )
      4     RETURN BOOLEAN
      5  AS
      6  BEGIN
      7     RETURN p1 = p2;
      8  END is_true;
      9  /
    Function created.
    SQL> exec dbms_output.put_line(sys.diutil.bool_to_int(IS_TRUE('x','y')))
    0
    PL/SQL procedure successfully completed.
    SQL> exec dbms_output.put_line(sys.diutil.bool_to_int(IS_TRUE('x','x')))
    1
    PL/SQL procedure successfully completed.

  • Can I Execute a function whose name is stored in a string variable?

    Can I execute a function whose name is stored in a string variable?
    Like
    Depending on the condition I will stroed the name of the function in a string variable. Then using that string variable i want to execute the function.
    String str=��
    iVal an int can take ne value
    Switch(iVal)
    Case 1:
    str=�test1()�;
    Case 2:
    str=�test2()�;
    I want whatever function name is in str to be executed.
    ----------------------------------------------------------------------------------

    For just executing a method or two, reflection might be easier than beanshell (or it might not). For executing entire scripts, beanshell will be preferable over reflection.
    (I assume beanshell uses reflection under the hood, but I've never bothered to peek.)

  • Execute a function module from sapportal without to create the users in R/3

    I have a pdk application in sapportal. This pdk application will be execute for any sapportal users which don't have R/3 users. The problem is the follow.. in this pdk application there is a R/3 function module that must be execute, ¿how can i execute this function module without to create the users in R/3?

    Hi Michael,
    Create a JSP dyn page application. Hope you have the table name and in R/3 there will be Function modules already available which we also can reffer.
    Then from this JSP dyn page application, call this particular function table.
    wE DON'T  have to create a user for this.
    Regards
    Arun Jacob
    P.S please award points for helpful suggestions.

Maybe you are looking for

  • My iPhone 3GS is not backing up to iCloud.. Help, please?

    So I jusy got my iPhone back after not using it for 8 months. I tried to do an iCloud backup and it didn't work. I tired several times more and finally went online to see if there was a solution. I've tried everything I could find. I erased all my da

  • Gmail acct suddenly not syncing

    I'd been using Gmail via the Mail app as an Exchange account with no problem, as well as gmail's Contacts and Calendars, and suddenly this morning it's not working. I can access Gmail in Safari fine, and do not have 2-step verification enabled. I res

  • Java Runtime Environment

    Hello, A window often pops up on the screen of my Macbook, asking (I translate as I can from french): " to show this web content, install the environment Java Runtime Environment." What can I do? How can I get rid of it? Thanks for your help. Antoine

  • "PSE 12"dov'è isola primo piano?

    ho acquistato PSE 12 ma non Trovo isola Primo piano.dov 'e?

  • Bug 2.1: Export to Excel fails: no valid colums available...

    Hello, I read some threads about the error No valid columns available for export, we do not currently support clob or blob columnsand none of the workarounds work for me [Create View|http://forums.oracle.com/forums/thread.jspa?messageID=3829495]: I o