Stored Procedure With Multiple Result Sets As Report Source : Crosspost

Hello Everyone,
I have an issue where i have created a stored procedure that returns multiple result sets
/* Input param = @SalesOrderID */
SELECT * FROM Orders TB1
  INNER JOIN OrderDetails TB2 ON  TB1.ID = TB2.ID
WHERE TB1.OrderID = @SalesOrderID
SELECT * FROM Addresses
  WHERE Addresses.OrderID = @SalesOrderID AND Addresses.AddressType = 'Shipping'
SELECT * FROM Addresses
  WHERE Addresses.OrderID = @SalesOrderID AND Addresses.AddressType = 'Billing'
This is just a quick sample, the actual procedure is a lot more complex but this illustrates the theory.
When I set the report source in Crystal X to the stored procedure it is only allowing me to add rows from the first result set.
Is there any way to get around this issue?
The reason that I would prefer to use a stored procedure to get all the data is simply performance. Without using one big stored procedure I would have to run at least 6 sub reports which is not acceptable because the number of sub reports could grow exponentially depending on the number of items for a particular sales order.
Any ideas or input would be greatly appreciated.
TIA
    - Adam
P.S
Sorry for the cross post, I originally posted this question [here|/community [original link is broken];
but was informed that it might be the wrong forum
Edited by: Adam Harris on Jul 30, 2008 9:44 PM

Adam, apologies for the redirect, but it is better to have .NET posts in one place. That way anyone can search the forum for answers. (and I do not have the rights to move posts).
Anyhow, as long as the report is created, you should be able to pass the datasets as:
crReportDocument.Database.Tables(0).SetDataSource(dataSet.Tables("NAME_OF_TABLE"))
Of course alternatively, (not sure if this is possible in your environment) you could create a multi-table ADO .NET dataset and pass that to the report.
Ludek

Similar Messages

  • Calling a Stored Procedure with a result set and returned parms

    I am calling a stored procedure from a Brio report. The stored procedure returns a result set, but also passes back some parameters. I am getting a message that states that the DBMS cannot find the SP with the same footprint. Besides the result set, the SP returns 3 out parameters: (Integer, char(60), char(40)). Is there something special I need to do in Brio to format the out parameters to be passed back from the SP.
    Thanks,
    Roland

    Did you try just declaring the vars?
    untested
    declare
      myCur SYS_REFCURSOR;
      myRaw RAW(4);
      BEGIN
        test (0, 0, myRaw, sysdate, myCur);
      END;

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • Oracle 8.1.6 Thin Driver with Multiple Result Sets

    We're using Oracle 8.1.6 on NT using the latest driver release.
    Java 1.2.2
    We're experiencing problems with resultSet.next when we have multiple result sets open. What appears to be happening when you've read the last result set entry do a .next() call which should result in a false value we actually get java.sql.SQLException: ORA-01002: fetch out of sequence.
    This seems to us that the driver is trying to go beyond the end of the result set.
    We've checked JDBC standards (and examples on this site) and the code we've got is compliant. We've also found that the code produces the correct results under Oracle 7.3.4 and 8.0.4.
    I can also say that there is no other activity on the db, so there are no issues such as roll back segments coming into play.
    Any solutions, help, advice etc would be gratefully appreciated!
    null

    Phil,
    By "multiple result sets open", do you mean you are using REF Cursors, or do you have multiple statements opened, each with its own ResultSet? If you could post an example showing what the problem is, that would be very helpful.
    You don't happen to have 'for update' clause in your SQL statement, do you?
    Thanks

  • Stored procedure with multiple Reference Cursors

    In Sybase and SQLServer, result sets are returned to the application implicitly. Oracle emulates this by passing back weak reference cursors to the application through an IN OUT parameter.The number of reference cursors must match the number of results sets. For example, if 2 select statements are present in the stored procedure code, then 2 reference cursors are passed back.The Oracle Migration Workbench creates the correct number of reference cursors but assigns each select statement results to the first cursor created. Therefore only the last set of results are returned to the client.
    Before (SQLServer)
    CREATE PROCEDURE get_sch_associated_appointment_info (@piAcc_itn int) AS SELECT s.acc_itn, r.internal_key, r.mnemonic, r.descp, sh.start_dtime, sh.end_dtime FROM schdtl s, schdtlhdr sh, resource r WHERE s.acc_itn = @piAcc_itn and sh.acc_itn = @piAcc_itn and sh.resource_itn = r.internal_key SELECT sdcr.acc_itn, sdcr.rsch_dtime, sdcr.rsch_by_init, sdcr.rsch_code, sdcr.rsch_reason, sdcr.cncl_dtime, sdcr.cncl_by_init, sdcr.cncl_code, sdcr.cncl_reason, sdcr.prev_start_dtime, sdcr.prev_by_init FROM schdtl_canrsch sdcr WHERE sdcr.acc_itn = @piAcc_itn SELECT sdi.acc_itn, i.sched_notes, i.post_sched_notes, d.pre_sch_notes, d.post_sch_notes, i.detail_key, i.output_notes FROM schdtl_info sdi, extitem i, dept d WHERE sdi.acc_itn = @piAcc_itn and sdi.actual_dept = i.dept and sdi.actual_proc_no = i.proc_no and sdi.actual_dept = d.dept
    After (Migration Workbench) – Optional Section
    CREATE OR REPLACE PROCEDURE get_sch_associated_appointment_info (piAcc_itn int, RC1 IN OUT Omwb_emulation.globalPkg.RCT1) AS OPEN RC1 SELECT s.acc_itn, r.internal_key, r.mnemonic, r.descp, sh.start_dtime, sh.end_dtime FROM schdtl s, schdtlhdr sh, resource r WHERE s.acc_itn = piAcc_itn and sh.acc_itn = piAcc_itn and sh.resource_itn = r.internal_key; OPEN RC1 SELECT sdcr.acc_itn, sdcr.rsch_dtime, sdcr.rsch_by_init, sdcr.rsch_code, sdcr.rsch_reason, sdcr.cncl_dtime, sdcr.cncl_by_init, sdcr.cncl_code, sdcr.cncl_reason, sdcr.prev_start_dtime, sdcr.prev_by_init FROM schdtl_canrsch sdcr WHERE sdcr.acc_itn = piAcc_itn; OPEN RC1 SELECT sdi.acc_itn, i.sched_notes, i.post_sched_notes, d.pre_sch_notes, d.post_sch_notes, i.detail_key, i.output_notes FROM schdtl_info sdi, extitem i, dept d WHERE sdi.acc_itn = piAcc_itn and sdi.actual_dept = i.dept and sdi.actual_proc_no = i.proc_no and sdi.actual_dept = d.dept;
    After (Manual Change)
    CREATE OR REPLACE PROCEDURE get_sch_associated_appointment_info (piAcc_itn int, RC1 IN OUT Omwb_emulation.globalPkg.RCT1, RC2 IN OUT Omwb_emulation.globalPkg.RCT1, RC3 IN OUT Omwb_emulation.globalPkg.RCT1) AS OPEN RC1 SELECT s.acc_itn, r.internal_key, r.mnemonic, r.descp, sh.start_dtime, sh.end_dtime FROM schdtl s, schdtlhdr sh, resource r WHERE s.acc_itn = piAcc_itn and sh.acc_itn = piAcc_itn and sh.resource_itn = r.internal_key; OPEN RC2 SELECT sdcr.acc_itn, sdcr.rsch_dtime, sdcr.rsch_by_init, sdcr.rsch_code, sdcr.rsch_reason, sdcr.cncl_dtime, sdcr.cncl_by_init, sdcr.cncl_code, sdcr.cncl_reason, sdcr.prev_start_dtime, sdcr.prev_by_init FROM schdtl_canrsch sdcr WHERE sdcr.acc_itn = piAcc_itn; OPEN RC3 SELECT sdi.acc_itn, i.sched_notes, i.post_sched_notes, d.pre_sch_notes, d.post_sch_notes, i.detail_key, i.output_notes FROM schdtl_info sdi, extitem i, dept d WHERE sdi.acc_itn = piAcc_itn and sdi.actual_dept = i.dept and sdi.actual_proc_no = i.proc_no and sdi.actual_dept = d.dept;

    I believe you are using .NET(?). If that is the case, please post this query to the .NET Development - Crystal Reports  forum:
    SAP Crystal Reports, version for Visual Studio
    That forum is monitored by qualified technicians and you will get a faster response there.
    Thank you for your understanding,
    Ludek

  • How to use stored procedure which returns result set in OBIEE

    Hi,
    I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
    I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
    Pls help me in solving this.
    Thanks

    Hi Radha,
    If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
    If you want to use caching, you should enable caching in the nqsconfig.ini file.
    Cheers,
    Daan Bakboord

  • Dynamically calling stored procedure and getting result set c++

    Hello,
    I am trying to write some c++ code that will dynamically bind values to a stored procedure and excute the procedure and get back a resultset. The problem I am running into is how to get back the resultset. Any help or example would be highly appreciated.

    int main(int argc, char* argv[])
    OCIError* pOciError;
    char* pConnectChar = "dbname";
    char* pUsernameChar = "scott";
    char* pPasswordChar = "tiger";
    int answer;
    OCIStmt* pOciStatement;
    char* sqlCharArray = "BEGIN :success := sp_ListEmp; END;";
    int id;
    char ename[40];
    OCIEnv* g_pOciEnvironment = NULL;
    OCIServer* g_pOciServer = NULL;
    OCISession* g_pOciSession = NULL;
    OCISvcCtx* g_pOciServiceContext = NULL;
    sb2* pIndicator=0;
    sb2* pIndicator2=0;
    sb2* pIndicator3=0;
    OCIDefine* pOciDefine;
    OCIDefine* pOciDefine2;
    OCIBind* pBind;
    OCIStmt* cursor;
    answer = OCIInitialize(OCI_THREADED, NULL, NULL, NULL, NULL);
    answer = OCIEnvInit(&g_pOciEnvironment, OCI_DEFAULT, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciSession, OCI_HTYPE_SESSION, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServer, OCI_HTYPE_SERVER, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
    answer = OCIServerAttach(g_pOciServer, pOciError, (unsigned char *)pConnectChar, strlen(pConnectChar),
    OCI_DEFAULT);
    answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pUsernameChar, strlen(pUsernameChar),
    OCI_ATTR_USERNAME, pOciError);
    answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pPasswordChar, strlen(pPasswordChar),
    OCI_ATTR_PASSWORD, pOciError);
    answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciServer, 0, OCI_ATTR_SERVER, pOciError);
    answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciSession, 0, OCI_ATTR_SESSION, pOciError);
    answer = OCISessionBegin(g_pOciServiceContext, pOciError, g_pOciSession, OCI_CRED_RDBMS, OCI_DEFAULT);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&pOciStatement), OCI_HTYPE_STMT, 0, NULL);
    answer = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray, strlen(sqlCharArray),
    OCI_NTV_SYNTAX, OCI_DEFAULT);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&cursor), OCI_HTYPE_STMT, 0, NULL);
    answer = OCIBindByPos(pOciStatement,&pBind, pOciError, 1, &cursor, 0,SQLT_RSET,
    pIndicator2, 0,NULL, 0,0,OCI_DEFAULT);
    answer = OCIStmtExecute(g_pOciServiceContext, pOciStatement, pOciError, 1, 0, NULL, NULL,
    OCI_COMMIT_ON_SUCCESS);
    answer = OCIDefineByPos(cursor,&pOciDefine, pOciError,2,&id,sizeof(int),
    SQLT_INT,pIndicator, 0, 0,OCI_DEFAULT);
    answer = OCIDefineByPos(cursor,&pOciDefine2, pOciError,1,ename,40,
    SQLT_STR,pIndicator3, 0, 0,OCI_DEFAULT);
    if (answer == 0)
    while ((answer = OCIStmtFetch(cursor,pOciError, 1,OCI_FETCH_NEXT,OCI_DEFAULT)) == 0)
    printf("fetched id %d and name %s\n",id,ename);
    answer = OCIHandleFree(pOciError, OCI_HTYPE_ERROR);
    return 0;

  • Multiple result sets from stored procedure into CachedRowSet

    How can you obtain multiple sets of data from a stored procedure that returns multiple result sets, when you'd like to use CachedRowSet rather than ResultSet?
    My database's stored procedures return multiple result sets, but I'm not sure how to manipulate that using CallableStatements and CachedRowSets... I read the RowSet tutorial from java.sun.com but that didn't cover the case of multiple result sets and CallablStatements.
    How might I do this? Thanks a lot.

    SELECT columns..
    FROM table
    FOR XML PATH('NodeName'),('Rootname')
    Thank you for replying.
    I dont have to generate XML from a query. I have to generate from a SP and that too without modifying it.
    Thanks,
    Tauhid
    thats ok you can do like this
    1. Create a table with structure same as SP resultset
    2. Populate table with SP result as per below
    INSERT table
    EXEC SPName param1value,...
    3. Add a query like below
    SELECT columns..
    FROM tablename
    FOR XML PATH('NodeName'),('RootName')
    see
    http://visakhm.blogspot.com/2014/05/t-sql-tips-fun-with-for-xml-path.html
    4. Use sp_send_dbmail to sent it through mail
    http://msdn.microsoft.com/en-IN/library/ms190307.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Report with stored proc running multiple stored procedures with insert statement

    Hi,
    I wonder if this is possible in SSRS ... I use the 2012 version (Data Tools).
    I have a report that triggers a stored procedure. See below.
    Within this SP there are 2 insert statements getting data from 2 other SP's.
    When I make a dataset referring to the main SP below, SSRS does not show me any fields at all.
    Is this because it's a SP with insert statements and nested SP's?
    At the end of the SP I make a select so it should see all the fields.
    The parameters @month and @costcenter are multivalue params. I use a special function to convert the multivalues, selected in the report, into a string to pass it correctly to the query (comma separated).
    USE [TestDB]
    GO
    /****** Object:  StoredProcedure [dbo].[_Pink_SP_StandingsRegisterDataset]    Script Date: 15-4-2014 13:31:30 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[_Pink_SP_StandingsRegisterDataset]
    @year INT,
    @month NVARCHAR(50),
    @costcenter NVARCHAR(500),
    @GLaccount NVARCHAR(9)
    AS
    BEGIN
    /* Remove existing content*/
    DELETE FROM _Pink_TB_StandingsRegister
    /* Add records part 1 */
    INSERT INTO _Pink_TB_StandingsRegister
    EXEC _Pink_SP_StandingsRegister @year, @month, @costcenter, @GLaccount
    /* Add records part 2 */
    INSERT INTO _Pink_TB_StandingsRegister
    Type,
    Row,
    Year,
    Month,
    YearDatetable,
    MonthDatetable
    EXEC _Pink_SP_StandingsRegisterDatetable @year
    /* Select all records */
    SELECT *
    FROM _Pink_TB_StandingsRegister
    END
    GO

    Hi bijntjede2e,
    After testing a similar scenario in my own environment, it works well in Reporting Services. In my test, the stored procedure returns all the fields from _Pink_TB_StandingsRegister table in the dataset. Then I select some values from year, month, costcenter
    and Glaccount parameters, it inserts some values in the _Pink_TB_StandingsRegister table. So we can use this stored procedure as the dataset in the report.
    In order to solve the problem more efficiently, I need to clarify some information.
    Are you pass multiple values parameter to one stored procedure correctly? We can refer to the following thread:
    http://social.technet.microsoft.com/Forums/en-US/dbdfa101-cccc-4e9f-aa50-566dc5ebcc27/ssrs-2008-r2-report-dataset-call-a-stored-procedure?forum=sqlrep
    What results are you get when executing the stored procedure in SQL Server Management Studio? Is it works well? We should double those stored procedures.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • T-sql 2008 r2 place results from calling a stored procedure with parameters into a temp table

    I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:
    /* Create TempTable */
    CREATE TABLE #tempTable
    (MyDate SMALLDATETIME,
    IntValue INT)
    GO
    /* Run SP and Insert Value in TempTable */
    INSERT INTO #tempTable
    (MyDate,
    IntValue)
    EXEC TestSP @parm1, @parm2
    If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?

    declare @result varchar(100), @dSQL nvarchar(MAX)
    set @dSQL = 'exec @res = TestSP '''+@parm1+''','' '''+@parm2+' '' '
    print @dSQL
      EXECUTE sp_executesql @dSQL, N'@res varchar(100) OUTPUT', @res = @result OUTPUT
    select @result
    A complicated way of saying
    EXEC @ret = TestSP @parm1, @parm2
    SELECT @ret
    And not only compliacated, it introduces a window for SQL injection.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Java- Stored Procedure with Call by Result

    Hi Oracle-Community,
    I am looking for some example Code how to use a Java-Stored Procedure with Out-Parameters. Don't get me wrong. I dont want to call a Procedure with Out Parameters from Java (there are a lot of examples for this out there) . I just want to implement the Call by Result concept in a Java-Stored Procedure. A Client will call this Procedure with some parameters and the Java Procedure will fill them. So my first question: is this possible? And my second Question: How to implement it?
    Greetings.

    I found out a solution. It is very simple.
    Just defining the parameters as java array (e.g. String[] P1). The first value (P1[0]) is the returned value.
    At last just set in JDeveloper in the "Edit Method Signature" Dialog the parametermode to OUT.
    The dialog can be found by rightclicking on the stored procedure in the dbexport file. You can read this
    in Section 6 Publishing Java Classes With Call Specifications -> Setting Parameter Modes in
    Oracle Database Java Developer's Guide.

  • Reporting off oracle stored procedure with parameters error

    Erorr message: Error in File xxx.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: 907 ]
    Asp.net 2.0 web application.
    CR XI R2 sp2 in BOE XI R2 sp2 on Solaris 10.
    Database: Oracle 10g on Solaris 10. Oracle stored procedure defined in package.
    Happens with reports reporting off stored procedure with parameters.
    The sp is used in the crystal report.
    The web application passes parameters to crystal report, which then passes the parameters to stored procedure.
    Encountered error if:
    r.PromptOnDemandViewing = false;
    r.UseOriginalDataSource = false;
    r.CustomServerType = CeReportServerType.ceServerTypeOracle;
    Report can retrieves data if:
    r.PromptOnDemandViewing = false;
    r.UseOriginalDataSource = true;
    r.CustomServerType = CeReportServerType.ceServerTypeOracle;
    In addition
    The steps are:
    1)     Create oracle package and stored proc.
    2)     In CR Designer, select the stored proc as datasource.
    3)     The parameters names were "generated" by the CR Designer.
    4)     Rename the parameter names.
    5)     Drag the fields onto report.
    We noticed the following with different setting of database logon info:
    When previewing from BOE, get error when "Use custom database logon information specified here"
    However, no error when "Use original database logon information from the report". 
    Am i missing something?

    Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to use stored procedure with many return results and variable with perl

    Hi everybody,
    i´m writtting now a Perl programm, wich use a oracle stored procedure with more than 1 result and 1 variable(I have to return 2 variable fpr each result). I don´t now how I can get it.I already search the web but I didn´t find.
    My example:
    PROCEDURE get_projects_and_sub_projects (
    v_project_id IN INTEGER,
    v_project_c_id OUT INTEGER,
    v_project_id_find OUT VARCHAR2
    IS
    BEGIN
    SELECT c_id, proj_id
    INTO
    v_project_c_id,
    v_project_id_find
    FROM t_projet
    WHERE t_projet .ksa_pro_art_kbz = 'KU'
    AND t_projet.proj_id LIKE v_project_id || '%';
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_project_c_id := NULL;
    v_project_id_find := NULL;
    WHEN OTHERS
    THEN
    kmessages.error (NULL,
    'get_projects_and_sub_projects',
    'Project-Name: ' || v_project_id,
    'Errornumber: '
    || SQLCODE
    || ' Error: '
    || SQLERRM,
    TRUE,
    TRUE
    raise_application_error (-20001,
    'Error '
    || SQLCODE
    || ' get_projects_and_sub_projects: '
    || SQLERRM,
    TRUE
    END get_projects_and_sub_projects;
    in Perl Program:
    sub get_projects_unterprojects_name($$){
    my ($db_handle, $proj_name_id) = @_; #$db_handle ist the DB Connection return value
    my $db_proj_c_id;
    my $db_proj_name;
    eval{ my $csr = $db_handle->prepare(q{
    BEGIN
    pro_doc_ber.get_projects_and_sub_projects(:proj_name_id, :db_proj_c_id, :db_proj_name);
    END;
    # parameter value
    $csr->bind_param(":proj_name_id", $proj_name_id);
    # return values
    $csr->bind_param_inout(":db_proj_c_id", \$db_proj_c_id, 11);
    $csr->bind_param_inout(":db_proj_name", \$db_proj_name, 20);
    $csr->execute(); };
    But this didn´t work. Could somebody give me some idea?
    Thank you
    Felx

    Some additional info would probably be helpful.
    What is your programming enviironment? Java?
    In any case I suspect that you will need to use the OCI to deal with specific Oracle types such as user defined object types -- thats not standard ANSI SQL.
    In Java I believe you need to use OPAQUE, there are some examples out there. I'm mostly a PL/SQL developer with some Java expereince so others here are more qualifed to answer your question more directly.

  • Executing a stored procedure containing multiple Select statements

    Post Author: Beverly
    CA Forum: General
    I am using Crystal  10.0 against a MS SQL 2000 server.
    I am trying to create a report based on a stored procedure that contains multiple select statements.  The sp requires a single parameter (Claim number) and contains 17 Select statements that produce results.
    I am able to use the Add command and execute the sp with the parameter, but I am only getting the results of the first select statement in the sp back in my data set.  Is there a way to have the data from each Select statement returned to my report?
    I have used Crystal for a while, but pretty much for straight-forward reporting.  I am familiar with the basics of SQL.
    I would appreciate any help anyone can offer.
    Thanks.

    Post Author: BISoftware
    CA Forum: General
    I believe Crystal Reports can only handle one recordset at a time, which means it can only handle a single select statement.  The only way I can see around this would be to break up your stored procedure into multiple stored procedures, so that each only contains a single select statement.  Then, use subreports to report on each individual sp. Hope this helps. - Davewww.BusinessSoftwareResource.com

  • 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

Maybe you are looking for

  • Help Needed in Input Value Help of Custom Set attribute

    Hi All, We have maintained value table for custom set type attribute. We generated UI configuration for this set type and brought it into the web UI. But, we did not get the value help on the UI. We are trying to get the value help by implementing th

  • Turning the page in a pdf from inside a swf video

    I am creating interactive PDFs from InDesign. On the first page of the pdf I have a swf video in which I would like to put a link or a button that would move you to page 2 of the pdf. Not another frame of the video or URL, but just the next page of t

  • Crazy I know, but what is the best way to PREVENT a report portlet from running ?

    I know this sounds a very weird question. On a page I have a html form (that I use as search criteria for my report) as well as an actual report published as a portlet. On certain situations, such as when going to the page initially, I require that t

  • Page with questions I already asked

    how do I find the question I already asked? (When I submitted it, your confirmation page told me where to find it, I think. But Firefox does not let me return to that page! and I cannot find it otherwise.

  • How to run java exe files without having to install jre

    Hi all i want to run a java application. i already converted the jar file to exe using Launch4j but the problem is that i want to run the application on other computers without having to install jre. please, is this possible and if yes, how can i do