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.

Similar Messages

  • 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)

  • Can we use OUT or IN OUT parameter mode in function?

    Can we use OUT or IN OUT parameter mode in function & if YES then what's limitations?

    hi,
    Yes we can have OUT and IN OUT parameters for a function.
    As per my knowledge there are no limitations , but as per the convention we will use OUT ,IN OUT Parameter modes for only procedures .
    Thanks,
    P Prakash

  • Calling a stored procedure with a table of custom types as a out parameter

    Hi,
    I'm trying to use toplink 11.1.1.0.0 to call a stored procudure with 4 in paramrs and a single out parameter of type gsearch_type which is a userdefined type defined as below
    CREATE or replace TYPE search_object as object (mdlnumber varchar2(12), hit clob);
    create or replace type gsearch_type as table of search_object;
    Is it possible to get the return value from this stored procedure using toplink.
    Thanks in advance for any help.
    - Sunil

    Currently TopLink can't directly handle that kind of output parameter.
    As a workaround you would need a wrapper for the stored procedure - it could be either another stored procedure or an anonymous block which would return the components of the complex parameter as several simple parameters.

  • 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.

  • Pass TestStand error type directly into function parameter

    Hi,
    I am using TestStand 4 and Labwindows CVI 8.5.
    I wonder if it is possible to pass Standard Step error type into CVI function parameters.
    I think it would be more simple to pass one parameter instead of passing Error code, Error occurred state and Error message into function prototype.
    I tried to use tsErrorDataType struct defined into tsutil.h into my function prototype.
    In TestStand, I pass Step error type into function parameter but it does not work.
    TestStand displays an error meaning parameters does not match function prototype.
    Thank you for your help.

    Hi Tartempion,
    In order to pass the TestStand Error Container as one parameter to a function in a CVI DLL, you must use a struct that is typedef'ed and create an .fp file that is included as a type library for the DLL. When you create a .fp file to add to a DLL, the DLL will not build unless all structs/enums are typedef'ed. Thus, I wouldn't advise using the tsutil.h because you would have to go through and typedef every single struct and enum in the header file.
    Instead, you can simply create a typedef'ed struct in your projects header file and create an .fp file with the struct specified as a data type. Then in TestStand, when you call the function you would need to ensure that the parameter is of Category "C Struct", and type "Error". The attached zip file contains a CVI 8.5 project that demonstrates this along with a TestStand 4.0 sequence file that demonstrates how to pass the parameter to the function by reference. In case you run into trouble creating the .fp file please refer to the following KnowledgeBase. The instructions are for enums but easily correspond to structs as well:
    TestStand and LabWindows/CVI Enumeration Data Types
    Hope this helps!
    Manooch H.
    National Instruments
    Attachments:
    PassTSError.zip ‏19 KB

  • 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

  • How to retrieve the outer parameter of a stored procedure in XSQL page

    I have to call a stored procedure in the xsql page that returns a resultset (ie. oracle table/record type) through an outer paramter. Is there any built-in xsql action tag available to get the parameter and present
    it in xml on the page? please help, thanks.

    You cant get two resultsets out of SP like this. The workaround is to merge and bring the resultsets.
    For this number of columns as well as corresponding datatypes have to be compatible. Also you will need one additional column which indicates resultset value. Then use this as filter to get your desired resultset out
    create procedure GetData as
    begin
    select 'resultset1' as Cat,*,.. N columns from Emp
    union all
    select 'resultset2' as Cat,*,.. N columns from Dept
    end
    create table #tmp1 (Ddeptid int, deptname varchar(500),Location varchar(100))
    Insert into #tmp1 (Ddeptid , deptname ,Location )
    Select column1,column2,column3
    from OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes;
    Integrated Security=SSPI','Execute yourdb..GetData')
    WHERE Cat = 'resultset1'
    create table #tmp (empid int , ename varchar(500),DeptId int , salary int)
    Insert into #tmp (empId,ename,deptId,salary)
    Select column1,column2,column3, column4
    from OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes;
    Integrated Security=SSPI','Execute yourdb..GetData')
    WHERE Cat = 'resultset2'
    also see
    http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx
    Another method is to populate table with relevant resultset within procedure itself and then select from the table directly outside.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Registering the out parameter

    how to register an out parameter in java which is of %rowtype in pl/sql procedure

    Hi,
    Which version of Weblogic and JDBC driver do you use?
    Regards,
    Slava Imeshev
    "chaat" <[email protected]> wrote in message
    news:3c02da3a$[email protected]..
    >
    Hi,
    I'm using weblogic-jdriver driver, on Invoking a stored procedure(which
    returns a Record) by registering the OUT parameter as
    callableStatement.registerOutParameter(1, Types.ARRAY);
    the code compiles, @run time gives the following exception..
    java.sql.SQLException: Unknown type: 2003
    Exception Object info ==>[[The error code = 0 and  sql state = null ]].
    Any insights are greatly appreciated.

  • Return Nested Table  Using Out Parameter

    Hi Friends,
    I wrote a function in which i'm using a return type as NUMBER and OUT parameter as TABLE but i'm not able to call the function in PL/SQL because of TABLE ,Can anyone plz tell me how to call the function in PL/sql using TABLE as OUT parameter. The calling function is mentioned below..
    FUNCTION get_label_to_folder (
    i_folder_id IN NUMBER,
    i_label_id IN NUMBER,
    i_new_path IN VARCHAR2,
    i_src_path IN VARCHAR2 DEFAULT NULL,
    --i_output_loc_type   IN       VARCHAR2,
    o_vdoc_table OUT vdocs_table
    RETURN NUMBER;
    I tried to call that function in this manner but it won't work--
    DECLARE
    TYPE vdocs_table IS TABLE OF VARCHAR2 (50);
    vdoc vdocs_array := vdocs_array ();
    vret VARCHAR2 (20);
    BEGIN
    vret :=
    sce_label_util.get_label_to_folder (32272,
    324073,
    '/test-aaaa/a1/',
    NULL,
    vdoc
    FOR i IN vdoc.FIRST .. vdoc.LAST
    LOOP
    DBMS_OUTPUT.put_line (vret || ' ,' || vdoc (i));
    END LOOP;
    END;
    Kindly check it and plz resolve the problem.
    Regards,
    Anand

    It is not the correct approach to do this (passing a collection using an OUT parameter) using a function.
    Does not matter whether you dislike it. It is still wrong.
    It should be a procedure. It should likely define the OUT parameter as being passed by reference and not value in order to decrease the call overheads and increase performance.
    Also note that is it not called a table. The correct terminology is a collection or an associative array. A table is something you get inside the database engine. The structure you define in the PL engine is nothing like a database table and everything like an array.
    PS. And how do you expect us to determine the error? How do you expect us to test anything if we do not know what Oracle version you are using? Please.. FULL details, including Oracle version number and the full Oracle error message!

  • Converting OBJECT Type into RECORD Type

    folks,
    Is there a way to Convert a OBJECT Type into a RECORD Type in Oracle PL/SQL, Because i have a stored procedure with RECORD Type as a IN parameter and as we know that we JDBC doesn't support calling or returning RECORD Types , So i was thinking of sending a OBJECT type and convert that to a RECORD type,
    I appreciate any help with the code or point to the documentation,
    thanks
    KM

    folks,
    Is there a way to Convert a OBJECT Type into a RECORD Type in Oracle PL/SQL, Because i have a stored procedure with RECORD Type as a IN parameter and as we know that we JDBC doesn't support calling or returning RECORD Types , So i was thinking of sending a OBJECT type and convert that to a RECORD type,
    I appreciate any help with the code or point to the documentation,
    thanks
    KM

  • Registering a bool out parameter in callable statement

    Hi all..
    Can we register a bool type as a out parameter.in oraclecallablestatement.....
    Class definition says only char varchar long raw longraw can be registered as out parameters..
    if we cant.. what how can we capture a bool o/p from a function....please help

    user21786,
    We discussed this issue just a few days ago. Boolean is not a supported native type in oraclecallablestatement. Check the thread for workarounds.
    --Shiv                                                                                                                                                                                                                                                                                                                                                   

  • Still no way to access a PL/SQL package record type ?

    Sorry if this is a recurrent question...
    Is there still no way to set/retrieve input/output parameters of a PL/SQL package procedure/function through JDBC that is of type RECORD ??????
    I'm not considering wrapping up through objects or strings. Rather new versions of JDBC driver.
    How about SQLJ (don't know anything about that one. Does it call stored procedures ?
    Would it support package stored procedure ?
    And RECORD types ?
    Just out of curiosity as i'm setting off to breaking up all my types into individual arguments. What a pain !!!!!!!!!
    Thx.

    Thanks for the suggestion.
    We were arriving to a similar conclusion...
    There is however one BIG reason of being disapointed :
    - I did not know that (since I'm only Oracling since January) but objects do not accept attributes the type of which would be defined by refering the type of an existing column :
    Such as :
    CREATE TYPE type_customer AS OBJECT (
    cust_id CUSTOMERS.CUSTOMER_ID%TYPE,
    I have no idea why RECORDs can do it but object can't.
    To summarize it all we can use RECORDs but they are not seen through JDBC drivers and we can use OBJECTS but they don't map to column types... Unfortunate !
    Now to answer your question, at the moment I'm thinking of rewriting the routines rather than wrapping them up. Only around ten of them... So that the tool you mention is not needed.
    Just have to proofOfConcept it but that's the latest options we are considering...
    Thanks for the pointer I look it up right away...
    Alain
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by SQLJ Development ([email protected]):
    You could define a Customer Object type and create PL/SQL wrapper procedures/functions that take these as arguments and call your original PL/SQL SP. Unfortunately, right now you would have to do that by hand (JPublisher only gives you a Java representation of the Customer object type) - if there were a tool to generate the Object type and the PL/SQL wrappers, would you expect to use that?
    For an example of doing this (albeit in a pedestrian way) see: http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/ java.817/a81357/sampcod8.htm#1042848 <HR></BLOCKQUOTE>
    null

  • Passing Record type parameter from one session to other session

    Hi,
    I have a package.procedure, in that I am calling custom workflow, inside this workflow again I am calling
    same package.procedure (Its an recursive call)
    I need to pass record type parameter in this package.procedure.
    I tried with global variables but Workflow starts its new session so it losses all variables.
    Now I am going with creation of Custom table.
    Please advice, is there any way other than creation of Custom table.
    I mean can we pass Record type parameter from one session to other session without creating table.
    Regards
    Rohit

    Al-Salamu Alikum We Rahmatu Allah We Barakatu...
    want this place from to be passed as a parameter to the shipping bill form..... using web.show_documentwhy don't u think of just passing data parameter or global parameters from one form to another
    Pass global variable between two forms.
    Hope this helps...
    Regards,
    Abdetu...

  • How to pass parameter in sql developer for debubing record type

    DECLARE
      IB_BP_BANK_ACCOUNT_BUF PL/SQL RECORD;  ---record type
      IP_BP_ID NUMBER;
      IOP_ACC_SEQ_NO NUMBER;
      OP_ERROR VARCHAR2(200);
    BEGIN
      IB_BP_BANK_ACCOUNT_BUF := NULL;
      IP_BP_ID := NULL;
      IOP_ACC_SEQ_NO := NULL;
      ORAGTW11.MAINTAIN_BP_BANK(
        IB_BP_BANK_ACCOUNT_BUF => IB_BP_BANK_ACCOUNT_BUF,
        IP_BP_ID => IP_BP_ID,
        IOP_ACC_SEQ_NO => IOP_ACC_SEQ_NO,
        OP_ERROR => OP_ERROR
      /* Legacy output:
    DBMS_OUTPUT.PUT_LINE('IOP_ACC_SEQ_NO = ' || IOP_ACC_SEQ_NO);
      :IOP_ACC_SEQ_NO := IOP_ACC_SEQ_NO;
      /* Legacy output:
    DBMS_OUTPUT.PUT_LINE('OP_ERROR = ' || OP_ERROR);
      :OP_ERROR := OP_ERROR;
    END;

    Something like this:
    Assuming you have a procedure like this:
    CREATE OR REPLACE PROCEDURE abc (p_emp emp%ROWTYPE)
    IS
    BEGIN
       DBMS_OUTPUT.put_line (p_emp.empno);
    END;
    Then you have to call it from a PL/SQL Block in this way i.e.:
    DECLARE
      v_emp emp%ROWTYPE;
    BEGIN
      SELECT *
        INTO v_emp
        FROM emp
       WHERE ROWNUM<=1;
       abc(v_emp);
    END;
    Regards.
    Al

Maybe you are looking for

  • Unable to save data in record working time

    Hi All, I am working on ESS portal , when I try to record & save working time in portal , it throw an error message as 'Unable to save data'. Can you plz assist me on this. Usefull answers will be awarded. Thanks, Nilima

  • How do I pass multiple values from a text box to an update statement

    I hope this does not sound to lame. I am trying to update multiple values Like this: Code|| Computer Desc || Computer Price || Computer Name SEL1 || Apple macbook || 1564 || Apple Macbook Basic SEL2 || Dell 630 || 1470 || Dell Latitude I want to chan

  • Possibility of extract from BCM list of users.

    Hello Everyone, Is there any possibility to have a list of agents with assigned queues and skills? Based on location or Cost Center? Thanks in advance for your time. SAP BCM v.5.5.500.20586 with SP1, 2, 4 and 5 installed. Kind regards, Pawel Wilczyns

  • How can I return my skype how it looked before upd...

    I do not accept current design of skype. It completelly sucks and unfit to use. I want to use skype with previous design. If you think skype became better so it is wrong conclusion. It sucks. I can not even see who wrote certain message. Theese fonts

  • U think this is a bug in Flash Professional 8????

    I have encountered this probem with Flash Professional 8 (Windows Version). When i filled the stroke with Bitmap Color and tried to Rotate it with a constraint by holding a Shift Key it got distorted. This is not hapening everytime we do it, but does