Stored Procedure for displaying data in Crystal Reports

Hi I am new to Oracle & Crystal Reports,so can any one please give me sample stored procedure to display data in Crystal report from Oracle by passing rwo input values.

from site:-
Crystal Reports will only support the return of a single refcursor from Oracle. Even the latest and greatest version 10 doesn't allow you to return more than one recordset at a time. You could add one more step to your procedure that would join up the output of the multiple refcursors into a PL/SQL table and then fetch the result set out through a single refcursor. That way you are using temporary space that will be cleaned up as soon as the connection is terminated and will only be returning a single refcursor

Similar Messages

  • How to use a stored procedure as a datasource in Crystal Report for Eclipse

    Hi All,
    I've written a stored procedure in oracle 10g with few input parameters and one refcursor output parameter. I want to use this stored procedure as a data source for creating a report in "Crystal Report For Eclipse 3.6.0".
    When I tried to add this stored procedure to the report using the connection explorer, I don't see any option to do this. But when I try to add any table, it shows options like "Add to the current report"....
    Can anybody assist me how to use a stored procedure as a data source in "Crystal Report For Eclipse"?
    Which driver should I use to connect to the oracle database? I tried using JDBC Driver for Oracle.
    Thanks in advance.

    Did you solve your problem? How did you do?

  • How to create a stored procedure and use it in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • Get Error on using Stored Procedure to use it in Crystal Reports XI

    Post Author: Krüger
    CA Forum: Integrated Solutions
    Hello, I need your help please. I use Oracle 10 and now write a correct compiled stored procedure: this procedure is really simple how you can see:set pagesize 50000set linesize 1000set wrap offset head offset feedback offset trimspool onset serveroutput onset verify offcreate or replace procedure GetFirmenNachMontag is  lutype varchar2(10);BEGINDECLAREbegin lutype:='Test';  dbms_output.put_line(lutype);END;END; In using in sql directly it is really all fine. But when I want to integrat it in a simple report in Crystal I get the error unknow databank connector error. I hope that somebody can help me please. With best regardsM.Krüger 

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • Fields in Stored Procedure does not appear in Crystal reports 2008.

    hi,
    I am now using crystal reports 2008 evaluation copy for 30 days. I am trying to create a stored procedure with parameter, here is my sample Stored Procedure code;
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `puerto`.`SP_FindEmployees`$$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_FindEmployees`(SIDNo VARCHAR(10))
    BEGIN
         SELECT * FROM employees WHERE IDNo=SIDNo;
        END$$
    DELIMITER ;
    when i try to call the procedure in sqlyog here is my sample code;
    CALL sp_findemployees('0000000001')
    it is successfull, but when i try to  connect it with crystal reports 2008 I got no fields in my stored procedure andi got this error message ;
    "Database Connector: 'HY00:[MySQL][ODBC 3.51 Driver][mysqld-5.1.33-community]incorect number of arguments for procedure puerto.sp_findemployees; expected 1, got 0 [Database vendor code: 1318]"
    CR2008 was not asking a parameter values.
    But when I try using stored procedure that i've made in MSSQL, CR2008 asking parameters and succefully created the reports needed.
    My Objective is to make a stored procedure  in MySQL by using select statement and filter it with parameter(s) that I will pass and CR2008 will use this stored procedure.
    i also try the view with this code below and it was successfull in CR2008.
    DELIMITER $$
    DROP VIEW IF EXISTS `puerto`.`ep_employees`$$
    CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `ep_employees` AS (SELECT `employees`.`IDNo` AS `IDNo`,`employees`.`FullName` AS `FullName` FROM `employees`)$$
    DELIMITER ;

    hi,
    Crystal Reports 2008 and MySQL 5 , ODBC driver 3.5 and ODBC driver 5.1.
    I use ODBC connector 3.5 because I got errors in ODBC drivers in 5.1.
    Do you have step by step procedure for creating add command dialog box?
    I try creating the add command dialog box
    here's my sample sql statement i don't know if its correct because no data appearing in my crystal report
    Select * from employees where idno=@IDNo
    in Command Parameter Dialog Box
    Parameter Name = @IDNo
    Prompting Text = @IDNo
    Value Type = String
    DefaultValue = 0
    thanks!

  • How to create stored procedures and use those in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    Hello,
    There is a document explainining how to use Oracle stored proc with Crystal reports.
    Check at:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1084c536-711e-2b10-e48a-924a60745253
    It is for older version but it should work and you can refer to it to get general idea how to start with it. It has a sample oracle stored proc and how to connect it from Crystal Reports.

  • Stored procedure for arhive

    I created a stored procedure for send data from a source bd to the bd destination with a link between BD
    But it will not work
    CREATE OR REPLACE PROCEDURE archivage ( source IN VARCHAR2, destination IN VARCHAR2)
    BEGIN
    / * - Prepare a cursor to select from the bd_source: * /
    source_cursor: = dbms_sql.open_cursor;
    DBMS_SQL.PARSE (source_cursor,
    'SELECT table_name FROM dba_tables' | | source,DBMS_SQL.NATIVE);
    LOOP i in source_cursor
    /* Or i use this !!!!
    SELECT object_name FROM dba_objects WHERE owner = 'SCOTT' AND object_type = 'TABLE'*/
    DBMS_SQL.DEFINE_COLUMN (source_cursor, i);
    end loop
    ignorer: DBMS_SQL.EXECUTE = (source_cursor);
    / * - Prepare a cursor to insert into the destination db: * /
    destination_cursor: = DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (destination_cursor,
    'INSERT INTO' | | destination | | DBMS_SQL.NATIVE);
    / * - Fetch a row from the source table and insert it into the destination table: * /
    loop
    if DBMS_SQL.FETCH_ROWS (source_cursor)> 0 ALORS
    - Obtenir des valeurs de colonne de la ligne
    DBMS_SQL.COLUMN_VALUE (source_cursor,i);
    DBMS_SQL.BIND_VARIABLE (destination_cursor,i);
    ignorer: DBMS_SQL.EXECUTE = (destination_cursor);
    ELSE
    EXIT;
    End If;
    END LOOP;
    /*-Close cursor */
    COMMIT;
    DBMS_SQL.CLOSE_CURSOR (source_cursor);
    DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    EXCEPTION
    WHEN OTHERS, THEN
    if
    DBMS_SQL.IS_OPEN (source_cursor)then
    DBMS_SQL.CLOSE_CURSOR (source_cursor);
    End If;
    if DBMS_SQL.IS_OPEN (destination_cursor) then
    DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    End If;
    RAISE;
    END;

    find 10 differences ... :(
    CREATE OR REPLACE PROCEDURE archivage (source        IN VARCHAR2,
                                           destination   IN VARCHAR2)
    IS
       source_cursor        INTEGER;
       destination_cursor   INTEGER;
       ignorer              INTEGER;
    BEGIN
       /* - Prepare a cursor to select from the bd_source: */
       source_cursor := DBMS_SQL.open_cursor;
       DBMS_SQL.
        PARSE (source_cursor,
               'SELECT table_name FROM dba_tables' || source,
               DBMS_SQL.NATIVE);
       FOR i IN source_cursor
       LOOP
          /* Or i use this !!!!
          SELECT object_name FROM dba_objects WHERE owner = 'SCOTT' AND object_type = 'TABLE'*/
          DBMS_SQL.DEFINE_COLUMN (source_cursor, i);
       END LOOP;
       ignorer := DBMS_SQL.EXECUTE (source_cursor);
       /* - Prepare a cursor to insert into the destination db: */
       destination_cursor := DBMS_SQL.OPEN_CURSOR;
       DBMS_SQL.
        PARSE (destination_cursor,
               'INSERT INTO ' || destination,
               DBMS_SQL.NATIVE);
       /* - Fetch a row from the source table and insert it into the destination table: */
       LOOP
          IF DBMS_SQL.FETCH_ROWS (source_cursor) > 0
          THEN
             --ALORS
             -- Obtenir des valeurs de colonne de la ligne
             DBMS_SQL.COLUMN_VALUE (source_cursor, i);
             DBMS_SQL.BIND_VARIABLE (destination_cursor, i);
             ignorer := DBMS_SQL.EXECUTE (destination_cursor);
          ELSE
             EXIT;
          END IF;
       END LOOP;
       /*-Close cursor */
       COMMIT;
       DBMS_SQL.CLOSE_CURSOR (source_cursor);
       DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    EXCEPTION
       WHEN OTHERS
       THEN
          IF DBMS_SQL.IS_OPEN (source_cursor)
          THEN
             DBMS_SQL.CLOSE_CURSOR (source_cursor);
          END IF;
          IF DBMS_SQL.IS_OPEN (destination_cursor)
          THEN
             DBMS_SQL.CLOSE_CURSOR (destination_cursor);
          END IF;
          RAISE;
    END;
    /

  • Using a stored procedure for a  sender jdbc adapter

    Hi all,
    The requirement is to use a stored procedure, for extracting data from a oracle database.
    Is it possible to do this.
    If yes, what should be the source structure in this case.
    Please help with the exact soln.
    Thanks!!
    Younus

    Hi,
    Did you check the blog pointed by Aamir?
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    You will need to use Oracle Functions instead of Oracle Stored Procedures. Read thru the blog and the note pointed in the blog . Think it is quite a good example.
    Regards
    Bhavesh

  • Stored Procedure for Crystal Reports

    Hi All,
    I developed this test stored procedure to see wheather we could a stored procedure for crystal reports. It compiled without any problem, but when I run it, it gives me error message. Here is the stored Procedure..
    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(
    TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
    TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    AS
    BEGIN
    OPEN TEST_CURSOR FOR
    SELECT *
    FROM TEST_TABLE
    WHERE TEST_TABLE.ID = TEST_PARAMETER;
    END TEST_PROCEDURE;
    And
    This is the error message..
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'TEST_PROC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I have created the package sucessfully.
    I was wondering If any one of you can advice me where I am making the mistake.
    Thank you

    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
                                                         TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    ...you have 2 parameters in your procedure WOLD1SIM.TEST_PROCEDURE(). you should also use two parameters when you execute the procedure.

  • Free Report Writer for Oracle Database except Crystal Report and Data Vison

    Dear All,
    I want Free Report Writer for Oracle Database except Crystal Report and Data Vision software.
    Wr are working on Linux and windows both platform.
    Any one have direct link or website address for it ?
    Regards,
    Vipul Patel
    Ahmedabad

    Please check the following link -
    http://www.google.co.in/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&q=open+source+report+writer+for+oracle&meta=&btnG=Google+Search
    Regards.
    Satyaki De.

  • SSRS - Oracle Stored procedure returns no data but does in SQL Developer Sudio

    HI there,
    Stored procedure returns no data when executed on the report but when i execute the stored procedure in Sql Developer it returns required rows.
    Thanks for your help!

    Hi Simon,
    When i test with simple query, i get the data.
    For your convenience, my stored proc looks lyk :
    PROCEDURE pr_REPORT_data(P_STARTDATE IN DATE, P_ENDDATE IN DATE, data_rows OUT T_CURSOR) AS 
    OPEN completed_Reinstatement FOR
      SELECT 
                 value1,.......value5
      FROM table1
    WHERE
        To_Date(createdDate, 'YYYY/MM/DD') BETWEEN To_Date(P_STARTDATE, 'YYY/MM/DD') AND To_Date(P_ENDDATE, 'YYYY/MM/DD');
    END pr_REPORT_data;          
    T_CURSOR is of type cursor which is declared on the package.
    I'm assuming the problem is with date parameters, however i converted the date before passing to
    WHERE clause. 

  • Stored Procedure for Accounts Receivable

    Hi. First off, apologies in advance if I have put this question into the wrong topic. Secondly, I first saw SAP 3 weeks ago when I stared my new job and have had no training so please bear with me if some of what I ask doesn't make much sense.
    OK, the issue is this.  In SAP B1, there is a built in Report called "Customer Receivables Aging" which allows you to see Customer Receivable Accounts by age (e.g 0-30, 31-60, 61-90, 90+) and so on.  The problem with the built in report is that it doesn't show all the fields I want - it only shows the Customer Name, balance, and then the aging balances.  I want to be able to see things like the customer's contact details, etc. I know this makes no sense because the whole point of the report is to be able to drill down into the different rows, but this report needs to be issued in printed form, hence the need for the extra fields.
    Since I can't seen any way from within SAP to change the fields returned by this report, I thought I'd have a stab at writing my own SQL to select out the same data along with the extra fields I wanted.  That's when the problems began...try as I might, I cannot get my figures to tally with the SAP Report.
    They are almost correct, but not quite. I am sure that I am missing a selection or some other element of the logic that B1 uses to create the built in report.
    If you want, I can post the SQL I'm using....I'm not an SQL guru by any means, but I do know my way around it; the biggest problem I have is that I cannot find any documentation as to the 4 letter tables that SAP uses and their relationships except on the most basic level (e.g ORIN is Open Return Invoice [maybe])
    Then I thought maybe it might be possible to edit that report section in B1 using the SDK.  That would be a better solution as I would not have to 'reinvent the wheel', I can just SELECT an extra field or three to include in the report.
    So my question is
    ->Does anyone have a stored procedure for SQL Server that can replicate correctly the SAP B1 "Customer Receivable Aging", even just the process SAP uses to gather this data would be good.
    OR
    is it possible to edit this report in SAP to put in the extra fields I want.
    Or, am I totally barking up the wrong tree? Thanks in advance, I know this is a long post.

    Hi Stephen,
    There should be a print layout attached to the on-screen report. This can be altered to show the additional fields you want without resorting to SDK or SQL development.
    When you have the Customer Receivables Ageing report open on screen, choose Tools-Print Layout Designer or click on the Print Layout Designer icon on the toolbar. When prompted, choose the layout you wish to edit and you'll be taken to the layout design. In the layout, you can add additional fields and should be able to add most business partner fields. As the report is set to portrait by default, I recommend changing it to landscape so you have lots more space to add the extra fields you want. This report writer is fairly intuitive, if a little basic.
    You will need to save this new report design, set it to be the default layout and then when you select to print the Customer Receivables Ageing report (ie Print Preview or Print) you will see the new report.
    Hope this helps,
    Owen

  • Date data from Crystal Report one day less than Date from Source

    Hi,
    I am creating a Crystal Report 4.0 for Enterprise Users (Client Version only) based on a BEx query. I have a field called 'Date' that I am bringing over from the BEx query. It has a format of MM/DD/YYYY. When I view the 'Date' in Crystal Reports, it is displaying as 1 day less from the actual data. For example, in the BEx Query, 'Date' = 11/01/2011.  In Crystal Reports, it is showing up as 10/31/2011, which is one day behind.  I'm not sure what's going on.
    Please help!

    Well, this is as weird as it gets!
    Here are the observations on SP02:
    1) The Date Characteristic is a day off in the report while the 'Key' shows correct date
    2) It displays in the '30.01.2011' (DD.MM.YYYY)format
    3) When you right-click this field to change the date format, the date option is missing
    4) You create a formula to see if this is a date and it returns True. The formula you can try is :
    isdate(). It returns False for any other function like isnumeric() etc
    5) So, this is a date filed, or CR4E thinks this is a date field, however doesn't let us change the format
    6) You cannot use this field with date functions like cdate(); weird!
    7) The only way you can show it the way you want is to write this formula:
    *mid(,4,2)&"/"&left(,2)&"/"&Right(,4)*
    This is still a string field, however displays as MM/DD/YYYY.
    In Crystal Reports 2011, however, the following formula on the same date field returns a date value, meaning you can further right-click this formula field to change the date format like a normal date field:
    cdate(tonumber(Right(,4)),tonumber(mid(,4,2)),tonumber(left(,2)))*
    The same formula, however, throws a 'String is non-numeric error in CR4E and I found that it doesn't like this:
    *tonumber(Right(,4)) ; same error
    I've tried a lot of combinations to make this a date field in CR4E, however none works!
    So, the only option is to use the formula that I mentioned above.
    P.S: If you install Patch 2.10, you'll notice that the Characteristic value shows the correct date. For some reason though, it is in the same format as the 'Key' and if we wish to change the date format, the only possible workaround is to extract the numbers and join like I suggested above.
    Hope this helps!
    -Abhilash

  • Step- by- Step on How to Load Excel data into Crystal Reports?

    Hi Friends,
                      Can anyone send me a Step- by- Step on How to Load Excel data into Crystal Reports? Pls help me. Thanks in Advance.
    Vijay

    It's also important to 'prep' the excel file prior to connecting to it.
    Give the data tab a meaningful name
    Make sure the column headers are unique and that every column has a header
    Delete any blank tabs
    If you have trouble with Excel changing the data type of a field (say, a social security number you want to be a string value rather than a number so you don't lose leading zero) an alternative would be to save the spreadsheet file as a CSV, create a schema.ini to specify the data types for each column (example below) and use the same steps to connect except instead of choosing Excel 8.0, scroll to the bottom and choose Text.  You have to make sure the CSV file is in the same folder as the schema.ini file that defines the columns.
    Schema.ini example:
    200912PUSD.csv
    ColNameHeader=True
    Format=CSVDelimited
    MaxScanRows=25
    CharacterSet=OEM
    Col1=SSN Char Width 9
    Col2=LAST_NM Char Width 25
    Col3=FIRST_NM Char Width 25
    Col4=DOB Date
    Col5=STDNT_ID Char Width 10
    Col6=SORTKEY Char Width 10
    Col7=SCHOOL_NM Char Width 30
    Col8=OTHER_ID Integer
    Col9=GRADE Char Width 2
    The filename in the first line needs to have the []  brackets around it, but I couldn't get it to display in this forum correctly.
    Edited by: Eric Petersen on Jan 27, 2010 9:40 AM

  • Stored Procedure For Web Service in Visual Composer 7.1

    Hello,
    I want to use stored procedure for Webservice in Visual Composer 7.1
    I can find this Web service but not supported. ( ex) prcreleased_test - Not supported )
    Log.
    Message: Error in connection - Can' t execute Web service.
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.processExecution: 
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb
    Log2
    Message: Stopped further execution since the interpreter is unusable
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.XGLInterpreter
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb '
    Help me^^ plz..

    Hi Tanna.
    Thanks for your reply^^
    I create webservice that access my stored procedure.
    But not supported.
    http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
    There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
    'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
    Our company's DB is MSSQL2005.
    please help me^^

Maybe you are looking for

  • Crashing EVERY DAY even after restarts and virus scan etc.

    Adobe Pro crashes at least 10 times a day and I get this message repeatedly. Adobe should really do a better job but I guess the company is fine with having a captive market of people who need to work with PDFs with limited options that are good for

  • Computer Issues (Monitor, Freezing, etc) --- Someone Help me Please!

    So for the past month my computer has sporadically froze and this mesage has appeared "Input Signal out of range, change settings to 1280 x 1024-60 Hz" Then after awhile it says: "Monitor going to sleep". After that, I cannot get the monitor to turn

  • Creating IDOC by Output type

    Hi Xperts, I've experienced cases of creating delivery idoc when sale order is created. This creation of idoc is triggered when an output type for the SO is determined. I want to understand how the configuration of Output type determines the corespon

  • Dns change not saved

    When i try to change the DNS to 8.8.8.8 the change is nog saved. The next time i check the DNS it has it,s old value. How come ?

  • Premier Pro CS4 crashes on launch

    When I start Premier Pro I get the dialog box with New or Open existing project. When I select New the dialog box disappears and the program hangs. I have uninstalled and reinstalled several times including removing use folders. Does anyone have any