Dynamic SQL and Oracle stored procedures

Does anybody has any experience with invoking an Oracle stored procedures
with output parameters, using dynamic SQL from Forte?
Thanks,
Dimitar

I would be interested. We are currently using a homegrown DataMapper architecture with the Microsoft OracleClient. I would like to move to ODP.Net once a production version supporting ADO.Net 2.0 is available. After that, I would then like to look at using an off the shelf persistence framework such as EntitySpaces, NHibernate or IdeaBlade's DevForce.

Similar Messages

  • JDBC Thin-Driver and Oracle Stored Procedure

    I've got a Oracle stored procedure which returns a Oracle record.
    How can I retrieve the record in java using the JDBC Thin-Driver ?
    Record:
    TYPE messagerec IS RECORD
    (log_level VARCHAR(2), timestamp VARCHAR2(19), text VARCHAR2(200));

    Using PL/SQL BOOLEAN, RECORD Types, and TABLE Types:
    Oracle SQLJ and JDBC do not support calling arguments or return values of the
    PL/SQL BOOLEAN type or RECORD types. Also, when using the Thin driver, they
    do not support calling arguments or return values of PL/SQL TABLE types (known
    as indexed-by tables). TABLE types are supported for the OCI driver.
    Check the following guide,
    http://otn.oracle.com/tech/java/sqlj_jdbc/pdf/a96655.pdf

  • Support a singly report on SQL Stored Procedure and Oracle Stored Procedure

    Hi,
    I have a requirement in which I need to create a report that will run both on oracle and sql server.
    Report is designed as follows.
    Main report contain 2 sub-reports.Sub-reports are  based on stored procedure that takes three input parameters(beginDate,endDate and hostname which is a comma-separated string).
    Main report also have three parameters (beginDate,endDate and hostnameList) that I am linking with both sub-reports.
    Since the crystal picks the same name of the parameter as we define in procedure it showing '@' symbol in all the parameters when I change the datasoure from oracle to sql server and that's why sub reports defined in main report loose all the linking and same happens when I switch from sql to oracle since in case of oracle it does not have '@' symbol in variable name.
    How can I have one report that work with both DBs without loosing the links.
    Any help will be appreciated.
    Thanks,
    Amrita

    There is no way of doing this in CR. At least not that I've ever heard of anyway.
    If you REALLY need to make this work and it REALLY has to be just 1 report... Here is what I'd do...
    In the SQL Server database, add a new table that contains the same columns that are being returned by the sp's. If you can't add new tables to the database, use a different database or server...
    Create a Linked Server linking the Oracle db to SQL Server. (If you take the 3rd server rout, do the same with the SQL Server)
    Write a new sp that will accept the {?WhichServer} parameter and populate the new table with the result set.
    Then just query that table for your report.
    I know this probably isn't the rout you were wanting to take but it should work...
    Jason

  • Scripted JDBC and Oracle Stored Procedure with in/out Array

    The com.waveset.util.pooledconnection used by Scripted JDBC Adapter extends java.sql.connection.
    I need to pass an Varchar2 Array to the Stored Procedure. I tried using the oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to pass the values, but get a casting exception,as the polledconnection implements only the java.sql.connection and not oracle.sql.connection.
    What are my options of using java.sql.Array with a PL/SQL procedure that takes a varchar2 array as in out parameter?
    Thanks
    Venki

    i ran my procedure which is very similar syndra posted
    create or replace procedure foo(p_dt in date, cv out sys_refcursor) as
    begin
    open cv for
    select e.*
    from table_xyz e
    where start_dt = p_dt;
    end;
    /Here is how is executed
    DECLARE
      P_DT DATE;
      CV SYS_REFCURSOR;
    BEGIN
      P_DT := '10-oct-2005';
      -- CV := NULL;  Modify the code to initialize this parameter
      scott.foo ( P_DT, CV );
      COMMIT;
    END;           
    -- i get PL/SQL procedure successfully complted , But i dont see the result set Or output
    - How do i see the output when i m using refcursor ?? i tried using print , but nothing didnt work
    - Any idea ??
    Thank you!!
    Edited by: user642297 on Jun 24, 2010 1:35 PM

  • Dynamic SQL and GRANT CREATE ANY TABLE

    hi gurus,
    i have a dynamic SQL in a procedure where a table will be created from an existing table without data.
    strSQL:='create table ' || strTemp || ' as select * from ' || strArc || ' where 1=2';
    execute immediate strSQL;
    without GRANT CREATE ANY TABLE for the user, *"ORA-01031: insufficient privileges"* error during execution.
    Is there a way to tackle this issue without providing GRANT CREATE ANY TABLE privilige?
    many thanks,
    Charles

    ravikumar.sv wrote:
    The problem is not because of dynamic sql...It probably has something to do with dynamic SQL or, more accurately, dynamic SQL within a stored procedure.
    From a SQL*Plus command prompt, you can create a table if your account has the CREATE TABLE privilege either granted directly to it or granted to a role that has been granted to your account. Most people probably have the CREATE TABLE privilege through a role (hopefully a custom "developer role" that has whatever privileges you grant to users that will own objects but potentially through the default RESOURCE role). That is not sufficient to create tables dynamically via a definer's rights stored procedure. Only privileges that are granted directly to the user, not those granted via a role, are visible in that case.
    I expect that the DBAs are granting the CREATE ANY TABLE privilege directly to the account in question rather than through whatever role(s) are being used which is why that appears to solve the problem.
    Justin

  • Extraction SQL statement from oracle stored procedure stored in file

    Hi,
    I am newbie to oracle stored procedure. I need to extract the list of sqls present in oracle stored procedure. Besides that I also want to parse these sql statements to get the list of tables and columns used. Is there any tool which can help me in doing thats.
    thanks,
    govind

    why don't check on user_dependencies table instead?
    select referenced_name,referenced_type
    from user_dependencies
    where name='<your stored procedure name in upper case>'
    and referenced_type = 'TABLE'HTH,
    Prazy

  • How to invoke Oracle stored procedures in Web Intelligence Custom SQL ?

    Hi,
    Referring to some older posts, I see that there is a work around to invoke a stored procedure to return results for a Web Intelligence report. Its been posted for calling a MS SQL stored proc, whereas the mentioned method does not seem to work for an Oracle Stored Procedure.
    Steps I followed:
    a) This is the parameter I have added in the oracle.sbo file => <Parameter Name="Force SQLExecute">Procedures</Parameter>
    b) My stored procedure code is as follows:
    CREATE OR REPLACE PROCEDURE get_emp_details(var_first_name OUT VARCHAR) AS
    BEGIN
    SELECT first_name INTO var_first_name
    FROM EMP_DETAILS_VIEW
    WHERE EMPLOYEE_ID = 100;
    END;
    c) Custom SQL code I added in my Webi report:
    set nocount on;
    /* SELECT
    EMP_DETAILS_VIEW.FIRST_NAME
    FROM
    EMP_DETAILS_VIEW
    exec get_emp_details;
    On trying to validate the SQL it gives me the following error message: "The SQL query has 0 instead of 1 columns.(WIS 10810)"
    Has anyone been able to successfully call an Oracle Stored procedure using the above method ?
    Version of BO: XI R3 SP2
    Oracle version: 11gR2
    PS: I am aware that web intelligence since XI R3.1 does allow use of a dedicated Stored Procedure Universe. I would want to know if it could
    be made to run in a normal Universe(not a stored procedure Universe)
    Thanks for your time and inputs.
    Regards,
    Jez

    EXECUTE is a SQL Plus command. You can directly call SP in PL/SQL
    DECLARE
        modif number;
    BEGIN
    select data_length into modif from user_tab_columns where table_name='CONTROL' and column_name='POSITION';
    IF modif < 10 THEN
        droptable('CONTROL');
        execute immediate('CRETAE TABLE CONTROL ....';
    ...

  • Create Oracle BLOB and Pass to Oracle Stored Procedure

    Hi All,
    I am using Oracle 10g and am dealing with a requirement where I have to upload a file to Oracle Portal from the client's local machine using a JSP.
    I am planning to convert the text file to a BLOB and pass it to an Oracle stored procedure which does the rest.
    I am unable to create a BLOB object. Can anybody help me with this please.
    Is there a better alternative to do it?
    Thanks in advance,
    Shardul

    u can create blob as below...
    java.sql.Blob blob=new Blob();
    File file=new File(fullPathTo UrFile);
    FileInputStream fInSteam = new FileInputStream(file);
    BufferedInputStream bInputStream = new BufferedInputStream(fInSteam);
    ByteArrayOutputStream bOutputStream = new ByteArrayOutputStream();
    int nextByte;
    while (( nextByte = bInputStream.read() ) != - 1)
    bOutputStream.write(nextByte);
    byte[] byteContent = bOutputStream.toByteArray();
    blob.setBytes(byte[]);
    i think it should work for u...

  • MS SQL Server system stored procedures can't be migrated into Oracle 11g

    During database migration from MS SQL Server 2008 to Oracle 11g R2, if the application stored procedure invokes the MS SQL Server system stored procedures (for example: sp_getapplock, sp_releaseapplock ....), these SQL server system stored procedures can't be transferred. See following migrated Oracle application stored procedure for example:
    create or replace
    PROCEDURE spPwSysID_GetNextID
    v_ID OUT NUMBER,
    iv_SysType IN NVARCHAR2 DEFAULT NULL ,
    iv_Cnt IN NUMBER DEFAULT NULL
    AS
    v_SysType NVARCHAR2(50) := iv_SysType;
    v_Cnt NUMBER(10,0) := iv_Cnt;
    v_result NUMBER(10,0);
    BEGIN
    --SQL Server BEGIN TRANSACTION;
    utils.incrementTrancount;
    v_Systype := UPPER(v_Systype) ;
    IF v_Cnt < 1 THEN
    v_Cnt := 1 ;
    END IF;
    v_result :=sp_getapplock(v_Resource => v_Systype,
    v_LockMode => 'Exclusive') ;
    IF v_result >= 0 THEN
    BEGIN
    SELECT ID
    INTO v_ID
    FROM PWSYSID
    WHERE SysType = v_SysType;
    IF SQL%ROWCOUNT = 1 THEN
    UPDATE PwSysID
    SET ID = ID + v_cnt
    WHERE SysType = v_SysType;
    ELSE
    BEGIN
    INSERT INTO PwSysID
    ( ID, SysType )
    VALUES ( v_cnt + 1, v_SysType );
    v_ID := 1 ;
    END;
    END IF;
    v_result :=sp_releaseapplock(v_Resource => v_Systype) ;
    END;
    ELSE
    BEGIN
    raise_application_error( -20002, 'Lock failed to acquire to generate Cityworks Id.' );
    END;
    END IF;
    utils.commit_transaction;
    END;

    During database migration from MS SQL Server 2008 to Oracle 11g R2, if the application stored procedure invokes the MS SQL Server system stored procedures (for example: sp_getapplock, sp_releaseapplock ....), these SQL server system stored procedures can't be transferred. See following migrated Oracle application stored procedure for example:
    create or replace
    PROCEDURE spPwSysID_GetNextID
    v_ID OUT NUMBER,
    iv_SysType IN NVARCHAR2 DEFAULT NULL ,
    iv_Cnt IN NUMBER DEFAULT NULL
    AS
    v_SysType NVARCHAR2(50) := iv_SysType;
    v_Cnt NUMBER(10,0) := iv_Cnt;
    v_result NUMBER(10,0);
    BEGIN
    --SQL Server BEGIN TRANSACTION;
    utils.incrementTrancount;
    v_Systype := UPPER(v_Systype) ;
    IF v_Cnt < 1 THEN
    v_Cnt := 1 ;
    END IF;
    v_result :=sp_getapplock(v_Resource => v_Systype,
    v_LockMode => 'Exclusive') ;
    IF v_result >= 0 THEN
    BEGIN
    SELECT ID
    INTO v_ID
    FROM PWSYSID
    WHERE SysType = v_SysType;
    IF SQL%ROWCOUNT = 1 THEN
    UPDATE PwSysID
    SET ID = ID + v_cnt
    WHERE SysType = v_SysType;
    ELSE
    BEGIN
    INSERT INTO PwSysID
    ( ID, SysType )
    VALUES ( v_cnt + 1, v_SysType );
    v_ID := 1 ;
    END;
    END IF;
    v_result :=sp_releaseapplock(v_Resource => v_Systype) ;
    END;
    ELSE
    BEGIN
    raise_application_error( -20002, 'Lock failed to acquire to generate Cityworks Id.' );
    END;
    END IF;
    utils.commit_transaction;
    END;

  • Using XI - RFC table and an Oracle stored procedure that returns a cursor.

    I need to create an interface using XI between an RFC table and an Oracle stored procedure that returns a cursor.  We are on oarcle 9.2 and  SP12.
    My stored procedure looks something like this:
    CREATE OR REPLACE
    PROCEDURE testproc_xi2 (p_recordset1 OUT SYS_REFCURSOR,
                                             in_quoteid IN varchar2 )
    AS
    BEGIN
      OPEN p_recordset1 FOR
       SELECT  q.quote_id,
                     q.modified_by,
                     q.quote_status,
                     q.total_cost
                FROM quote q
               WHERE q.quote_id = in_quoteid
                 AND q.total_cost > 0 ; 
    END testproc_xi2 ;
    My RFC has table and  one import parameter .
    I wanted to know how to create the data type for the ref cursor? and also for the table type in the RFC?
    CAN XI handle multi rows coming from a Stored procedure? Are there any other alternative methods if this is not supported?Any pointers to this would be helpful.
    I have called a Oracle SP from an RFC before, but that interface had one input parameter going to the stored procedure from the RFC and about 6 o/p parameters coming from the Stored procedure. This works fine.
    Thanks for the help.
    Mala

    Mala,
    i dont think there is anything called an rfc table...RFC stands for remote function call. That in essence would imply you need a rfc to jdbc connection.
    yes XI can handle multiple rows cooming from the the stored procedure if you have them mapped appropriately.
    Now as to how to create the data type within xi , you need to know what fields are going to be returned and whether they are nested and then just create them as you would for an xml
    for ex
    <Details>
      <FirstName>
    <LastName>
    </Details>
    that in xi would be smthing like
    Details  type of data occurence
    FirstName type of data occurence
    LastName type of data occurence.
    Hope that helps.
    If it does dont forget the points..:-)

  • Converting MS Sql server stored proc to Oracle stored procedure

    I need to convert this MS SQL Server 200 stored procedure to Oracle stored procedure. Any help great appreciated.
    Thank you,
    set nocount on
    declare @sp varchar(100)
    set @sp = '<< stored procedure name goes here >>'
    declare @oid int
    select @oid = o.id from sysobjects o where o.name = @sp
    declare @last int
    -- function signature
    select @last = max(c.colid)
    from dbo.syscolumns c
    where c.id = @oid
    select case c.colid
    when 1 then '[ SqlCommandMethod(CommandType.StoredProcedure) ]'
    + char(13) +
    'public static SqlCommand ' + @sp + '(' + char(13) +
    ' [ NonCommandParameter ] SqlConnection
    ' connection '
    + char(13) +
    else ''
    end
    + ' ' +
    case t.name
    when 'char' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length) + ')  '
    when 'varchar' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length) + ') ] '
    when 'nchar' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
    when 'nvarchar' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
    else ''
    end
    +
    case t.name
    when 'char' then 'string'
    when 'nchar' then 'string'
    when 'varchar' then 'string'
    when 'nvarchar' then 'string'
    when 'bit' then 'bool'
    when 'datetime' then 'DateTime'
    when 'float' then 'double'
    when 'real' then 'float'
    when 'int' then 'int'
    else 'object /* ' + t.name + ' */'
    end
    + ' ' + lower(substring(c.name, 2, 1)) + substring(c.name, 3, 100)
    +
    case c.colid
    when @last then ')' + char(13) + '{'
    else ','
    end
    from dbo.syscolumns c
    left outer join dbo.systypes t on c.xusertype = t.xusertype
    where c.id = @oid
    order by c.colid
    -- call to generator
    select case c.colid
    when 1 then
    ' return SqlCommandGenerator.GenerateCommand(connection,' +
    char(13)
    else ''
    end
    + ' ' + lower(substring(c.name, 2, 1)) + substring(c.name,
    3, 100)
    +
    case c.colid
    when @last then ');' + char(13) + '}'
    else ','
    end
    from dbo.syscolumns c
    where c.id = @oid
    order by c.colid

    It would have helped if you had posted your code.
    To create tables in procedures, you can use EXECUTE IMMEDIATE. For example, if within a procedure, you want to:
    CREATE TABLE table_name
    (column1 NUMBER,
    column2 VARCHAR2 (30),
    column3 DATE);
    Then, from within a procedure you can:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE TABLE table_name
    (column1 NUMBER,
    column2 VARCHAR2 (30),
    column3 DATE)';
    END procedure_name;
    EXEC procedure_name
    For the procedure to count the number of business days between two input dates, see the following link:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:91212348059

  • SSRS with Oracle Stored Procedures, Functions and Packages

    Hi,
    I am working on a BI project. Here we are using PowerPivot to access data from Oracle DB and generate reports. Currently Client generates Few reports using Oracle Stored Procedures, Functions and Packages. We need to move everything to PowerPivot, so
    that user can generate all reports using same platform. But PowerPivot doesn'e support Oracle Stored Procedures, Functions and Packages. So we have decided to try those reports using SSRS.
    I have no knowledge about using SSRS which will call Oracle function/stored procedures/packages for generating reports.
    Can anybody help me in getting exact steps?
    Please let me know if my question is not clear enough.
    Thanks and Regards,
    SS

    Hi Visakh,
    Thanks for the detailed steps. My next question is:
    Is there any other way to develop such reports without using any development tool like Visual Studio? Our aim is to provide a self-serviced reporting platform where user don't need any technical knowledge.
    I am sorry I have no knowledge about SSRS and Oracle DB.Can you please have a look at my Oracle function and let me know whether it's possible to execute this using SSRS? (I am pasting one by one as there is a character limit.
    CREATE OR REPLACE TYPE obj_special_pass_cases
    AS OBJECT
          CLAIM_ID    NUMBER(12),
          claim_ref_no  VARCHAR2(20),
          OFFICER_NAME   VARCHAR2(201),
          SUBMIT_DT   VARCHAR2(10),
          ACC_DT   VARCHAR2(10),
          SP_ISSUE_DT   VARCHAR2(10),
          STATUS    VARCHAR2(30),
          SUB_STATUS   VARCHAR2(30),
          STATUS_LAST_UPDATE_DATE VARCHAR2(10),
          SP_EXP_DT VARCHAR2(10),
          INDUSTRY_CODE VARCHAR2(8),
          EMP_SSIC VARCHAR2(8),
          rel VARCHAR2(4),
          WPNo VARCHAR2(20),
          FIN VARCHAR2(9),
          PASSPORT_NO VARCHAR2(16),
          SPNo VARCHAR2(20),
          VictimName VARCHAR2(100),
          SP_EXT_PURPOSE VARCHAR2(100),
          ISSUE_SYSTEM VARCHAR2(4), 
          REPATRIATION_DATE VARCHAR2(10),
          SP_STATUS    VARCHAR2(30),
          SP_ISSUE_PURPOSE VARCHAR2(500)
    CREATE OR REPLACE TYPE tbl_special_pass_cases
       AS TABLE OF obj_special_pass_cases
    CREATE OR REPLACE TYPE obj_special_pass_casesNew
    AS OBJECT
          CLAIM_ID    NUMBER(12),
          claim_ref_no  VARCHAR2(20),
          OFFICER_NAME   VARCHAR2(201),
          SUBMIT_DT   VARCHAR2(10), /*Case Registration Date*/
          ACC_DT   VARCHAR2(10),
          SP_ISSUE_DT   VARCHAR2(10),
          calc_sp_issue_dt VARCHAR2(10),
          calc_sp_issue_dt_month VARCHAR2(2),
          calc_sp_issue_dt_year VARCHAR2(4),
          calc_Duration_Of_Stay VARCHAR2(4),
          STATUS    VARCHAR2(30),
          SUB_STATUS   VARCHAR2(30),
          STATUS_LAST_UPDATE_DATE VARCHAR2(10),
          lastUpdateDtMonth varchar2(2),
          lastUpdateDtYear varchar2(4),
          DurationOfUpdateDt VARCHAR2(4),
          SP_EXP_DT VARCHAR2(10),
          INDUSTRY_CODE VARCHAR2(8),
          EMP_SSIC VARCHAR2(8),
          rel VARCHAR2(4),
          WPNo VARCHAR2(20), /* New columns from here - SR */
          FIN VARCHAR2(9),
          PASSPORT_NO VARCHAR2(16),
          SPNo VARCHAR2(20),
          VictimName VARCHAR2(100),
          workerNationality VARCHAR2(20),
          employName VARCHAR2(200),
          reportType VARCHAR2(10),
          SP_EXT_PURPOSE VARCHAR2(100),
          ISSUE_SYSTEM VARCHAR2(4), /*IWPS, EIDS*/
          REPATRIATION_DATE VARCHAR2(10),
          SP_STATUS    VARCHAR2(30),
          SP_ISSUE_PURPOSE VARCHAR2(500)
    CREATE OR REPLACE TYPE tbl_special_pass_casesNew
       AS TABLE OF obj_special_pass_casesNew
       FUNCTION getListOfSpecialPassCases(
                  vRepatriationDateFrom VARCHAR2,
                  vRepatriationDateTo VARCHAR2,
                  vIncludeRepatriationDate VARCHAR2)
        RETURN tbl_special_pass_cases
        IS
          TYPE cur_typ IS REF CURSOR;
          SPECIAL_PASS_CASES_CUR cur_typ;
          vSQL1 VARCHAR2(4000);
          --vSQL1 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID), A.CLAIM_REF_NO, A.STATUS, A.SUB_STATUS, A.OFFICER_NAME,  A.SUBMIT_DT, A.ACC_DT, A.vLatestUpdatedDate, A.INDUSTRY_CODE, A.ID_NO, A.vWorkerName, B.vSPWPNO, B.vFIN, B.vSPPassportNo,
    B.vSPIssueDate, B.vSPExpiryDate, B.vSPNo, DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB
    PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose, B.vIssueSystem, B.vSPActualDepartDate, B.vSPStatus, DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
    RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
    (SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO, vFIN, vSPPassportNo, vSPIssueDate, vSPExpiryDate, vSPNo, vSPExtensionPurpose, vIssueSystem, vSPActualDepartDate, vSPStatus, vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass) WHERE
    (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS,  WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME,  to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'')
    SUBMIT_DT, TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE FROM WIC_CLAIM_STATUS WCS WHERE
    WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE,event_victim ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND
    = ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID AND ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND
    EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO)';
          vSQL2 VARCHAR2(4000);
          --vSQL2 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID),A.CLAIM_REF_NO,A.STATUS,A.SUB_STATUS,A.OFFICER_NAME,A.SUBMIT_DT,A.ACC_DT,A.vLatestUpdatedDate,A.INDUSTRY_CODE,A.ID_NO,A.vWorkerName,B.vSPWPNO,B.vFIN,B.vSPPassportNo,B.vSPIssueDate,B.vSPExpiryDate,B.vSPNo,DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
    RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose,B.vIssueSystem,B.vSPActualDepartDate,B.vSPStatus,DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
    RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
    (SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO,vFIN,vSPPassportNo,vSPIssueDate,vSPExpiryDate,vSPNo,vSPExtensionPurpose,vIssueSystem,vSPActualDepartDate,vSPStatus,vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''' || vRepatriationDateFrom
    || ''', ''' ||  vRepatriationDateTo || ''')) WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS,WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME, 
    to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'') SUBMIT_DT,TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE
    FROM WIC_CLAIM_STATUS WCS WHERE WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE, IR_NOTIFICATION IRN,event_victim
    ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND = ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID and ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
    AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND IRN.REF_NO(+) = ECASE.IR_REF_NO AND IRN.SUBMIT_TYPE IN (''SI'',''SE'') AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO
    OR B.vSPPassportNo = A.ID_NO)';
          SPECIAL_PASS_CASES_TBL tbl_special_pass_cases := tbl_special_pass_cases();
       cursor sp_pass_settle_cur is
       SELECT DISTINCT (A.CLAIM_ID),
                    A.CLAIM_REF_NO,
                    A.STATUS,
                    A.SUB_STATUS,
                    A.OFFICER_NAME,
                    A.SUBMIT_DT,
                    A.ACC_DT,
                    A.vLatestUpdatedDate,
                    A.INDUSTRY_CODE,
                    A.ID_NO,
                    A.vWorkerName,
                    B.vSPWPNO,
                    B.vFIN,
                    B.vSPPassportNo,
                    B.vSPIssueDate,
                    B.vSPExpiryDate,
                    B.vSPNo,
                    DECODE(B.vSPExtensionPurpose,
                           '1',
                           'WICB',
                           '2',
                           'RE - APPLICATION',
                           '3',
                           'POLICE',
                           '4',
                           'REPATRIATION',
                           '5',
                           'LRD',
                           '6',
                           'LATE RENEWAL',
                           '9',
                           'OTHERS',
                           '10',
                           'LATE EISSUANCE',
                           '13',
                           'FMMD',
                           '14',
                           'TMB PENDING REPATRIATION',
                           '15',
                           'TMB REPATRIATION',
                           '16',
                           'PENDING REPATRIATION(SB - F)',
                           '17',
                           'REPATRIATION(SB - F)') vSPExtensionPurpose,
                    B.vIssueSystem,
                    B.vSPActualDepartDate,
                    B.vSPStatus,
                    DECODE(B.vSPIssuePurpose,
                           '1',
                           'WICB',
                           '2',
                           'RE - APPLICATION',
                           '3',
                           'POLICE',
                           '4',
                           'REPATRIATION',
                           '5',
                           'LRD',
                           '6',
                           'LATE RENEWAL',
                           '9',
                           'OTHERS',
                           '10',
                           'LATE EISSUANCE',
                           '11',
                           'PENDING DOCUMENT VERIFICATION',
                           '12',
                           'LATE ERENEWAL',
                           '13',
                           'FMMD',
                           '14',
                           'TMB PENDING REPATRIATION',
                           '15',
                           'TMB REPATRIATION',
                           '16',
                           'PENDING REPATRIATION(SB - F)',
                           '17',
                           'REPATRIATION(SB - F)') vSPIssuePurpose
      FROM (SELECT vSPWPNO,
                   vFIN,
                   vSPPassportNo,
                   vSPIssueDate,
                   vSPExpiryDate,
                   vSPNo,
                   vSPExtensionPurpose,
                   vIssueSystem,
                   vSPActualDepartDate,
                   vSPStatus,
                   vSPIssuePurpose
              FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass)
             WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
      JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
                   WC.CLAIM_REF_NO CLAIM_REF_NO,
                   WC.STATUS STATUS,
                   WC.SUB_STATUS SUB_STATUS,
                   TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
                   '' SUBMIT_DT,
                   TO_CHAR(trunc(decode(wc.assessmt_type,
                                        'OD-PI',
                                        EV.OD_CONSULT_DT,
                                        'OD-TI',
                                        ev.od_consult_dt,
                                        ECASE.acc_dt)),
                           'dd/MM/yyyy') ACC_DT,
                   (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
                      FROM WIC_CLAIM_STATUS WCS
                     WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
                   EC.INDUSTRY_CODE INDUSTRY_CODE,
                   EP.ID_NO ID_NO,
                   EP.NAME vWorkerName
              FROM EVENT_PERSON   EP,
                   WIC_CLAIMS     WC,
                   TBL_AA_SUBJECT TAS,
                   EVENT_COMPANY  EC,
                   EVENT_CASE     ECASE,
                   event_victim   ev
             WHERE EP.ID_NO IS NOT NULL
               AND EP.DELETE_IND = 'F'
               AND EP.INVOLVEMENT = 'VICTIM'
               AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
               AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
               AND ep.event_person_id = ev.event_person_id(+)
               AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
               AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
               AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR  B.vSPPassportNo = A.ID_NO);
       sp_pass_settle_rec sp_pass_settle_cur%rowtype;
       cursor sp_details_with_dt_cur is
     SELECT DISTINCT (A.CLAIM_ID),
                    A.CLAIM_REF_NO,
                    A.STATUS,
                    A.SUB_STATUS,
                    A.OFFICER_NAME,
                    A.SUBMIT_DT,
                    A.ACC_DT,
                    A.vLatestUpdatedDate,
                    A.INDUSTRY_CODE,
                    A.ID_NO,
                    A.vWorkerName,
                    B.vSPWPNO,
                    B.vFIN,
                    B.vSPPassportNo,
                    B.vSPIssueDate,
                    B.vSPExpiryDate,
                    B.vSPNo,
                    DECODE(B.vSPExtensionPurpose,'1','WICB', '2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS','10','LATE EISSUANCE',
                           '13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
    - F)') vSPExtensionPurpose,
                    B.vIssueSystem,
                    B.vSPActualDepartDate,
                    B.vSPStatus,
                    DECODE(B.vSPIssuePurpose,
                           '1','WICB','2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS', '10', 'LATE EISSUANCE','11','PENDING
    DOCUMENT VERIFICATION',
                           '12','LATE ERENEWAL','13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
    - F)') vSPIssuePurpose
      FROM (SELECT vSPWPNO,
                   vFIN,
                   vSPPassportNo,
                   vSPIssueDate,
                   vSPExpiryDate,
                   vSPNo,
                   vSPExtensionPurpose,
                   vIssueSystem,
                   vSPActualDepartDate,
                   vSPStatus,
                   vSPIssuePurpose
              FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''|| vRepatriationDateFrom ||'', ''||  vRepatriationDateTo ||''))
             WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
      JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
                   WC.CLAIM_REF_NO CLAIM_REF_NO,
                   WC.STATUS STATUS,
                   WC.SUB_STATUS SUB_STATUS,
                   TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
                   to_char(trunc(IRN.SUBMIT_DT), 'dd/MM/yyyy') SUBMIT_DT,
                   TO_CHAR(trunc(decode(wc.assessmt_type,
                                        'OD - PI',
                                        EV.OD_CONSULT_DT,
                                        'OD - TI',
                                        ev.od_consult_dt,
                                        ECASE.acc_dt)),
                           'dd/MM/yyyy') ACC_DT,
                   (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
                      FROM WIC_CLAIM_STATUS WCS
                     WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
                   EC.INDUSTRY_CODE INDUSTRY_CODE,
                   EP.ID_NO ID_NO,
                   EP.NAME vWorkerName
              FROM EVENT_PERSON    EP,
                   WIC_CLAIMS      WC,
                   TBL_AA_SUBJECT  TAS,
                   EVENT_COMPANY   EC,
                   EVENT_CASE      ECASE,
                   IR_NOTIFICATION IRN,
                   event_victim    ev
             WHERE EP.ID_NO IS NOT NULL
               AND EP.DELETE_IND = 'F'
               AND EP.INVOLVEMENT = 'VICTIM'
               AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
               AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
               and ep.event_person_id = ev.event_person_id(+)
               AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
               AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
               AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND IRN.REF_NO(+) = ECASE.IR_REF_NO
               AND IRN.SUBMIT_TYPE IN ('SI', 'SE')
               AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR  B.vSPPassportNo = A.ID_NO);
         sp_details_with_dt_rec sp_details_with_dt_cur%rowtype;
          /*vSQL VARCHAR2(4000);
          vFIN  VARCHAR2(9);
          vSPPassportNo  VARCHAR2(16);
          vSPWPNO VARCHAR2(20);
          vSPIssueDate VARCHAR2(10);
          vSPExpiryDate VARCHAR2(10);
          vSPNo VARCHAR2(20);
          vSPExtensionPurpose VARCHAR2(100);
          vIssueSystem VARCHAR2(4);
          vSPActualDepartDate VARCHAR2(10);
          vSPStatus VARCHAR2(30);
          vSPIssuePurpose VARCHAR2(500);
          CLAIM_ID NUMBER(12);
          CLAIM_REF_NO VARCHAR2(20);
          STATUS VARCHAR2(30);
          SUB_STATUS VARCHAR2(30);
          OFFICER_NAME VARCHAR2(201);
          SUBMIT_DT VARCHAR2(10);
          ACC_DT VARCHAR2(10);
          vLatestUpdatedDate VARCHAR2(10);
          INDUSTRY_CODE VARCHAR2(8);
          ID_NO VARCHAR2(50);
          vWorkerName VARCHAR2(100);*/
        BEGIN
      if vIncludeRepatriationDate = 'Y' then
       for sp_details_with_dt_rec in sp_details_with_dt_cur
       loop
       SPECIAL_PASS_CASES_TBL.EXTEND;
       SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_details_with_dt_rec.CLAIM_ID,sp_details_with_dt_rec.CLAIM_REF_NO,sp_details_with_dt_rec.OFFICER_NAME,sp_details_with_dt_rec.SUBMIT_DT,sp_details_with_dt_rec.ACC_DT,sp_details_with_dt_rec.vSPIssueDate,sp_details_with_dt_rec.STATUS,sp_details_with_dt_rec.SUB_STATUS,sp_details_with_dt_rec.vLatestUpdatedDate,sp_details_with_dt_rec.vSPExpiryDate,sp_details_with_dt_rec.INDUSTRY_CODE,sp_details_with_dt_rec.INDUSTRY_CODE,'a',sp_details_with_dt_rec.vSPWPNO,sp_details_with_dt_rec.vFIN,sp_details_with_dt_rec.vSPPassportNo,sp_details_with_dt_rec.vSPNo,sp_details_with_dt_rec.vWorkerName,sp_details_with_dt_rec.vSPExtensionPurpose,sp_details_with_dt_rec.vIssueSystem,sp_details_with_dt_rec.vSPActualDepartDate,sp_details_with_dt_rec.vSPStatus,sp_details_with_dt_rec.vSPIssuePurpose);
       end loop;
      else
       for sp_pass_settle_rec in sp_pass_settle_cur
       loop
       SPECIAL_PASS_CASES_TBL.EXTEND;
       SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_pass_settle_rec.CLAIM_ID,sp_pass_settle_rec.CLAIM_REF_NO,sp_pass_settle_rec.OFFICER_NAME,sp_pass_settle_rec.SUBMIT_DT,sp_pass_settle_rec.ACC_DT,sp_pass_settle_rec.vSPIssueDate,sp_pass_settle_rec.STATUS,sp_pass_settle_rec.SUB_STATUS,sp_pass_settle_rec.vLatestUpdatedDate,sp_pass_settle_rec.vSPExpiryDate,sp_pass_settle_rec.INDUSTRY_CODE,sp_pass_settle_rec.INDUSTRY_CODE,'a',sp_pass_settle_rec.vSPWPNO,sp_pass_settle_rec.vFIN,sp_pass_settle_rec.vSPPassportNo,sp_pass_settle_rec.vSPNo,sp_pass_settle_rec.vWorkerName,sp_pass_settle_rec.vSPExtensionPurpose,sp_pass_settle_rec.vIssueSystem,sp_pass_settle_rec.vSPActualDepartDate,sp_pass_settle_rec.vSPStatus,sp_pass_settle_rec.vSPIssuePurpose);
       end loop;
      end if ;
        RETURN SPECIAL_PASS_CASES_TBL;
      END getListOfSpecialPassCases;
    Thanks,
    SS

  • BO v5.1 - creating a report from an oracle stored procedure

    Post Author: newrochelle
    CA Forum: Publishing
    hi to all,
    im using BO 5.1 and i need to create a document from an oracle stored procedure that have only one IN parameter and ten OUT parameters.
    Creating the new report I selected the database connection then I choose the stored procedure name from the list, I inserted the value for the IN parameter and finally I click on Run button.
    I got the following error message:
    ORA-06550: line 1, column 38: :PLS-00103: Encountered the symbol
    "," when expecting one of the following: : : ( - + case mod
    new not null others <an identifier> : <a double-quoted
    delimited-identifier> <a bind variable> avg : count current
    exists max min prior sql stddev sum variance : execute forall
    merge time timestamp interval date : <a string literal with
    character set specification> : <a number> <a single-quoted SQL
    string> pipe : <an alternatively-quoted string literal with
    character set specification> : <an alternatively-q :-6550
    it seems to be caused by the OUT parameters!
    i leaved them without any value.
    it's the first time that I used a stored procedure to create a BO report, but I think the OUT parameters are needed to do that, otherwise what data will be presented in the report???
    can you help me?
    please answear me ASAP.
    Thank's in advance
    Regards
    Andrea

    Post Author: synapsevampire
    CA Forum: Publishing
    Try posting in a BO forum, this is Crystal Reports.
    -k

  • Not able to retrive the recordset from oracle stored procedure in VC++

    Hi,
    I am trying to retrieve the records from the reference cursor which is an out parameter for an oracle 9i store procedure in VC++ application. But it is giving the record count as -1 always. Meanwhile i am able to get the required output in VB application from the same oracle 9i store procedure .
    Find the code below which i used.
    Thanks,
    Shenba
    //// Oracle Stored Procedure
    <PRE lang=sql>CREATE OR REPLACE
    PROCEDURE GetEmpRS1 (p_recordset1 OUT SYS_REFCURSOR,
    p_recordset2 OUT SYS_REFCURSOR,
    PARAM IN STRING) AS
    BEGIN
    OPEN p_recordset1 FOR
    SELECT RET1
    FROM MYTABLE
    WHERE LOOKUPVALUE > PARAM;
    OPEN p_recordset2 FOR
    SELECT RET2
    FROM MYTABLE
    WHERE LOOKUPVALUE >= PARAM;
    END GetEmpRS1;</PRE>
    ///// VC++ code
    <PRE lang=c++ id=pre1 style="MARGIN-TOP: 0px">ConnectionPtr mpConn;
    _RecordsetPtr pRecordset;
    _CommandPtr pCommand;
    _ParameterPtr pParam1;
    //We will use pParam1 for the sole input parameter.
    //NOTE: We must not append (hence need not create)
    //the REF CURSOR parameters. If your stored proc has
    //normal OUT parameters that are not REF CURSORS, you need
    //to create and append them too. But not the REF CURSOR ones!
    //Hardcoding the value of i/p paramter in this example...
    variantt vt;
    vt.SetString("2");
    m_pConn.CreateInstance (__uuidof (Connection));
    pCommand.CreateInstance (__uuidof (Command));
    //NOTE the "PLSQLRSet=1" part in
    //the connection string. You can either
    //do that or can set the property separately using
    //pCommand->Properties->GetItem("PLSQLRSet")->Value = true;
    //But beware if you are not working with ORACLE, trying to GetItem()
    //a property that does not exist
    //will throw the adErrItemNotFound exception.
    m_pConn->Open (
    bstrt ("Provider=OraOLEDB.Oracle;PLSQLRSet=1;Data Source=XXX"),
    bstrt ("CP"), bstrt ("CP"), adModeUnknown);
    pCommand->ActiveConnection = m_pConn;
    pParam1 = pCommand->CreateParameter( bstrt ("pParam1"),
    adSmallInt,adParamInput, sizeof(int),( VARIANT ) vt);
    pCommand->Parameters->Append(pParam1);
    pRecordset.CreateInstance (__uuidof (Recordset));
    //NOTE: We need to specify the stored procedure name as COMMANDTEXT
    //with proper ODBC escape sequence.
    //If we assign COMMANDTYPE to adCmdStoredProc and COMMANDTEXT
    //to stored procedure name, it will not work in this case.
    //NOTE that in the escape sequence, the number '?'-s correspond to the
    //number of parameters that are NOT REF CURSORS.
    pCommand->CommandText = "{CALL GetEmpRS1(?)}";
    //NOTE the options set for Execute. It did not work with most other
    //combinations. Note that we are using a _RecordsetPtr object
    //to trap the return value of Execute call. That single _RecordsetPtr
    //object will contain ALL the REF CURSOR outputs as adjacent recordsets.
    pRecordset = pCommand->Execute(NULL, NULL,
    adCmdStoredProc | adCmdUnspecified );
    //After this, traverse the pRecordset object to retrieve all
    //the adjacent recordsets. They will be in the order of the
    //REF CURSOR parameters of the stored procedure. In this example,
    //there will be 2 recordsets, as there were 2 REF CURSOR OUT params.
    while( pRecordset !=NULL ) )
    while( !pRecordset->GetadoEOF() )
    //traverse through all the records of current recordset...
    long lngRec = 0;
    pRecordset = pRecordset->NextRecordset((VARIANT *)lngRec);
    //Error handling and cleanup code (like closing recordset/ connection)
    //etc are not shown here.</PRE>

    It can be linked to internal conversion. In some case, the value of internal or extranal value is not the same.
    When you run SE16 (or transaction N), you have in option mode the possibility to use the exit conversion or not.
    Christophe

  • How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur

    Hi,
    I use the following code to pass the parameters:
    Rep.Tables[0].ConnectBuffer := Connection_Str;
    Rep.Tables[0].AliasName := 'REP';
    Rep.Connect.Propagate := True;
    Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
    Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
    Rep.WindowState := wsMaximized;
    Rep.Show;
    The 1st parameter 'Lang' which created from crystal report pass well,
    but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
    Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
    However in MS SQL Server the above code work fine with the 2 Parameters.
    Any one has solution,

    Hello,
    Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
    The Parameter collection has all parameters.
    Thank you
    Don

