Error passing in RECORD type into API

Gurus,
Getting the following error when I try and pass a RECORD type into an API. Am I passing it in properly?
Any help is appreciated.
Thanks,
-Scott
Here's my error:
fnd_descr_flex_col_usage_pkg.load_row
ERROR at line 21:
ORA-06550: line 21, column 4:
PLS-00306: wrong number or types of arguments in call to 'LOAD_ROW'
ORA-06550: line 21, column 4:
PL/SQL: Statement ignored
Here's my anon block:
declare
TYPE who_type IS RECORD
created_by NUMBER,
creation_date DATE,
last_updated_by NUMBER,
last_update_date DATE,
last_update_login NUMBER
v_who_type who_type;
v_sysdate date;
begin
select sysdate
into v_sysdate
from dual;
v_who_type.created_by := 0;
v_who_type.creation_date := v_sysdate;
v_who_type.last_updated_by := 0;
v_who_type.last_update_date := v_sysdate;
v_who_type.last_update_login := 0;
fnd_descr_flex_col_usage_pkg.load_row
(x_application_short_name => 'SPL',
x_descriptive_flexfield_name => 'HR_LOCATIONS' ,
x_descriptive_flex_context_cod => '441',
x_application_column_name => 'ATTRIBUTE5',
x_who                          =>  v_who_type,
x_end_user_column_name => 'District',
x_column_seq_num => 10,
x_enabled_flag => 'Y',
x_required_flag => 'N',
x_security_enabled_flag => 'N',
x_display_flag => 'Y',
x_display_size => 50,
x_maximum_description_len => 50,
x_concatenation_description_le => 25,
x_flex_value_set_name => '50 Characters',
x_range_code => '',
x_default_type => '',
x_default_value => '',
x_runtime_property_function => '',
x_srw_param => '',
x_form_left_prompt => 'District',
x_form_above_prompt => 'District',
x_description => '');
...

I followed Tubby's advice and called the package to which the RECORD type was defined, however, I'm getting a "no data found" error in the called package. The purpose of "internally" definining the record type inside my Anon block was so that I could assign variables locally.
Help from you gurus would be greatly appreciated!
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "APPS.FND_DESCR_FLEX_COL_USAGE_PKG", line 508
ORA-06512: at line 21
Please do not refer me to any more EBS forums or links.  This is a coding question, not an EBS question.
For the guy who asked, here is the procedure definition:
PROCEDURE load_row
(x_application_short_name IN VARCHAR2,
x_descriptive_flexfield_name IN VARCHAR2,
x_descriptive_flex_context_cod IN VARCHAR2,
x_application_column_name IN VARCHAR2,
x_who IN fnd_flex_loader_apis.who_type,
x_end_user_column_name IN VARCHAR2,
x_column_seq_num IN NUMBER,
x_enabled_flag IN VARCHAR2,
x_required_flag IN VARCHAR2,
x_security_enabled_flag IN VARCHAR2,
x_display_flag IN VARCHAR2,
x_display_size IN NUMBER,
x_maximum_description_len IN NUMBER,
x_concatenation_description_le IN NUMBER,
x_flex_value_set_name IN VARCHAR2,
x_range_code IN VARCHAR2,
x_default_type IN VARCHAR2,
x_default_value IN VARCHAR2,
x_runtime_property_function IN VARCHAR2,
x_srw_param IN VARCHAR2,
x_form_left_prompt IN VARCHAR2,
x_form_above_prompt IN VARCHAR2,
x_description IN VARCHAR2)

