Ref Curosr in a Package

Is it so we can provide only one ref-cursor in a package...
Any help on this...
Thanks and Regards,
Kapil Uppal

Hi,
Why do you want to use Dynamic SQL here? Can you exlain in a bit more detail?
And if you do that, please mention your database version as well...
I read dbms_sql built-in package can be used but not finding a good example on how to do this.Where did you read that?
Examples regarding DBMS_SQL can be found by doing a search on this forum and on http://asktom.oracle.com
Besides DBMS_SQL you can also use EXECUTE IMMEDIATE, did you know that?
Examples are also documented by Oracle @ http://tahiti.oracle.com

Similar Messages

  • How to divide resultset of a query in different ref cursors in a package

    Hi Oracle Gurus,
    I need to create a package which counts the no of rows returned by a select query on multiple tables and according to the returned rowcount inputs the resultset in a ref cursor. Procedure will be called by a .NET program and output param refcursor will be assigned to a data reader which will redirect all the data to an Excel file.
    All the above is done. Issue is due to Excel's limit of 64000 rows, if data returned by query is greater than 64K it wont be fit in 1 Excel sheet. So, in order to overcome this limit I need to do some looping in Oracle package which keeps on storing the query results (rows<64K) in different ref cursors so that these refcursors as OUT params can be redirected to separate Excel sheets in C# program.
    NOTE : Earlier on I created 2 procedures in the package to fetch rows<64K and another one to fetch rows between 64K and rowcount of the query. My program was calling 2 different procedures to redirect data into 2 diff Excel sheets.
    But this fails when query resultset is even greater than 128000 or more and demands 3-4 or even more Excel sheets to be created.
    Please help.
    Any idea how to do looping in Oracle to accomplish this?

    > So, in order to overcome this limit I need to do some looping in Oracle package which keeps on
    storing the query results (rows<64K) in different ref cursors so that these refcursors as OUT params
    can be redirected to separate Excel sheets in C# program.
    Huh?
    That is saying that "I need to change this road and build it straight through that lake as the road has a curve here".
    It surely is a LOT easier to leave the road as is and simply turn the darn steering wheel in the car?
    Have the .Net data reader keep a row count of rows read from the ref cursor - and when it reached a pre-set max, have the reader do a "control break"[1] and change to a new worksheet as the destination for writing the rows to.
    [1] Google the term if you do not understand this basic concept that was among the very basic program control structures taught back in the 80's.. while I foam at the mouth how today's "wonder kids" turned programmers, that grew up with computers, do not even comprehend the most basic programming logic designs...

  • Report based on Ref Cursor and lock package/table (ORA-04021)

    Hi,
    I have reports based on Ref Cursor. Report builder and Reports Background Engine make pins for package, which consist of Ref Cursor, and for tables, which is used in package. So I can't grant any privileges on these tables anybody.
    For example, after next statement:
    GRANT SELECT ON table_name TO user_name
    I received the next error:
    ORA-04021: timeout occurred while waiting to lock object table_name
    Thanks

    Hi,
    I have reports based on Ref Cursor. Report builder and Reports Background Engine make pins for package, which consist of Ref Cursor, and for tables, which is used in package. So I can't grant any privileges on these tables anybody.
    For example, after next statement:
    GRANT SELECT ON table_name TO user_name
    I received the next error:
    ORA-04021: timeout occurred while waiting to lock object table_name
    Thanks

  • How to refer to a variable package name

    Hi All,
    I'm revising my PL/SQL packages, e.g. Pkg_Name_01, Pkg_Name_02 ... So if refering to a function within such a revised package, I need a method to get the version string from a global variable and then call the function via Pkg_Name_<version_string>.Function_Name (where version_string is the value of a global variable).
    Can anybody tell me if this is possible and if so how to achieve this?
    Thanks & Regards
    Carolin

    Carolin wrote:
    But as I have a lot of references to revised packages in my code it's a bit error-prone with each new revision - so I thougt there would be a better/simpler solution... How would the approach with dynamic sql look like?<i>Dynamic SQL is Evil ™</i> - okay not always. Judged from what is posted here, a full 1% of all dynamic SQL is not evil.
    The simpler solution is to use scope to enable your code to reference the appropriate version. In Oracle, there is unfortunately/fortunately no session scope in this regard. Resolution scope is either local (schema) or public.
    For example, the code library (schema <i>CODELIB</i>) has several versions of the FooInterface package, e.g.
    - CODELIB.FooInterface_v100
    - CODELIB.FooInterface_v110
    - CODELIB.FooInterface_v200
    Your schema, APP123 needs to use version 1.0 of this interface. A local schema synonym provides name resolution scope:
    create or replace synonym FooInterface for CODELIB.FooInterface_v110
    Another schema, HRDEMO, needs to use the latest version of the interface. Thus, as that schema:
    create or replace synonym FooInterface for CODELIB.FooInterface_v200
    Assuming FooInterface is a well behaved interface, you can at any time upgrade your schema to using a newer version of the interface, by recreating your schema synonym for the interface. And no code changes will be needed to your application code to keep it working.
    If your versioning needs are finer grained at this and at session level (e.g. different sessions in schema APP123 needs to use different versions of the <i>FooInterface</i>), then you have a serious implementation and versioning problem. Ones that cannot and should not be solved technically (using hacks like dynamic SQL). But ones that need to be addressed via change control and s/w management - in other words, you then have a broken SDLC (Software Development Life Cycle) that needs to be fixed.

  • Ref Curosrs in Oracle 8i

    Hi,
    Am currently using the Oracle 8i, i have return ref cursors in oracle 10g.. which is working fine.. but when am trying to use the same in Oracle 8i... am facing lot of problems.. could some one help me on this.. Please.
    Oracle 10g:
    CREATE OR REPLACE PROCEDURE emp_by_dept (
    p_deptno emp.deptno%TYPE
    IS
    emp_refcur SYS_REFCURSOR;
    X emp%ROWTYPE;
    BEGIN
    OPEN emp_refcur FOR SELECT empno, ename FROM emp WHERE deptno = p_deptno;
    DBMS_OUTPUT.PUT_LINE('EMPNO ENAME');
    DBMS_OUTPUT.PUT_LINE('----- -------');
    LOOP
    FETCH emp_refcur INTO X;
    EXIT WHEN emp_refcur%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(X.EMPNO || ' ' || X.ENAME);
    END LOOP;
    CLOSE emp_refcur;
    END;
    Where as 8i Is not working.. i just found that.. we can not do it in 8i using sys refcursor... could some one help me .. little urgent..

    SQL> CREATE OR REPLACE PROCEDURE emp_by_dept (
      2  p_deptno emp.deptno%TYPE
      3  )
      4  IS
      5  TYPE ref_cursor IS REF CURSOR;
      6  emp_refcur ref_cursor;
      7  X emp%ROWTYPE;
      8  BEGIN
      9  OPEN emp_refcur FOR SELECT * FROM emp WHERE deptno = p_deptno;
    10  DBMS_OUTPUT.PUT_LINE('EMPNO ENAME');
    11  DBMS_OUTPUT.PUT_LINE('----- -------');
    12  LOOP
    13  FETCH emp_refcur INTO X;
    14  EXIT WHEN emp_refcur%NOTFOUND;
    15  DBMS_OUTPUT.PUT_LINE(X.EMPNO || ' ' || X.ENAME);
    16  END LOOP;
    17  CLOSE emp_refcur;
    18  END;
    19  /
    Procedure created.
    SQL> EXECUTE emp_by_dept(20);
    EMPNO ENAME
    7369 SMITH
    7566 JONES
    7788 SCOTT
    7876 ADAMS
    7902 FORD
    7941 ABCDEFGHIJKLMNOPQRSTUVWXYZAAAAAA
    100 %Saubhik%
    PL/SQL procedure successfully completed.

  • Anyone with a hint ref. why my office package wont work after showing this message: "Check with the developer to make sure it works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates"

    also, I have to mention I already reinstalled package and nothing works. Help please!

    Hi, thanks for getting back. Here is the full content on the window that pops up every time I click on my Word icon: "Microsoft Word cannot be opened because of a problem. Check with the developer to make sure Microsoft Word works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X. Click Report to see more detailed information and send a report to Apple". I reinstalled the application, and everything else is updated, so I am not sure what to do.

  • Select query on REF CURSOR

    Hi all,
    I am trying see if we can use LINQ like functionality to query a ref cursor resultset. I have about 50 procedures( as part of 12 packages) which send the ref cursor output to a front end application when called individually. Now I need to create a procedure to get only specified records from each of these 50 ref cursors and output it to another ref curosr.
    In other words how can I use the following
    select col_2 from pkg_abc.pro_ref_cursor_out(arg1, arg2...) where col_1 = 'X':I am not inclined to use a fetch as I foresee performance issues?
    Thanks

    @ Tubby. Here is what I am looking to do. Let us say I have two packages as below each with one ref cursor. In reality there are about 15 packages and 50 procedures and hence 50 ref cursors.
    CREATE OR REPLACE PACKAGE pkg_1
    IS
       TYPE resultset_typ IS REF CURSOR;
       PROCEDURE pro_1 (
          i_region          IN       VARCHAR2,
          o_resultset      OUT      resultset_typ,          -- 'recordset' output
    END pkg_1;
    CREATE OR REPLACE PACKAGE BODY pkg_1
    IS
       PROCEDURE pro_1 (
          i_region          IN       VARCHAR2,
          o_resultset      OUT      resultset_typ,         
       IS
        BEGIN
           OPEN o_resultset FOR
                 SELECT 'employees' AS person_type, employee_name FROM tbl_employees WHERE region = i_region;   
        END;
       END pro_1;
    END pkg_1;
    CREATE OR REPLACE PACKAGE pkg_2
    IS
       TYPE resultset_typ IS REF CURSOR;
       PROCEDURE pro_2 (
          i_region          IN       VARCHAR2,
          o_resultset      OUT      resultset_typ,          -- 'recordset' output
    END pkg_2;
    CREATE OR REPLACE PACKAGE BODY pkg_2
    IS
       PROCEDURE pro_2 (
          i_region          IN       VARCHAR2,
          o_resultset      OUT      resultset_typ,         
       IS
        BEGIN
           OPEN o_resultset FOR
                 SELECT 'customers' AS person_type, customer_name FROM tbl_customers WHERE region = i_region;
        END;
       END pro_2;
    END pkg_2;Currenlty the front end app calls these packages individually when required. But I want to create an additional package as follows so that I dont have to write the underlying queries again.
    CREATE OR REPLACE PACKAGE pkg_3
    IS
       TYPE resultset_typ IS REF CURSOR;
       PROCEDURE pro_3 (
          i_region          IN       VARCHAR2,
          i_name           IN       VARCHAR2,
          o_resultset      OUT      resultset_typ,          -- 'recordset' output
    END pkg_3;
    CREATE OR REPLACE PACKAGE BODY pkg_3
    IS
       PROCEDURE pro_3 (
          i_region          IN       VARCHAR2,
          i_name           IN       VARCHAR2,
          o_resultset     OUT      resultset_typ,         
       IS
        BEGIN
           OPEN o_resultset FOR
                 SELECT * FROM pkg_1.pro_1(i_region) WHERE employee_name = i_name
                 UNION ALL
                 SELECT * FROM pkg_2.pro_2(i_region) WHERE customer_name = i_name
        END;
       END pro_3;
    END pkg_3;

  • REF Cursor in Forms 4.5

    I am using forms 4.5. I have a function whcih returns cursor. I would like to store the return values in Forms cursor variable and iterate thru the result set. When I declare TYPE cname IS REF CUROSOR I get compilation error. Is it possible to declare REF CURSOR in forms 4.5 . Help is greatly appreciated

    Thanks. Is there any way I can capture the ref curosr (or resultset) passed from server from the oracle forms. The purpose is to call the function from the forms with a table id which will return a resultset which is the items in the list , which is used to populate list in forms. To have a centralised location for list elements.
    Is there any package on forms which can be used to capture the returned resultset, pl. let me know

  • Issues using msi files packaged by Creative Cloud Packager.

    But when I try installing the products by doublecklicking the msi file, it doesn't install. It will only install if I doubleclick on the Setup file. And since I can't find a sillent install command line for that, and need to package this for use from SCCM 2012, it's no good. Also, I need a silent uninstall command for the product's, since the product codes can't be found in the registry under HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall, I'm not sure where to find the uninstall string either. Had a support chat for more than 50 minutes with an adobe engineer that was not very helpful at all and the chat ended abruptly without any resolution for me...

    Hi Annette,
    If I understand you correctly, you are trying to install a by Double clicking on MSI package.
    If you are looking for the Command that you should use to install, here it is:"msiexec.exe /i <pkg_name>.msi /quiet". Make sure you are already in that directory where you have this MSI package while running this in command prompt
    Here is another link which you can refer around Creative Cloud packager: Creative Cloud Help | Packager
    Kindly let us know if you stuck at any point, so that we can assist you further.
    Thanks,
    Atul Saini

  • Help needed in Ref cursor

    Hi,
    I am new to Ref Cursor concepts and I am trying a small block but its throwing error. Pls help me.
    PACKAGE SPEC:
    CREATE OR REPLACE PACKAGE PKG_JOBINFO AS
    PROCEDURE JOBINFO ( v_job_id IN number, p_cursor OUT PKG_JOBINFO.RESULT_REF_CURSOR);
    TYPE RESULT_REF_CURSOR IS REF CURSOR;
    END PKG_JOBINFO;
    PACKAGE BODY:
    CREATE OR REPLACE package body PKG_JOBINFO
    AS
    PROCEDURE JOBINFO ( v_job_id IN number,
    p_cursor OUT PKG_JOBINFO.RESULT_REF_CURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT JOB_ID,
    JOB_NAME,
    TABLE_NAME
    FROM JOB_INFO
    WHERE JOB_ID=V_JOB_ID;
    EXCEPTION
    WHEN OTHERS THEN
    raise;
    END;
    END;
    While compiling the package i am not getting any errors. I am getting errors only while executing
    SQL> exec PKG_JOBINFO.JOBINFO ('23');
    BEGIN PKG_JOBINFO.JOBINFO ('23'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'JOBINFO'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Please help me to resolve this error.
    Thanks.

    user497267 wrote:
    Thanks its working. So if we are using ref cursor we have to execute like this only.To add...
    The actual issue you were experiencing was not because you were using ref cursors specifically, but because you had an OUT parameter in your procedure.
    When you have an OUT parameter, you need to ensure that you pass in a variable to that parameter of the procedure in order that the procedure can populate it. In your case you were only passing in the first parameter, but you weren't passing in a variable to capture the OUTput.
    What Alex showed was that by declaring a variable of the same datatype (ref cursor in your case) and passing that in as the second parameter, that variable was populated with the ref cursor information from inside the procedure. Once that variable was populated, after the procedure call, the data from that ref cursor can be obtained (using SQL*Plus' print command in Alex's example).

  • Who will give the request number for a package?

    hi
    who will give the request number for a package , while releasing a package in se10 or se09

    Hi Shivika
    Please educate me, what is a package number? What does it relate? How and from where to get the number?
    The package number i refer is the service package number. The package number is being asked for when i refer the tables ESLH and ESLL.
    Regards
    Vijay

  • NWDS - Importing standard SAp packages

    Hi,
          I am new to NWDS java developmennt.
    I have succesfully developed, deployed a demo EJB to J2EE and also able to execute it from my SAP portal server.
    I am trying to use the user management API ot Portal (like package com.sap.security.api), however when I write the following statement, it gives an error on my local NWDS build.
    import com.sap.security.api;
    Question is how do I refer to this remote package (or any other SAP package) which is lying on J2EE on my local NWDS software build.
    Thanks,
    Amit Jain

    This is answered. The standard SAP packages are available on local machine.
    Right click on project->properties
    Selectr Java Build path-> Libraries->Add Variable->Select ECLIPSE_HOME
    Hit Extend
    Select Plugins
    Select com.sap.security_2.0.0
    Now the import com.sap.security.api.* statement will not give any syntax errors.
    Closing the thread.

  • How to Get Package Name While Running

    Hi
    i want to load Package Name to Table.
    So any idea about ODI Ref Function to get Package Name.

    Hi Nagarjuna,
    You can get package name by doing following steps, as per my knowledge, scenario name and package name both are same in ODI (while creating scenario for package).
    by the time you can retrieve scenario name as package name using below select query with selecting Work Repository schema in ODI variable
    QUERY:
    select SESS_NAME
    from <%=snpRef.getObjectName("L","SNP_SESSION","D")%>
    where SESS_NO = <%=snpRef.getSession("SESS_NO")%>
    Steps:
    1) create a project variable as Get_Package_Name and Data type as Alphanumeric, in Refreshing tab, type above select query and select work repository schema in schema (eg: create WorkRep logical schema in topology manager)
    2) Add Get_Package_Name variable with refresh in package (before interface step)
    3) Generate Scenario for package with same package name with version 001
    When you execute the scenario you can retrieve the package name in Get_Package_Name odi variaable
    Hope this may helps you
    Regards,
    phanikanth

  • Executing procedures in packages.

    <p>Hi </p><p>I am using CR XI developer edition.</p><p>I want to call stored procedures that currently resides in a package.  In database explorer it shows me:</p><p>"mypackage.testProcedure"  when I select it to execute, it gives me an error telling me <user>.testProcedure must be declared.  It drops the "mypackage" reference. Is there a value in <databaseStructure> I can set to make it recoginize and run my procedures in packages??</p><p>  <GenericJDBCDriver><br />  <Option>No</Option><br /> <strong> <DatabaseStructure>catalogs,schemas,tables</DatabaseStructure><br /></strong>  <StoredProcType>Oracle</StoredProcType><br />  <LogonStyle>Oracle</LogonStyle><br /> </GenericJDBCDriver></p><p>what values can <databaseStructure> have??</p><p> Shirley</p>

    PLEASE POST YOUR QUESTIONS TO THE DEV FORUMS.
    Requirements of Oracle Stored Procedures
    In order for Crystal Reports to report off Oracle stored procedures, all of the
    following requirements must exist.
    u2022 To use an ODBC connection to access an Oracle stored procedure, you
    must create a package that defines the REF CURSOR. This REF CURSOR
    must be strongly bound to a static pre-defined structure (see Strongly Bound
    REF CURSORs vs Weakly Bound REF CURSORs). This package must be
    created separately and before the creation of the stored procedure.
    u2022 A native connection to Oracle in Crystal Reports 9 and Crystal Reports 10
    can be used to access an Oracle stored procedure that was created within a
    package and also an Oracle stored procedure that references a weakly bound
    REF CURSOR
    u2022 The stored procedure must have a parameter that is a REF CURSOR type.
    Crystal Reports uses this parameter to access and define the result set that
    the stored procedure returns.
    u2022 The REF CURSOR parameter must be defined as IN OUT (read/write
    mode). After the stored procedure has opened and assigned a query to the
    REF CURSOR, Crystal Reports will perform a FETCH call for every row
    from the queryu2019s result. This is why the parameter must be defined as IN
    OUT.
    u2022 The parameters can only be defined as IN (input) parameters. Crystal
    Reports is not designed to work with OUT parameters.
    u2022 The REF CURSOR variable must be opened and assigned its query within
    the procedure.
    Crystal Reports Oracle Stored Procedures
    2/18/2004 2:55 PM Copyright © 2004 Business Objects. All rights reserved. Page 4
    cr_oracle_stored_procedures.pdf
    u2022 The stored procedure can only return one record set. The structure of this
    record set must not changed, based on parameters.
    u2022 The stored procedure cannot call another stored procedure.
    u2022 If using an ODBC driver, it must be the CR Oracle ODBC driver installed
    by Crystal Reports.
    u2022 If you are using the CR ODBC driver, verify that the option u2018Procedure
    Return Resultsu2019 is selected as u2018Onu2019 in the ODBC Driver Configuration setup
    under the u2018Advancedu2019 tab.
    u2022 If you are using the native Oracle driver and using hard-coded date selection
    within the stored procedure, the date selection must use either a string
    representation format of YYYY-DD-MM (where the date field = 2004-01-
    01) or the To_Date formula function with the same format specified (where
    date field = To_Date(2004-01-01u2019,u2019YYYY-MM-DDu2019).
    u2022 Most importantly, the stored procedure must be able to execute successfully
    in Oracleu2019s SQL *Plus utility.
    If all of these requirements have been met, verify that the database driver that
    you are using works with that version of Oracle.
    Strongly Bound REF CURSORs versus Weakly
    Bound REF CURSORs
    When declaring the REF CURSOR in an Oracle package, the REF CURSOR
    may be strongly bound or it may be weakly bound.
    A strongly bound REF CURSOR is bound with the same structure that is used
    by the outputted SELECT statement in the Oracle stored procedure.
    CREATE OR REPLACE PACKAGE Test_Package
    AS TYPE Test_Type IS REF CURSOR RETURN Test_Table%ROWTYPE;
    END Test_Package;
    The example code in green displays the REF CURSOR strongly bound. In this
    example, the REF CURSOR is bound with the row structure of the Test_Table
    table.
    A weakly bound REF CURSOR is not assigned a structure in the Oracle
    package.
    CREATE OR REPLACE PACKAGE Test_Package
    AS TYPE Test_Type IS REF CURSOR;
    END Test_Package;
    Although the REF CURSOR is not assigned a structure in the Oracle package,
    the Oracle stored procedure itself must return a record set with a structure that
    does not change based on parameters.
    Crystal Reports Oracle Stored Procedures
    2/18/2004 2:55 PM Copyright © 2004 Business Objects. All rights reserved. Page 5
    cr_oracle_stored_procedures.pdf
    Creating an Oracle Stored Procedure
    Samples of stored procedures and their steps on how to create them are
    provided. These are samples of Oracle stored procedures that will return a result
    set in Crystal Reports. If these samples were executed in the Oracle connection
    utility, SQL *Plus, they should run successfully.
    NOTE These sample stored procedures are provided as a tip. Refer to your Oracle
    documentation for more information on creating stored procedures.
    Sample A: Use with ODBC and native
    connections in Crystal Reports
    1. Create a table.
    CREATE TABLE Test_Table
    (ID number(5),
    Firstname varchar2(30),
    Lastname varchar2(30),
    Birthday date);
    2. Insert values into the table.
    INSERT INTO Test_Table VALUES
    (1, 'Christopher', 'Jones', '01-Nov-70');
    INSERT INTO Test_Table VALUES
    (2, 'Maria', 'Marshall', '02-Jan-77');
    INSERT INTO Test_Table VALUES
    (3, 'Jonathan', 'Campbell', '09-Aug-75');
    INSERT INTO Test_Table VALUES
    (4, 'Julie', 'Gagnon', '23-Dec-72');
    INSERT INTO Test_Table VALUES
    (5, 'Daemon', 'Thompson', '11-Feb-69');
    3. Create the Package.
    CREATE OR REPLACE PACKAGE Test_Package
    AS TYPE Test_Type IS REF CURSOR RETURN Test_Table%ROWTYPE;
    END Test_Package;
    4. Create the stored procedure.
    CREATE OR REPLACE PROCEDURE Test_Procedure (
    Test_Cursor IN OUT Test_Package.Test_Type,
    Test_Parameter IN Test_Table.ID%TYPE)
    AS
    BEGIN
    Crystal Reports Oracle Stored Procedures
    2/18/2004 2:55 PM Copyright © 2004 Business Objects. All rights reserved. Page 6
    cr_oracle_stored_procedures.pdf
    OPEN Test_Cursor FOR
    SELECT *
    FROM Test_Table
    WHERE Test_Table.ID = Test_Parameter;
    END Test_Procedure;
    5. Once the stored procedure is successfully created on your Oracle database,
    execute the stored procedure.
    Sample B: Weakly Bound REF CURSOR
    Only use this sample with a native connection to Crystal Reports 9 or later.
    1. Create a table.
    CREATE TABLE Test_Table
    (ID number(5),
    Firstname varchar2(30),
    Lastname varchar2(30),
    Birthday date);
    2. Insert values into the table.
    INSERT INTO Test_Table VALUES
    (1, 'Christopher', 'Jones', '01-Nov-70');
    INSERT INTO Test_Table VALUES
    (2, 'Maria', 'Marshall', '02-Jan-77');
    INSERT INTO Test_Table VALUES
    (3, 'Jonathan', 'Campbell', '09-Aug-75');
    INSERT INTO Test_Table VALUES
    (4, 'Julie', 'Gagnon', '23-Dec-72');
    INSERT INTO Test_Table VALUES
    (5, 'Daemon', 'Thompson', '11-Feb-69');
    3. Create the Package.
    CREATE OR REPLACE PACKAGE Test_Package
    AS TYPE Test_Type IS REF CURSOR;
    END Test_Package;
    4. Create the stored procedure.
    CREATE OR REPLACE PROCEDURE Test_Procedure (
    Test_Cursor IN OUT Test_Package.Test_Type,
    Test_Parameter IN Test_Table.ID%TYPE)
    AS
    BEGIN
    Crystal Reports Oracle Stored Procedures
    2/18/2004 2:55 PM Copyright © 2004 Business Objects. All rights reserved. Page 7
    cr_oracle_stored_procedures.pdf
    OPEN Test_Cursor FOR
    SELECT *
    FROM Test_Table
    WHERE Test_Table.ID = Test_Parameter;
    END Test_Procedure;
    5. Once the stored procedure is successfully created on your Oracle database,
    execute the stored procedure.
    Sample C: Stored procedure created within a
    package
    Only use this sample with a native connection to Crystal Reports 9 or later.
    1. Create a table.
    CREATE TABLE Test_Table
    (ID number(5),
    Firstname varchar2(30),
    Lastname varchar2(30),
    Birthday date);
    2. Insert values into the table.
    INSERT INTO Test_Table VALUES
    (1, 'Christopher', 'Jones', '01-Nov-70');
    INSERT INTO Test_Table VALUES
    (2, 'Maria', 'Marshall', '02-Jan-77');
    INSERT INTO Test_Table VALUES
    (3, 'Jonathan', 'Campbell', '09-Aug-75');
    INSERT INTO Test_Table VALUES
    (4, 'Julie', 'Gagnon', '23-Dec-72');
    INSERT INTO Test_Table VALUES
    (5, 'Daemon', 'Thompson', '11-Feb-69');
    3. Create the Package.
    CREATE OR REPLACE PACKAGE Test_Package
    AS TYPE Test_Type IS REF CURSOR RETURN Test_Table%ROWTYPE;
    PROCEDURE Test_Procedure (
    Test_Cursor IN OUT Test_Type,
    Test_Parameter IN Test_Table.ID%TYPE
    END Test_Package;
    Crystal Reports Oracle Stored Procedures
    2/18/2004 2:55 PM Copyright © 2004 Business Objects. All rights reserved. Page 8
    cr_oracle_stored_procedures.pdf
    4. Create the Package Body (With The Code For The Stored Procedure).
    CREATE OR REPLACE PACKAGE BODY Test_Package
    AS
    PROCEDURE Test_Procedure (
    Test_Cursor IN OUT Test_Type,
    Test_Parameter IN Test_Table.ID%TYPE
    ) IS
    BEGIN
    OPEN Test_Cursor FOR
    SELECT *
    FROM Test_Table
    WHERE Test_Table.ID = Test_Parameter;
    END Test_Procedure;
    END Test_Package;
    5. Once the stored procedure is successfully created on your Oracle database,
    execute the stored procedure.

  • Need Adventureworks 2014 DW SSIS Packages

    Hi All, 
    I want Analyse the design of  Adventure works 2014 Data Warehouse from Adventure works 2014 DB(OLTP).
    If any have or any one have link to download SSIS Packages/Project, Could you please share it or Can you guys please suggest me to  build SSIS Packages from Adventure works 2014 DB to Adventure works 2014 Data Warehouse.
    Thanks in Advance,
    Kareem

    You can download packages while installing SQL Server
    C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\
    I don't think AdeventureWorkDW2014 packages are available for download but you can design your own. Consider reading below books:
    Kimball- Micosoft Data Warehouse DW toolkit
    Professional
    Micorosft SQL Server 2014 Integration Services
    You can always refer older version SSIS packages for best practices and practice because the basic table structure and views are same.

Maybe you are looking for

  • Need to default text string values to null and leave numeric values as are

    Hi, This may be a simple question but I have the following query: select gis.province, ce.place_id from  cla_event ce Left join (select * from rbn_gis_area where version = 10) gis on ce.place_id  = gis.sp_codeProblem is place_id has text fields since

  • Remote does not find my Itunes Library

    I have 4 different mac and use Remote on my Ipod Touch to work with Itunes. Remote cannot connect to one of them (does not find the library). Settings (firewall, airport, account, permission, network...) on all my mac are similar but Remote does not

  • Mac Newbie - Problem opening Mail, says home directory is full

    I am new to Mac so forgive my ingnorance. I have been using Mail with no problems but just now (and each successive time despite restarts), when I open Mail a box pops up that says "Mail cannot update your mailboxes because your home directory is ful

  • Text justification issue in crystal report

    Hi, I have MVC application with crystal report in it. I am exporting crystal report to PDF, everything except text justification (as we do in MS-Word) is not working. Even in crystal report viewer itself it's not working. I have been trying since few

  • Trouble w/ conditional statement

    I'm building an RTF for the Receivables Mangaer > "Aging 4 Bucket report" when running this program you have to provide a report summary paramater either invoice or customer. If invoice all of you data is in the <LIST_G_I> element node, if customer i