Maybe you are looking for

  • af:tree do not show up default tree image like folder or plus icon

    Hi all, I am new to ADF and stuck with the problem where af:tree component do not show up default icons to expand and collapse.I am using websphere. Please help me to know where i am getting wrong to get the icons. Thanks in advance Irfan.

  • Default value on Selection Screen

    Hi experts, I want to put sy-datum + 1 as a default value on selection screen. I tried this but it didnt work. Please help me. DATA : tarih like sy-datum. initialization. tarih = sy-datum  + 1. SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-

  • Sub: Screen doesnt fit

    Sub: Screen doesnt fit Hi friends, I cant able to get full screen when I run applications in my laptop having 10 inches screen those developed in desktop having 15 inches screen, is there any forms property we can set so that every where it should fi

  • [solved] my script in /usr/lib/systemd/system-sleep/ was erroneous

    Maybe I just didn't see something I need to do... I have this script: -rwxr-xr-x 1 root root 322 13. Nov 10:13 /usr/lib/systemd/system-sleep/resume.sh* And whether I suspend with the kde suspend thingy or with systemctl suspend, this script does not

  • Migrating UDAs (User Defined Attributes)

    Is it possible to migrate Attribute Groups defined in PIM & Customer Hub modules in Oracle EBS Release 12.1.1? If not provided out of the box, is there a recommended process to build custom objects/APIs and integrate them into iSetup? Thanks for your