Similar Messages

  • Passing record type into function [error: identifier must be declared]

    Hi,
    I have a record type defined in my procedure
    type chk_tab is record(
    effect date,
    count number(9)
    type chk_typ is table of chk_tab index by binary integer;
    chk_typ_rec chk_typ;
    I have to pass the effect and count into another function, i tried doin as below:
    function name: func_chk_typ
    func_chk_typ(effect, count);
    this returns an saying "identifier effect needs to be declared"
    I am required to pass these values from the record type into the function, How can i over come this??
    Any help is very much appreciated.

    Hi Hemz,
    Find below code.
    Function Code:
    CREATE OR REPLACE FUNCTION fetch_band(eff in date,ineff in date)
    return number
    is
      lu_cb_sysid  NUMBER;
    BEGIN
    select fk_cb_sysid
    into lu_cb_sysid
    from ia_for_icon
    where cr_ans_date >= eff
    and cr_ans_date < ineff;
    RETURN lu_cb_sysid;
    END fetch_band;Procedure code. Here I have embedded the function.
    CREATE OR REPLACE procedure abc(a varchar, b number) is
      type cns_tab_record is record(
        eff   date,
        ineff date);
      type cns_tab_typ is table of cns_tab_record index by binary_integer;
      cns_tab cns_tab_typ;
      v_lu_cb_sysid NUMBER;
    BEGIN 
      -- Here you have to assign the values to your table type record.
      -- For example I am passing two values SYSDATE and SYSDATE - 10
      cns_tab(1).eff := SYSDATE;
      cns_tab(1).ineff := SYSDATE - 10;
      v_lu_cb_sysid:= fetch_band(cns_tab(1).eff, cns_tab(1).ineff);
    END abc;But I am just wondering why you are using table type datatype here.
    Hope above code will help you.
    Thanks,
    Suri

  • Pass a record type vaiable in out parameter of a function in a package

    Hi All,
    1.I have created a ecod inside a package.
    2.Then created a function which has a out parameter of the above record.
    3.Now package body i'm creating a dynamic cursor .
    4.My equirement is to fetch this dynamic cursor's value into the out parameter of the function.
    I have created the below code for 1,2 and 3 but not getting how to achive the point 4.
    create package pkg
    type t_rec is recod (id number,id_name varchar2(10));
    type t_data is table of t_rec index by binary_integer;
    act_data t_data;
    funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean;
    end pkg;
    create package body pkg
    funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean is
    p_cur sys_refcursor;
    l_text varchar2(100);
    begin
    -- As per my requirement i have built a dynamic l_text which contains where clause by taking dept and region values.In actual i have nearly 10 in paramaters with >which i'm building a dynamic where clause in l_text. So i'm using a ref cursor.
    open p_cur for 'select id,id_name from tab1'||l_text';
    fetch p_cur bulk collect into act_data;
    exception ....
    end pkg;Now as per the code snippet i could fetch all the rows returned by p_cur into act_data.
    But how i will pass it though out parameter in the function which i will use somewhere in front end to show data.
    Please help me in this.
    Thanks in advance.

    bp wrote:
    i need to create the where clause one the basis of the values of IN parameters.Sometimes i need to take count of the data on the basis of the IN parameters and if one of the conditions return value i will build where clause with those parameters.Please google and read up on the importance of creating shareable SQL - which needs to be done using bind variables.
    The ref cursor interface in PL/SQL only support a static/fixed number of bind variables. So if you want to create cursors with variable number of bind values, you need to use conditional processing. E.g.
    SQL> create or replace procedure EmpFilter( c OUT sys_refcursor, nameFilter varchar2, jobFilter varchar2 ) is
      2          sqlSelect       varchar2(32767);
      3  begin
      4          --// we pretend to built a dynamic SQL statement - so the table
      5          --// name and so on is "unknown"
      6          sqlSelect := 'select * from emp ';
      7          case
      8                  when nameFilter is null and jobFilter is null then
      9                          open c for sqlSelect;
    10
    11                  when nameFilter is null and jobFilter is not null then
    12                          sqlSelect := sqlSelect||'where job like :filter';
    13                          open c for sqlSelect  using jobFilter;
    14
    15                  when nameFilter is not null and jobFilter is null then
    16                          sqlSelect  := sqlSelect||'where ename like :filter';
    17                          open c for sqlSelect  using nameFilter;
    18
    19                  when  nameFilter is not null and jobFilter is not null then
    20                          sqlSelect  := sqlSelect||'where ename like :filter1 and job like :filter2';
    21                          open c for sqlSelect  using nameFilter, jobFilter;
    22
    23          end case;
    24
    25          DBMS_OUTPUT.put_line( 'Dynamic SQL: '||sqlSelect );
    26  end;
    27  /
    Procedure created.
    SQL>
    SQL>
    SQL> var c refcursor
    SQL> begin
      2          EmpFilter( :c, 'A%', null );
      3  end;
      4  /
    Dynamic SQL: select * from emp where ename like :filter
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7499 ALLEN      SALESMAN        7698 1981/02/20 00:00:00       1600        300         30
          7876 ADAMS      CLERK           7788 1987/05/23 00:00:00       1100                    20
    SQL>
    SQL> begin
      2          EmpFilter( :c, null, 'ANALYST' );
      3  end;
      4  /
    Dynamic SQL: select * from emp where job like :filter
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 1987/04/19 00:00:00       3000                    20
          7902 FORD       ANALYST         7566 1981/12/03 00:00:00       3000                    20
    SQL>And this approach is for external clients - where a Visual Basic or Java client program calls the database, executes the stored procedure, and receives a cursor handle in turn. And the client then fetches the output of this cursor and process it.
    There is no need to return a record type of any sorts. The client wants the cursor handle as that is the optimal and best interface for the client to receive database data.
    If the caller is not an external client, but another PL/SQL procedure, then this approach does not make much sense.
    It is important that you understand basic Oracle concepts and fundamentals. What a cursor is. What the best way is to process Oracle data. How to best use the basic features of Oracle. Without that basic understanding, you as good as a low hour Cessna pilot getting into an Airbus A400M - where the Cessna pilot would not even be able to start a single engine, never mind get the plane in the air.
    Likewise, without a basic understanding of Oracle cursors and fundamentals, you will be unable to code even a single line of sensible code. Not because you are a bad programmer. Even the best programmer in the world will be unable to write decent code, if the programmer has no idea how the environment works, what the concepts and fundamentals are. But it is fair to expect that a good programmer will no write such code, understand that there is a lack of knowledge, and address that accordingly.

  • Error passing bool/categorical parameter into web service

    I am working on publishing a web service to produce a prediction based on a model.  One of my parameters is whether or not a given day is a holiday, which was a boolean (TRUE / FALSE) that was calculated during an R script.  When I preview the
    output of my input data, I see lowercase "true" and "false".  When I try to pass this into the web service, I get the following error.
    InputParseError: Parsing of input vector failed. Verify the input vector has the correct number of columns and data types. Additional details: Value "bool" is not defined in enum. Line 1, position 2167.., Error code: BadArgument, Http status code:
    400, Request id: 338eb834-b195-4a09-b6b2-47a0b91e80f1, Timestamp: Fri, 23 Jan 2015 20:51:09 GMT
    I have tried passing in true, 1, TRUE.  
    Does anyone know how I can successfully pass in a value for this parameter to get the service to execute?
    Thanks,
    Jeff

    Hello Jeff,
    This is the error observed in our log:
    Code: InputParseError, Target: ClientID,Location,Procedure,Month,DayOfWeek,Holiday, Message: Parsing of
    input vector failed. Verify the input vector has the correct number of columns and data types. Additional details: Value "bool" is not defined in enum
    You have tried to pass "true"/"TRUE"/1 as input value for "Holiday" right? Do you mind sending us more information to help troubleshoot? I'd like to request 1) your sample R code  2) your sample input. Could you please
    send to my email address?
    Thanks
    Jing

  • Pass a "pointer type" into DLL

    Hi! I am planning to do this thing:
      A. Create an array
      B. Pass its pointer into a sub-VI
      C. In this sub-VI, use this pointer in a function of a DLL library
      D. The function of the DLL library will write something into place defined by the pointer
    My aim is to read back the result by viewing that array at step A.
    My question is..
    1. how to pass a pointer via VIs? Use Call be reference node in the mother VI, what about the daughter VI then?
    2. if I am passing a pointer into the DLL, should I choose "value" or "pointer to value" in the call library node?
    Raymond

    duplicate post, continue here!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Getting error when record type is used

    Hi Experts,
    Getting error when using record type as in parameter.
    PLS-00306: wrong number or types of arguments in call to 'SAL_UPDATE_PROC'
    PLS-00302: component 'ENAME' must be declared
    PLS-00302: component 'SAL' must be declared
    CREATE OR REPLACE PACKAGE emp_details_proc
    IS
    TYPE emp_record IS RECORD
    (empno emp.empno%TYPE,
    ename emp.ename%TYPE,
    sal emp.sal%TYPE);
    TYPE emp_type is TABLE OF emp_record INDEX BY binary_integer;
    PROCEDURE EMP_PROC;
      PROCEDURE sal_update_PROC
      (    p_rule in  emp_type
         , p_deptno in number
         , p_job in number
    END;
    CREATE OR REPLACE PACKAGE BODY emp_details_proc
    IS
    PROCEDURE EMP_PROC
      IS
        V_DEPTNO NUMBER := 10;
        V_JOB VARCHAR2(20):='CLERK';
      BEGIN
    for rc in (SELECT EMPNO,ENAME,SAL FROM emp where deptno =v_deptno)
             loop
                  sal_update_PROC
                  (  p_rule => rc
                    , p_deptno => V_DEPTNO
                    , p_job =>V_JOB
      end loop;
    EXCEPTION
         WHEN OTHERS THEN
    DBMS_output.put_line(SQLERRM);
    END;
      PROCEDURE  sal_update_PROC
      (    p_rule in  emp_type
         , p_deptno in number
         , p_job in number
      IS
        V_ename VARCHAR2(20);
        V_SAL NUMBER;
      BEGIN
          V_ename := p_rule.ename;
          V_sal := p_rule.sal;
            IF V_sal <=3000 THEN
            UPDATE EMP SET sal=sal+v_sal*10 WHERE ename=v_ename;
            commit;
          END IF;
    dbms_output.put_line(v_ename||'   '||v_sal);      
          END;
          END;
    Instead of this
    SELECT EMPNO,ENAME,SAL FROM emp where deptno =v_deptno;
      PROCEDURE  sal_update_PROC
      (    p_rule in  emp_type
         , p_deptno in number
         , p_job in number
    If I use
    SELECT * FROM emp where deptno =v_deptno
      PROCEDURE  sal_update_PROC
      (    p_rule in  emp%ROWTYPE
         , p_deptno in number
         , p_job in number
      I am not getting any error.
      Please help me.Why I am getting error what is wrong in my code.
      Thanks in advance.

    for rc in (SELECT EMPNO,ENAME,SAL FROM emp where deptno =v_deptno)
             loop
                  sal_update_PROC
                  (  p_rule => rc                        
                    , p_deptno => V_DEPTNO
                    , p_job =>V_JOB
    p_rule => rc       --> What exactly in rc? It's just a counter. You are using this (SELECT EMPNO,ENAME,SAL FROM emp where deptno =v_deptno)query but not using a single value returned from this query in the code.
    Ishan

  • PL/SQL Passing record type between two procedures

    I have a package and package body as following
    My problem is I forgot the syntax to pass the record type between the two procedure.?????
    CREATE OR REPLACE PACKAGE Standby_Schedules_Disp
    AS
    PROCEDURE Get_schedule (test1 OUT VARCHAR2);
    PROCEDURE get_test (my_test REF my_sched); DOESN'T WORK?????
    END Standby_Schedules_Disp;
    CREATE OR REPLACE PACKAGE BODY Standby_Schedules_Disp
    AS
    PROCEDURE Get_schedule (test1 OUT VARCHAR2)
    AS
    temp NUMBER;
    TYPE my_sched IS RECORD ( my_name VARCHAR2(30) := NULL,
    my_age NUMBER := 0);
              who_I_am my_sched;
              Get_test(my_sched);
    BEGIN
         test1 := 'aaaaa';
              who_i_am.my_name := 'Matthew';
         END get_schedule;
    PROCEDURE get_test (my_test REF my_sched) DOESN'T WORK?????
    AS
    BEGIN
    END;
    END Standby_Schedules_Disp;
    /

    Youv'e declared the my_sched type within the scope of the Get_schedule procedure - it's not visible to the get_test procedure. You have declare the type in the package body if it's only used internally within the package or in the package spec if it can be referenced outside the package:
    CREATE OR REPLACE PACKAGE [BODY] Standby_Schedules_Disp
    AS
       TYPE my_sched IS RECORD (
          my_name VARCHAR2(30) := NULL,
          my_age NUMBER := 0);I don't understand what you are trying to do with the REF keyword in this context. Having declared the type, you can use it as normal in a parameter spec:
    PROCEDURE get_test (my_test IN [OUT] my_sched);You're also trying to call get_test within the declaration section of a program, which you can't do, and get_test also contains no executable code, which is not allowed in PL/SQL.

  • Executing dynamic procedure with record type

    Hi,
    I have a small issue...I'm not attaching any tables / data..etc...I just want to know how to pass the record type to a procedure (which are actually obtained from a table) dynaically..Unable to form the sql statement..
    I get an error saying that "wrong number or types of arguments in call to ||"...
    -- see ** below where I'm getting an error.
    .Need to pass the whole record type "l_shl_order_msg"
    CREATE OR REPLACE PROCEDURE CM_BUILD_MSG_PRC (P_IN_BLD_MSG_CURSOR IN SYS_REFCURSOR,
                                                  P_OUT_BLD_MSG_CURSOR OUT SYS_REFCURSOR)
    IS
    l_shl_order_msg CRAE_INTERFACE.GLB_VAR_PKG.deid_SHELL_order_typ;
    V_MSG_SHELL_NAME VARCHAR2(1000);
    V_MESG_TEXT_SEGMENT VARCHAR2(1000);
    V_TEXT VARCHAR2(1000);
    V_MSG_TEXT VARCHAR2(4000);
    V_MSG_FINAL_TEXT VARCHAR2(4000);
    V_MSG_PROC VARCHAR2(1000);
    V_SQL VARCHAR2(4000);
    V_CNT NUMBER;
    L_STATUS  VARCHAR2(100);
    L_REASON  VARCHAR2(1000);
    BEGIN
    LOOP
          FETCH P_IN_BLD_MSG_CURSOR
            INTO l_shl_order_msg;
          EXIT WHEN P_IN_BLD_MSG_CURSOR%NOTFOUND;
    END LOOP;
    Select mesg_shell_text, mesg_dynamic_var_count
      into V_MSG_TEXT, V_CNT
       from CRAE_MESG_MASTER
        where mesg_shell_name = l_shl_order_msg.SHELL_ID;
      For i in 1..V_CNT
        LOOP
            SELECT MESG_SHELL_NAME, MESG_TEXT_SEGMENT, PROCEDURE_NAME
             INTO V_MSG_SHELL_NAME, V_MESG_TEXT_SEGMENT, V_MSG_PROC
              FROM CRAE_MESG_MASTER_DETAIL
                WHERE I = MESG_SEQ_NUMBER
                 AND  mesg_shell_name = l_shl_order_msg.SHELL_ID;
      V_SQL:= 'BEGIN '||V_MSG_PROC||'(''' || l_shl_order_msg|| ''',' ||
         '''' || V_MSG_SHELL_NAME || ''',' || '''' || V_MESG_TEXT_SEGMENT
         || ''', CRAE_INTERFACE.GLB_VAR_PKG.V_TEXT );'||'END;';
        DBMS_OUTPUT.PUT_LINE(V_SQL);
         EXECUTE IMMEDIATE (V_SQL);
         V_TEXT := CRAE_INTERFACE.GLB_VAR_PKG.V_TEXT;
         IF I = 1
           THEN
         V_MSG_TEXT := REPLACE(V_MSG_TEXT,V_MESG_TEXT_SEGMENT,V_TEXT);
         V_MSG_FINAL_TEXT := V_MSG_TEXT;
         ELSE
           V_MSG_FINAL_TEXT := REPLACE(V_MSG_FINAL_TEXT,V_MESG_TEXT_SEGMENT,V_TEXT);
         END IF;
    END LOOP;
       DBMS_OUTPUT.PUT_LINE(V_MSG_FINAL_TEXT);
    -- L_STATUS := CRAE_INTERFACE.GLB_VAR_PKG.V_STATUS;
    -- L_REASON := CRAE_INTERFACE.GLB_VAR_PKG.V_REASON;
    OPEN  P_OUT_BLD_MSG_CURSOR
    FOR
        SELECT  l_shl_order_msg.MESSAGE_DATE_TIME,
                 l_shl_order_msg.MASKED_ID,
                 l_shl_order_msg.OFFSET_DATE,
                 l_shl_order_msg.PATIENT_ACCOUNT_NUMBER,
                 l_shl_order_msg.ORDER_CONTROL,
                 l_shl_order_msg.PLACER_ORDER_NUMBER,
                 l_shl_order_msg.QUANTITY,
                 l_shl_order_msg.INTERVAL,
                 l_shl_order_msg.DURATION,
                 l_shl_order_msg.START_DATE_TIME,
                 l_shl_order_msg.END_DATE_TIME,
                 l_shl_order_msg.PRIORITY,
                 l_shl_order_msg.ORDERING_DATE,
                 l_shl_order_msg.ENTERED_BY_ID,
                 l_shl_order_msg.ENTERED_BY_FAMILY_NAME,
                 l_shl_order_msg.ENTERED_BY_GIVEN_NAME,
                 l_shl_order_msg.ORDERED_BY_ID,
                 l_shl_order_msg.ORDERED_BY_FAMILY_NAME,
                 l_shl_order_msg.ORDERED_BY_GIVEN_NAME,
                 l_shl_order_msg.REPEAT_PATTERN,
                 l_shl_order_msg.DRUG_CODE,
                 l_shl_order_msg.DRUG_DESCRIPTION,
                 l_shl_order_msg.REQUESTED_GIVE_AMOUNT,
                 l_shl_order_msg.REQUESTED_GIVEN_UNIT,
                 l_shl_order_msg.SIG,
                 l_shl_order_msg.ALLOW_SUBSTITUTION,
                 l_shl_order_msg.REQUESTED_DISPENSE_AMOUNT,
                 l_shl_order_msg.REQUESTED_DISPENSE_UNIT,
                 l_shl_order_msg.REFILLS,
                 l_shl_order_msg.ROUTE,
                 l_shl_order_msg.STATUS,
                 l_shl_order_msg.REASON,
                 V_MSG_FINAL_TEXT,
                 T.COMP_ID,
                 T.PROC_ID,
                 T.Procedure_Desc
              FROM CRAE_MESG_rule_MASTER T
               WHERE MSG_SHELL_NAME = l_shl_order_msg.SHELL_ID;
    --  dbms_output.put_line (l_shl_order_msg.MESSAGE_DATE_TIME);
    END;** I get an error saying that "wrong number or types of arguments in call to ||"...
    Not sure how to pass record type dynamically...

    sb,
    declare
        l_shl_order_msg CRAE_INTERFACE.GLB_VAR_PKG.deid_SHELL_order_typ;
        V_MSG_SHELL_NAME VARCHAR2(1000);
        V_MESG_TEXT_SEGMENT VARCHAR2(1000);
        V_SQL VARCHAR2(4000);
        V_MSG_PROC VARCHAR2(1000);
        begin
        V_SQL := 'BEGIN '||V_MSG_PROC||'(l_shl_order_msg)'||'END;';
           DBMS_OUTPUT.PUT_LINE(V_SQL);
          end;when I execute this...l_shl_order_msg is passed as variable..but instead I want to pass all columns in the recordtype to be passed..
    ex : l_shl_order_msg.id, l_shl_order_msg.name....etc..
    This is what is being passed :
    BEGIN ATTRIBUTE_PRC( l_shl_order_msg ,'CDS_1','text-1', CRAE_INTERFACE.GLB_VAR_PKG..V_TEXT );
    ATTRIBUTE_PRC has already been defines as record type with i/p parameter..
    Edited by: user7431648 on Jul 26, 2012 8:25 AM
    Edited by: user7431648 on Jul 26, 2012 8:27 AM

  • Calling oracle API having parameter as record type throughPL/SQL WebService

    Hi All,
    I dont know whether this is the right forum to put this query, but as i am using a pl/sql web service , putting the query on this forum.
    My requirement is to call oracle API which in turh creates a single Invoice(using Ar_Invoice_Api_Pub.create_single_invoice )
    But the issue is this API in turn has some of the input parameters as Record type and table type, my concern is how to pass this data(record type or table type) as parameter thorugh java code .. If i use Collection or Hashmap will it work , I dont think so , some intermediate conversion will require.
    Subsequently the other requirement is fetch this record/table type data and return it to the java code
    Please correct me if i am wrong and suggest a proper solution if anybody is aware off or tried such things before.
    Thanks in advance.
    Regards,
    Anant.

    Hi,I'm new comer of this world,
    I've a pl/sql like this:
    package MY_WS_API is
    type record_set is ref cursor;
    PROCEDURE Get_User_Info(p_user_id VARCHAR2,
    p_rep_id VARCHAR2,
    p_flag out number,
    p_msg out varchar2,
    p_recordset out record_set);
    end MY_WS_API;
    when I using jdeveloper trying to publish it as a webservice, in the step 4 of the wizzard poping me choose the program unit to expose, the PROCEDURE Get_User_Info is not available and told me "Ref cursor Type is not supported due to a jdbc limitation and Ref Cursor Types are only supported for use of return type".
    THE QUESTION is:
    1.the cursor I used is of return type,I'm not very understanding the "why not" message upon.
    2.in such case , need I trans the return cursor into Object[] if have to?
    3.any other limitation for generating WS from PL/SQL using jdeveloper?
    Thanks!

  • Error while creating function with record type as return type

    Hi i tried the following code to get the nth highest sal using record type and function.
    CREATE OR REPLACE PACKAGE pack_rec_cur AS
    TYPE rec_type IS RECORD (
    name EMP.ename%TYPE,
    sal EMP.sal%TYPE);
      END;The above package is created
    CREATE OR REPLACE
      FUNCTION fun_rec_cur(n INT) RETURN pack_rec_cur.rec_type AS
       rec pack_rec_cur.rec_type;
        CURSOR cur_rec IS
          SELECT ename,sal
            FROM emp
             WHERE sal is not null
              ORDER BY DESC;
    BEGIN
    OPEN cur_rec;
      FOR i IN 1..n LOOP
       FETCH cur_rec into rec;
       EXIT WHEN cur_rec%NOTFOUND;
      END LOOP;
    CLOSE cur_rec;
    RETURN rec;
    END;   The above function is giving errors
    LINE/COL ERROR
    4/7      PL/SQL: SQL Statement ignored
    7/16     PL/SQL: ORA-00936: missing expression
    SQL> Could you please correct me where i'm doing mistake
    Thanks.

    You are missing the column name in order by clauase. Is it ename desc?
    CREATE OR REPLACE
      FUNCTION fun_rec_cur(n INT) RETURN pack_rec_cur.rec_type AS
       rec pack_rec_cur.rec_type;
        CURSOR cur_rec IS
          SELECT ename,sal
            FROM emp
             WHERE sal is not null
              ORDER BY ENAME DESC; ---added ename
    BEGIN
    OPEN cur_rec;
      FOR i IN 1..n LOOP
       FETCH cur_rec into rec;
       EXIT WHEN cur_rec%NOTFOUND;
      END LOOP;
    CLOSE cur_rec;
    RETURN rec;
    END;  
    -OUTPUT
    SQL> SET SERVEROUT ON
    SQL>
    SQL> DECLARE
      2     rec            pack_rec_cur.rec_type;
      3  BEGIN
      4     rec         := fun_rec_cur (6); --you get the 6th record in order of ename desc
      5     DBMS_OUTPUT.put_line ('ename::' || rec.NAME || '  sal ::' || rec.sal);
      6  END;
      7  /
    ename::MARTIN  sal ::1250
    PL/SQL procedure successfully completed.
    SQL>

  • Error in using plsql record type inside packages

    Dear Friends,
    Using Ora9iR2 on Windows 2000 Server. I am trying to declare a record type and a nested table of that record type in the package body and the initialise that in the package body then insert records into that. But I receive error msg.
    CREATE OR REPLACE PACKAGE sample1 AS
    TYPE rcur IS REF CURSOR;
    TYPE emp_record IS RECORD
    (empname VARCHAR2(20),
    job VARCHAR2(10),
    salary NUMBER);
    TYPE emp_result IS TABLE OF emp_record;
    PROCEDURE emp_test ( i_empno emp.empno%TYPE);
    END sample1;
    -- Package Body
    CREATE OR REPLACE PACKAGE BODY sample1 AS
    PROCEDURE emp_test ( i_empno IN emp.empno%TYPE)AS
    c1 rcur;
    eresult emp_result := emp_result();
    v_empname VARCHAR2(20);
    v_job VARCHAR2(10);
    v_sal NUMBER;
    BEGIN
    OPEN c1 FOR SELECT ename,job,sal FROM emp WHERE empno = i_empno;
    LOOP FETCH c1 INTO v_empname,v_job,v_sal;
    EXIT WHEN c1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_empname||' , '||v_job||' , '||v_sal);
    eresult := emp_result(v_empname,v_job,v_sal); showing error
    END LOOP;
    CLOSE c1;
    END emp_test;
    END sample1;
    While executing the procedure with out the line eresult := emp_result(v_empname,v_job,v_sal); the procedure executes fine.
    SQL> execute sample1.emp_test(7900);
    JAMES , CLERK , 950
    PL/SQL procedure successfully completed.
    With that line, i have error
    SQL> execute sample1.emp_test(7900);
    BEGIN sample1.emp_test(7900); END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04063: package body "KUMAR.SAMPLE1" has errors
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at line 1
    While executing in PL/SQL Developer, it says the wrong number or types of arguments call to ;EMP_RESULT'.
    Please guide me where I am wrong.
    Kumar

    I got invalide data type error.I think the datatype in the CAST() clause must be a SQL Type i.e. one created with a CREATE TYPE command in the database. emp_result is only a PL/SQL datatype.
    But I dont know why it is saying error
    eresult(eresult.count) := emp_result(v_empname,v_job,v_sal); eresult is a table of records. It is therefore expecting a record. records don't seem to be created in the same way that user defined types are.
    The concept of handling records like this is new to 9i and they are still smoothing out the bumps. Things are a lot better in 9.2 than in 9.0.1 if it's any consolation. There is a particular gap in the documentation, which is what's tripping you up at the moment: the difference between TYPE AS RECORD and other types, also the difference between VARRAY, NESTED TABLE and REF CURSOR. To be honest, it's all kind of hazy for me at the moment: I always need to run some code before I make any pronouncements on this topic.
    Good luck, APC

  • Error when using record group type as param in a function in where clause

    Hi folks.
    I have a record type defined in a packages specification. I have to use this record as parameter to call a function. I am able to call the function if as return its value to a string variable. However, the function should be called into a query to compare the returned value and this code is not compiled.
    The code is below:
    DECLARE
    l_line_group_rec INL_CUSTOM_PUB.inl_ship_headers_rec;
    l_name VARCHAR2(100);
    l_count NUMBER;
    BEGIN
    l_name := INL_GET_PARTY_SITE_NAME(l_line_group_rec); -- Compiling successfully
    SELECT COUNT(1)
    INTO l_count
    FROM dual
    WHERE INL_GET_PARTY_SITE_NAME(l_line_group_rec) = 'Allied Manufacturing'; --- Error when compiling
    END;
    I got the error: PLS-00306: wrong number or types of arguments in call to 'INL_GET_PARTY_SITE_NAME'
    I would like to know if there is any restriction in using record type as parameter in where clauses or if there is another way to do it.
    Thanks in advance

    Hi.
    The definition of INL_GET_PARTY_SITE_NAME:
    FUNCTION INL_GET_PARTY_SITE_NAME(p_line_group_rec INL_CUSTOM_PUB.inl_ship_headers_rec) RETURN VARCHAR2 IS
    l_party_site_name VARCHAR2(100);
    BEGIN
    l_party_site_name := 'Allied Manufacturing';
    URN l_party_site_name;
    END INL_GET_PARTY_SITE_NAME;
    Thanks.

  • Oracle Account Receivables Lockbox Error, No ITEM NUM on PAYMENT record type.

    Hi,
    For "Process Lockbox" program. The program completes normally, but receipts are not created and I am getting below error in log file:-  
    "AR-ARLFMT: No ITEM NUM on PAYMENT record type."
    This error message is similar to error message mentioned in note id (Troubleshooting Known Issues In Lockbox (Doc ID 1366298.1)) :-
    2.10. Lockbox ends with error: "AR-ARLFMT: No PAYMENT NUM on PAYMENT record type"
    Symptoms
    You are trying to run lockbox and receive this error message in the log file:
    AR-ARLFMT: No PAYMENT NUM on PAYMENT record type.
    Your lockbox interface program has completed successfully, however,there is No Data Found in the AR_PAYMENTS_INTERFACE table.
    Solution
    Responsibility: Receivables Manager
    Navigation: Setup > Receipts > Lockboxes > Transmission Formats
    For the Transmission Format name that you are using, make sure that there is a 'Transmission Record' defined and that there is a Transmission Field with a Field Type of  'Record Identifier' defined.
      Make sure to include the check number in Transmission Format and Control file
    and item number is:-
    Item Number: A sequence number that your bank assigns to a specific payment. This number associates an invoice with a receipt.
    I am passing item number, but still I am getting this error.
    Can anybody please help.
    Thanks in advance.
    Regards
    Gagan Garg

    Hi,
    For "Process Lockbox" program. The program completes normally, but receipts are not created and I am getting below error in log file:-  
    "AR-ARLFMT: No ITEM NUM on PAYMENT record type."
    This error message is similar to error message mentioned in note id (Troubleshooting Known Issues In Lockbox (Doc ID 1366298.1)) :-
    2.10. Lockbox ends with error: "AR-ARLFMT: No PAYMENT NUM on PAYMENT record type"
    Symptoms
    You are trying to run lockbox and receive this error message in the log file:
    AR-ARLFMT: No PAYMENT NUM on PAYMENT record type.
    Your lockbox interface program has completed successfully, however,there is No Data Found in the AR_PAYMENTS_INTERFACE table.
    Solution
    Responsibility: Receivables Manager
    Navigation: Setup > Receipts > Lockboxes > Transmission Formats
    For the Transmission Format name that you are using, make sure that there is a 'Transmission Record' defined and that there is a Transmission Field with a Field Type of  'Record Identifier' defined.
      Make sure to include the check number in Transmission Format and Control file
    and item number is:-
    Item Number: A sequence number that your bank assigns to a specific payment. This number associates an invoice with a receipt.
    I am passing item number, but still I am getting this error.
    Can anybody please help.
    Thanks in advance.
    Regards
    Gagan Garg

  • DB proc - do you need to create a table to pass a ref cursor record type?

    I want to pass a limited selection of columns from a large table through a DB procedure using a REF CURSOR, returning a table rowtype:
    CREATE OR REPLACE package XXVDF_XPOS_DS021_ITEMS AS
         TYPE XXVDF_XPOS_DS021_ITEM_ARRAY
         IS REF CURSOR
         return XXVDF_XPOS_DS021_ITEM_TABLE%ROWTYPE;
    Do I need to create this dummy table?
    I can't get a TYPE to work, where the type is an OBJECT with the desired columns in it.
    So a dummy empty table will sit in the database...
    Is there another way?
    thanks!

    You can use RECORD type declaration:
    SQL> declare
      2   type rec_type is record (
      3    ename emp.ename%type,
      4    sal emp.sal%type
      5   );
      6   type rc is ref cursor return rec_type;
      7   rc1 rc;
      8   rec1 rec_type;
      9  begin
    10   open rc1 for select ename, sal from emp;
    11   loop
    12    fetch rc1 into rec1;
    13    exit when rc1%notfound;
    14    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    15   end loop;
    16   close rc1;
    17  end;
    18  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300or use, for example, VIEW to declare rowtype:
    SQL> create view dummy_view as select ename, sal from emp;
    View created.
    SQL> declare
      2   type rc is ref cursor return dummy_view%rowtype;
      3   rc1 rc;
      4   rec1 dummy_view%rowtype;
      5  begin
      6   open rc1 for select ename, sal from emp;
      7   loop
      8    fetch rc1 into rec1;
      9    exit when rc1%notfound;
    10    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    11   end loop;
    12   close rc1;
    13  end;
    14  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300 Rgds.

  • OCI 22303 exception - Pass object to type Record in oracle procedure

    Recently i had my first encounter with ODP.NET and Oracle. I'm developing a a datalayer that can access a stored procedure on an Oracle database.
    The problem i'm having is the following:
    I'm using this method to pass my parameters to the procedure: http://www.codeproject.com/KB/cs/CustomObject_Oracle.aspx
    I have also attempted this approach:
    http://developergeeks.com/article/48/3-steps-to-implement-oracle-udt-in-odpnet
    I always get the message (litteraly):
    Oracle.DataAccess.Client.OracleException: OCI-22303: type &quote;PAC$WEBSHOP_PROCS&quot;.&quot;CUSTOMER_IN_RECTYPE&quot; not found.
    It sounds weird to me, but what are the &quotes doing here in the error message I see?
    Some code i use:
    OracleParameter objParam = new OracleParameter
    OracleDbType = OracleDbType.Object,
    Direction = ParameterDirection.Input,
    ParameterName = "PAC$WEBSHOP_PROCS.P_CUSTOMER_IN",
    UdtTypeName = "PAC$WEBSHOP_PROCS.WEBSHOP_PROCS.CUSTOMER_IN_RECTYPE",
    Value = card
    The information i have about the Oracle procedure:
    CREATE OR REPLACE PACKAGE PAC$WEBSHOP_PROCS IS
    TYPE CUSTOMER_IN_RECTYPE IS RECORD
    (CUS_STO_IDENTIFIER NUMBER(2)
    ,CUS_IDENTIFIER NUMBER(6)
    ,CH_IDENTIFIER NUMBER(2)
    ,CH_CARD_VERSION NUMBER(1)
    PROCEDURE PRC$WS_VALIDATE_CARD
    (P_CUSTOMER_IN IN PAC$WEBSHOP_PROCS.CUSTOMER_IN_RECTYPE
    ,P_RETURN_CODE IN OUT NUMBER
    Any help to cover my problem would be greatly appreciated.
    Thx
    Edited by: 836497 on 14-feb-2011 4:36

    The only way to call it as is would be via an anonymous plsql block, where you create the record type inside the block. Interacting with the block via ODP would be limited to scalar values.
    Here's a PLSQL example just to demonstrate. Here, v1 and v2 are bind variables of scalar type, which you'd setup/bind via ODP instead of the SQL prompt as I did, but I thought this might keep things simpler for the example.
    The other choice would be to write a wrapper procedure that takes type OBJECT that you can call from ODP, and inside that procedure convert them to/from RECORD and call the original procedure.
    Hope it helps,
    Greg
    SQL> drop package somepack;
    Package dropped.
    SQL> create package somepack as
      2  type somerectype is record(n1 number);
      3  function somefunc (v1 somerectype) return somerectype;
      4  end;
      5  /
    Package created.
    SQL>
    SQL> create package body somepack as
      2  function somefunc (v1 somerectype) return somerectype is
      3   begin
      4    return v1;
      5   end;
      6  end;
      7  /
    Package body created.
    SQL>
    SQL>
    SQL> var v1 number;
    SQL> exec :v1 := 5;
    PL/SQL procedure successfully completed.
    SQL> var v2 number;
    SQL>
    SQL>
    SQL> declare
      2   localvar1 somepack.somerectype;
      3   localvar2 somepack.somerectype;
      4  begin
      5     localvar1.n1 := :v1;
      6     localvar2 := somepack.somefunc(localvar1);
      7     :v2 := localvar2.n1;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL>  print v2;
            V2
             5
    SQL>

Maybe you are looking for

  • Read content of input fields in an internal table?

    <b>Hello everybody!</b> This is my first posting here in that forum, so i hope you can help my with my issue.. In the following time i will develop with Adobe Interactive Forms. I already had a SAP Training in it. My Question: It is very simple to de

  • How to see all Email in iOS Mail

    I have an iPhone 5 that is synced with Gmail. However for some reason I can only see email within the Mail client on my phone for the last day, but nothing before that. Even when I click on the tab for "show all mail", I still only see the mail from

  • 1 Bookmark of 100 others opens in the bookmark panel - fix ?

    Using XP SP-3 with FF 30 now - After 29.0 update - when I click on one of my most used bookmarks - it opens in the bookmark panel unless I right click it to open in new tab or new window. If it opens in a new Window it opens in the proper way - No ot

  • Very slow performance running Mavericks - need troubleshooting help

    Hello folks: I have a MBP 2011 which was upgraded to Mavericks from Mountain Lion about 6 weeks ago. Since then I have had a major performance drop - slow machine, very slow window renderings, etc. I know a number of people have been facing these iss

  • Can't see ability to mark a discussion topic as "watch"

    Been away for a couple of weeks. I can't see any longer the icon of a binoculars allowing me to watch a topic so that I get replies sent to me by email. Where is it please? Has that been removed or am I going blind?