Weak and Strongly Typed Reference Cursors in Reports

Our custom reports has been using a reference cursor. I have inherited the code and not sure why there is a need to use a reference cursor when it can be done by a simple select statements. I see no dynamic select statements passed or any special parameters to reason out for use of reference cursor in our custom reports. Prior developers had reason out the benefits of using reference cursor for performance. I tested this by running a report with reference cursor versus plain select statement and still the report that is using the plain select statement performed better (faster) than the report that has the reference cursor, there is a big difference.
I have seen some disadvantage of using reference cursor on the reports that when there is a database object change even if the package that sourced the reference cursor has not been updated or modified the reports needs to be recompiled each time we get this error message coming from the report server queue:
  Terminated with error: <br>REP-8: Run time error in the PL/SQL development
  environment (DE). PDE-PSD001 Could not resolve reference to <Unknown Program Unit>
  while loading <Unknown> <Unknown>. REP-0008: Unexpected memory error while
  initializing preferences.In 9iAS reports prior version the error is occurring rarely. When we moved to 10.1.2.2.0 reports it appears the error occurs most often. We have made an effort to research about the issue and appears to be a bug. One suggestion is to use a strongly typed reference cursor. I have tried to researched about the difference between a weak and strongly typed reference cursor but failed to understand them. I appreciate any help about examples differentiating a weak versus a strongly typed reference cursors.
Thanks,
Warren

I guess my point, for what it's worth, is that whether you use only a strongly typed REF CURSOR, or whether you also use a weakly typed REF CURSOR, you may still end up getting the REP-0008 error (at least if your report is in .REP format). You can avoid this by using a pipelined function instead (or by putting the SQL directly in the report, or possibly by using .RDF or .JSP format).
To test this, you might:
1. Create a database package with an SQL*Plus script that that looks something like this:
CREATE OR REPLACE PACKAGE TEST AS
    TYPE RECORD_TYPE IS RECORD
        USERNAME ALL_USERS.USERNAME%TYPE
    TYPE TABLE_TYPE IS TABLE OF RECORD_TYPE;
    TYPE WEAKLY_TYPED_REF_CURSOR_TYPE IS REF CURSOR;
    TYPE STRONGLY_TYPED_REF_CURSOR_TYPE IS REF CURSOR RETURN RECORD_TYPE;
    FUNCTION GET_WEAKLY_TYPED_REF_CURSOR RETURN WEAKLY_TYPED_REF_CURSOR_TYPE;
    FUNCTION GET_STRONGLY_TYPED_REF_CURSOR RETURN STRONGLY_TYPED_REF_CURSOR_TYPE;
    FUNCTION GET_PIPELINED_TABLE RETURN TABLE_TYPE PIPELINED;
END TEST;
CREATE OR REPLACE PACKAGE BODY TEST AS
    FUNCTION GET_WEAKLY_TYPED_REF_CURSOR RETURN WEAKLY_TYPED_REF_CURSOR_TYPE
    IS
        cWeaklyTypedRefCursor WEAKLY_TYPED_REF_CURSOR_TYPE;
    BEGIN
        OPEN cWeaklyTypedRefCursor FOR
        SELECT USERNAME FROM ALL_USERS;
        RETURN cWeaklyTypedRefCursor;
    END GET_WEAKLY_TYPED_REF_CURSOR;
    FUNCTION GET_STRONGLY_TYPED_REF_CURSOR RETURN STRONGLY_TYPED_REF_CURSOR_TYPE
    IS
        cStronglyyTypedRefCursor WEAKLY_TYPED_REF_CURSOR_TYPE;
    BEGIN
        OPEN cStronglyyTypedRefCursor FOR
        SELECT USERNAME FROM ALL_USERS;
        RETURN cStronglyyTypedRefCursor;
    END GET_STRONGLY_TYPED_REF_CURSOR;
    FUNCTION GET_PIPELINED_TABLE
    RETURN TABLE_TYPE PIPELINED
    IS
    BEGIN
        FOR rec IN
            SELECT USERNAME FROM ALL_USERS
        LOOP
            PIPE ROW(rec);
        END LOOP;
    END GET_PIPELINED_TABLE;
END TEST;
/2. Create a report based on REF CURSOR query using only a strongly typed REF CURSOR. The PL/SQL statement that you use in the report as the data source for the query might look something like this:
function QR_1RefCurDS return test.strongly_typed_ref_cursor_type is
begin
  return test.get_strongly_typed_ref_cursor;
end;3. Compile the report to a .REP file and run it to make sure it works as expected.
4. Drop and re-create the TEST package in the database.
5. Try running the .REP file again. I expect you will get the REP-0008 error.
6. Modify the REF CURSOR query to use an underlying weakly typed REF CURSOR by changing the PL/SQL statement (from Step 2) to something like this:
function QR_1RefCurDS return test.strongly_typed_ref_cursor_type is
begin
  return test.get_weakly_typed_ref_cursor;
end;7. Repeat Steps 3 through 5. I expect you will get the REP-0008 error again.
8. Replace the REF CURSOR query in report with an SQL query that looks something like this:
SELECT * FROM TABLE(TEST.GET_PIPELINED_TABLE)9. Repeat Steps 3 through 5. I expect you will not get the REP-0008 error.
Hope this helps.

Similar Messages

  • Return csv string as strongly typed ref cursor

    I have a column in a table that is csv delimited and I want to return it (and others) as a strongly typed ref cursor.
    eg
    create table test_tab (mydata varchar2(100))
    insert into test_tab(mydata) values ('"a1","b1","c1","d1"')
    insert into test_tab(mydata) values ('"a2","b2","c2","d2"')
    so test_tab has 1 column and 2 rows:
    "a1","b1","c1","d1"
    "a2","b2","c2","d2"
    So a,b,c,d represent columns in my strongly typed ref cursor
    If I then try something like:
    declare
    type my_rec is record(
    a varchar2(50),
    b varchar2(50),
    c varchar2(50),
    d varchar2(50)
    type my_rec_refc IS REF CURSOR RETURN my_rec;
    my_test_refc my_rec_refc;
    begin
    open my_test_refc for select mydata,mydata,mydata,mydata from test_tab;
    end;
    then it obviously works as my ref cursor is expecting 4 columns. However, what I want to do is break each individual element out of the mydata column. I've played around a bit with dynamic sql but only getting so far and apparently that can't be used with a ref cursor anyway. I need to return a strongly typed cursor as another program requires this.
    One option is to manually parse each row and insert into temp table that is basically definition of record (so record type no longer needed) and this becomes type of ref cursor. I can then simply select from the table. I'm not keen on this as it's just another object to worry about.
    Another option is to do some ugly instr/substr to extract each element in the sql statement (or write a function to do it but need to consider performance of this). The more generic the better as I need to reuse against multiple strongly typed ref cursors (kind of a contradiction in that by virtue of using strongly typed cursors I know exactly what I want returned!).
    Another option is for someone to shed some light on this as it must be possible to do in a simple way along the same lines I have started?
    thanks in advance

    That documentation seems to stay pretty vague. What constitutes the "right set of columns". Obviously my observed result matches what you are saying about not being able to enforce the datatypes in the fields of the strong typed cursor. But then I don't see the point of the strong typed cursor otherwise. Other sites i have read seem to focus on the %rowtype return rather than mapping it to a record. But the general consensus (at least to my understanding) is that if the cursor is strongly typed then the sql statement that used to open it must have the same set of columns and the datatypes must at least be able to implicitly convert.
    I will try the %rowtype strong ref cursor against a table and see if there is a different result. I am mainly interested in this because I would like to beable to ensure the datatype returned on the .net side through ODP
    I want to be able to know the datatype of a field coming back through a ref cursor at compile time not runtime. So it the answer to cast every field of the select statement?

  • How to get selection screen elements and its table reference of a report ?

    halo experts
    How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
    For eg if my selection screen 1000 is
    parameters: p_carrid type spfli-carrid,
    select-options :s-_connid type sflight-connid.
    is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

    The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
    REPORT  ZTEST_PROG.
    TABLES sflight.
    DATA:
           screen_tab TYPE STANDARD TABLE OF screen,
           wa_screen TYPE screen,
           scrn_nm TYPE string,
           scrn_leftover TYPE string,
           l_type TYPE REF TO cl_abap_typedescr,
           typ_nm TYPE string,
           typ_pre TYPE string.
    FIELD-SYMBOLS <fs_data> TYPE ANY.
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-group3 = 'PAR'
          OR screen-group3 = 'LOW'.
            APPEND screen TO screen_tab.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      LOOP AT screen_tab INTO wa_screen.
        ASSIGN (wa_screen-name) TO <fs_data>.
        l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
        IF wa_screen-group3 = 'LOW'.
          SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
          TRANSLATE scrn_nm TO UPPER CASE.
        ELSE.
          scrn_nm = wa_screen-name.
        ENDIF.
        SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
        WRITE:
                 / 'Screen Name:  ', scrn_nm,
                 / 'DDIC Type:    ', typ_nm.
      ENDLOOP.
    When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
    DATA: structure_reference TYPE REF TO cl_abap_structdescr,
          components_table TYPE abap_compdescr_tab,
          components_structure LIKE LINE OF components_table.
    structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
    components_table = structure_reference->components.
    I don't know if this answers any of your questions but I hope that some of it is useful.

  • Using a strongly typed ref cursor doesn't enforce data type

    I am trying to enforce the datatypes of the fields coming back from an oracle reference cursor by making it strongly typed. However, there seems to be no warning at compile time on the oracle side or exception in ODP.NET if the datatype coming back in the cursor does not match. For example here is my cursor and proc
    create or replace
    PACKAGE THIRDPARTY AS
    type pricing_record is record
    BaseIndexRate     number(6,5),
    BaseIndexRateType     VARCHAR2(1 BYTE)
    type cur_pricing2 IS ref CURSOR return pricing_record;
    PROCEDURE getpricingbyappidtest(appid IN application.intid%TYPE, pricing OUT cur_pricing2);
    END THIRDPARTY;
    create or replace
    PACKAGE BODY THIRDPARTY AS
    PROCEDURE getpricingbyappidtest(appid IN application.appid%TYPE, pricing OUT cur_pricing2)
    AS
    BEGIN
         OPEN pricing FOR
         SELECT      somevarcharfield, someothervarcharfield
    FROM application
    WHERE A.appid = appid;
    END getpricingbyappidtest;
    I would expect this wouldn't compile since i am putting a varchar into a number field. But it does. Also if i check the datatype in the reader on the .net side it also is a string. So odp doesn't seem to care what type the cursor is
    here is that code and output
    var schemaTable = reader.GetSchemaTable();
    using (var file = new System.IO.StreamWriter("c:\\_DefinitionMap_" + cursorName + ".txt"))
    file.WriteLine("COLUMN" + "\t" + "DATATYPE");
    foreach (DataRow myField in schemaTable.Rows)
    file.WriteLine(myField["ColumnName"] + "\t" + myField["DataType"]);
    COLUMN     DATATYPE
    BaseIndexRate     System.String
    BaseIndexRateType     System.String
    Does anyone have an approach for enforcing datatypes in a ref cursor? Am I doing something wrong when defining the ref cursor?

    Hello,
    By using a ref cursor you are really using a pointer to a cursor. There is no way I know of to make a compile check of the cursor check unless you want to create a SQL type and cast the cursor to this type and even this wouldn't work in all cases. For instance, I could have function call within my cursor select which could return a varchar (with a number always in the varchar) which would be horribly sloppy but legal and you would expect Oracle to compile it.
    If you are worried about this I would suggest not using ref cursors and go to UDT instead, where there will be more checking (because of a C# equivalence generated object). Oh and BTW, yes the cursor will throw an exception if the data is incorrect, but only at runtime - just like normal Oracle PLSQL.
    Cheers
    Rob.
    http://www.scnet.com.au

  • Workaround for opening a strongly typed cursor using native dynamic SQL

    Hi All,
    In reading the PL/SQL documentation for Oracle 9i, I noted that the OPEN-FOR
    statement with a dynamic SQL string only allows the use of weakly typed cursors.
    I have verified this limitation with my own experimentation as follows:
    DECLARE
    type rec_type is record(
    str     varchar2(40),
    num     number(22)
    type cur_type is ref cursor return rec_type;
    my_cur     cur_type;
    que     varchar2(100);
    tab     varchar2(40);
    BEGIN
    tab := 'dynamic_table_name';
    que := 'select key_name, key_value from ' || tab || ' where key_name like ''01%''';
    open my_cur for que;
    loop
    if my_cur%found then
    dbms_output.put_line('source_name: ' || my_cur.str || ', page_sn: ' || my_cur.num);
    exit;
    end if;
    end loop;
    close my_cur;
    END;
    Running the above trivial example in an anonymous sql block yields the following
    errors as expected:
    ORA-06550: line 10, column 8:
    PLS-00455: cursor 'MY_CUR' cannot be used in dynamic SQL OPEN statement
    ORA-06550: line 10, column 3:
    PL/SQL: Statement ignored
    ORA-06550: line 13, column 54:
    PLS-00487: Invalid reference to variable 'MY_CUR'
    ORA-06550: line 13, column 7:
    PL/SQL: Statement ignored
    Is there a workaround to the situation? Since I do not know the table name at run
    time, I must use Native Dynamic SQL. I have a long and complex record type
    that I wish to return through JDBC using the REFCURSOR Oracle type in order to
    avoid having to register an inordinate number of OUT parameters. Moreover, I
    would like to return potentially one or more results in a ResultSet. Using the
    standard method of registering native SQL types for the IN and OUT bindings
    can only return one result. Hence the reason I would like to return a strong
    cursor type. Also, the type of query I am doing is complex, and needs to be
    executed in a PL/SQL procedure for performance reasons. Therefore simply
    executing a SELECT query dynamically built up on the the JDBC client won't
    do the trick.
    If anybody has experience with a similar problem and would like to volunteer
    information on their workaround, I would really appreciate it.
    Best Regards,
    J. Metcalf

    We can use strongly-typed REF CURSORs in DNS, but the typing derives from a table e.g.
    TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
    so the problem is your use of "return rec_type" bit.
    Forgive my bluntness but I think you have misunderstood strong and weak typing. You actually want to be using weakly-typed cursors. I mean this:
    Moreover, I would like to return potentially one or more results in a ResultSet. suggests that the structure of your resultset may vary, which is precisely what a weakly-typed ref cursor allows us to do. Then we can use the JDBC metadata methods to interrogate the structure of the resultset, innit.
    so try this:
    DECLARE
    type cur_type is ref cursor;
    my_cur cur_type;
    que varchar2(100);
    tab varchar2(40);
    BEGIN
    tab := 'dynamic_table_name';
    que := 'select key_name, key_value from ' || tab || ' where key_name like ''01%''';
    open my_cur for que;
    loop
    if my_cur%found then
    dbms_output.put_line('source_name: ' || my_cur.str || ', page_sn: ' || my_cur.num);
    exit;
    end if;
    end loop;
    close my_cur;
    END;
    ras malai, APC
    Cheers, APC

  • Reference Cursors

    I have a function that selects data from a table (Oracle 8i) into a reference cursor and returns the reference cursor.
    After I execute this function for the first time using SQL+, I notice that the number of open cursors has increaed. The number of open cursors will only drop down to the original level after I close SQL+.
    Is there a way to explicility close a reference cursor from outside the funciton?

    But how do you securely decide if a cursor is needed any longer?
    A better way to solve your problem will be to increase the maximum of open cursors in the DBMS administration.

  • Using Reference Cursor Performance Issue in Report

    Hi,
    Are reference cursor supposed to be faster than a normal query? The reason why I am asking is because I am using a reference cusor query in the data model and it has a performance issue on the report, it's taking quite a while to run than If I just run the same reference cursor query in sql*plus. The difference is significantly big. Any input is very much appreciated!
    Thanks,
    Marilyn

    From the metalink bug 4372868 on 9.0.4.x. It was fixed on 10.1.2.0.2 and does not have a backport for any 9.0.4 version.
    Also the 9.0.4 version is already desupported. Please see the note:
    Note 307042.1
    Topic: Desupport Notices - Oracle Products
    Title: Oracle Reports 10g 9.0.4 & 9.0.4.x
    Action plan:
    If you are still on 9.0.4 and later version of oracle reports and have no plan yet to migrate to 10.1.2.0.2 version use the same query you are using in your reference cursor and use it as a plain SQL query in your reports data model.

  • Help with Collections and Reference Cursor

    I have a procedure where I want to populate a table type and then return the results with a reference cursor so the results can be used by Hyperion. Here are the type declarations:
    create or replace type gg_audit_object as object (
                   owner varchar2(30),
                   table_name varchar2(30),
                   lag_time number)
    CREATE OR REPLACE TYPE gg_audit_table AS TABLE OF gg_audit_object
    and here's the procedure:
    CREATE OR REPLACE PROCEDURE ETSREP_GG_AUDIT_XX2 (results_cursor in out types.cursorType)
    AS
    v_owner varchar2(30);
    v_table_name varchar2(30);
    v_column_name varchar2(30);
    type v_record is record(
    owner varchar2(30),
    table_name varchar2(30),
    lag_time number);
    r1 v_record;
    t1 gg_audit_table;
    table_cr types.cursorType;
    sql_stmt varchar2(5000);
    cursor table_select is
    select g.owner,
    g.table_name,
    g.column_name
    from gg_tables_to_audit g
    where g.active_ind = 'Y'
    order by 1,2;
    BEGIN
    rec_count := 0;
    for main_rec in table_select loop
    sql_stmt := '';
    v_owner := main_rec.owner;
    v_table_name := main_rec.table_name;
    v_column_name := main_rec.column_name;
    sql_stmt := 'select '
    || '''' || v_owner || ''','
    || '''' || v_table_name || ''','
    || 'sysdate - max(' || v_column_name || ') '
    || 'from ' || v_owner || '.' || v_table_name;
    open table_cr for sql_stmt;
    FETCH table_cr into r1;
    close table_cr;
    -- here's where I'm stumped. I need to take the values from r1 and put them
    -- into t1.
    -- Something like this (or whatever is the correct way to do it)
    -- insert into table(t1) values (r1.owner, r1.table_name, r1.lag_time);
    end loop; -- end table_select loop
    -- and then open a reference cursor and select them out of t1.
    -- Something like
    -- open results_cursor for select * from t1;
    END;
    Just trying to avoid creating a real table and populating that. Any guidance would be greatly appreciated.

    Found the perfect example on Ask Tom. Here is the solution.
    create or replace package GG_AUDIT
    as
    type rc is ref cursor;
    procedure GG_AUDIT_PROC( r_cursor in out types.cursorType );
    end;
    create or replace package body GG_AUDIT
    as
    procedure GG_AUDIT_PROC( r_cursor in out types.cursorType )
    is
    l_data gg_audit_table := gg_audit_table();
    table_cr types.cursorType;
    type v_record is record(
    owner varchar2(30),
    table_name varchar2(30),
    lag_time number);
    r1 v_record;
    sql_stmt varchar2(5000);
    v_owner varchar2(30);
    v_table_name varchar2(30);
    v_column_name varchar2(30);
    rec_count number := 0;
    cursor table_select is
    select g.owner,
    g.table_name,
    g.column_name
    from gg_tables_to_audit g
    where g.active_ind = 'Y'
    order by 1,2;
    begin
    for main_rec in table_select loop
    sql_stmt := '';
    v_owner := main_rec.owner;
    v_table_name := main_rec.table_name;
    v_column_name := main_rec.column_name;
    sql_stmt := 'select '
    || '''' || v_owner || ''','
    || '''' || v_table_name || ''','
    || 'sysdate - max(' || v_column_name || ') '
    || 'from ' || v_owner || '.' || v_table_name;
    open table_cr for sql_stmt;
    FETCH table_cr into r1.owner, r1.table_name, r1.lag_time;
    close table_cr;
    rec_count := rec_count + 1;
    l_data.extend;
    l_data(rec_count) := gg_audit_object(r1.owner, r1.table_name, r1.lag_time);
    end loop;
    open r_cursor for select * from TABLE ( cast ( l_data as gg_audit_table) );
    end; -- end procedure
    end;
    Works perfectly. Thanks guys.

  • 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

  • Recursion with reference cursors

    Hi,
    I need to do a recursive SQL select in a report. Using reference
    cursors I can do dynamic SQL selects. What do I need to do if I
    must do this recursively. I run into cursor already open error
    trying to close the cursor does not help as well.
    Any ideas?
    TIA
    Srinivas

    Ok, so you know how the if- test works, and you even seem to almost understand the code you have posted (presuming your professor has written the code, right?). Good start! I like the way you post the code and ask the question can it be done? It is far better than just writing please do my homework for me, because I am too lazy to do it myself...
    Have a look in your programming book and reed the chapter about loops. It should give you an idea of how to solve your assignment.
    And try posting to the right forum. This question belongs to the New To Java Technology forum. Later on you may advance to the Java Programming forum.
    Good luck!

  • Oracle ODP strongly typed dataset (runtime)

    I am trying to use strongly typed Dataset Objects in my project but I seem to be missing something.
    I created a class library project named DSCommon. I then used the Server Explorer to create an XML Schema of my Oracle table and then I generated a DataSet (http://www.developer.com/db/article.php/10920_3069061_2).
    I then created a second windows application project and added a reference to DSCommon.
    I have one text box, navigation buttons, and a command button on the form. I have tried the following code but I do not seem to have the benefits of a strongly typed dataset - I cannot do anything like txtPlaneType.text = ds.PlaneTypes[0].planedesc.
    (I added a reference to Oracle.DataAccess to the windows app. project.)
    <code>
    Imports Oracle.DataAccess.Client
    Imports DSCommon
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim conn As New OracleConnection
    Dim cmPlaneTypes As CurrencyManager
    Private Sub connectDatabase()
    conn.ConnectionString = "User id=username;Password=password;Data Source=server.com;"
    Try
    conn.Open()
    Catch ex As Exception
    Throw ex
    End Try
    End Sub
    Private Sub closeDatabase()
    conn.Close()
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Try
    Me.connectDatabase()
    Dim planeTypeAdapter As OracleDataAdapter = New OracleDataAdapter
    planeTypeAdapter.SelectCommand = New OracleCommand("SELECT PLANETYPE, PLANETYPEDESC FROM PLANETYPES", conn)
    Dim PlaneTypeDataSet As New PlaneTypes
    planeTypeAdapter.Fill(PlaneTypes, "PlaneTypeDataSet")
    cmPlaneTypes = CType(BindingContext(PlaneTypeDataSet, "PlaneTypes"), CurrencyManager)
    AddHandler cmPlaneTypes.ItemChanged, AddressOf cmPlaneTypes_ItemChanged
    AddHandler cmPlaneTypes.PositionChanged, AddressOf cmPlaneTypes_PositionChanged
    txtPlaneType.DataBindings.Add("Text", PlaneTypeDataSet.PLANETYPES, "PLANETYPEDESC")
    Catch ex As Exception
    MessageBox.Show("At this time this information cannot be viewed or updated.", "Error retrieving records", MessageBoxButtons.OK, MessageBoxIcon.Error)
    Finally
    If conn.State = ConnectionState.Open Then
    Me.closeDatabase()
    End If
    End Try
    ' is this needed?
    conn.Dispose()
    end sub
    </code>
    This is the schema in the first project.
    <code>
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="PlaneTypes" targetNamespace="http://tempuri.org/PlaneTypes.xsd" elementFormDefault="qualified"
    xmlns="http://tempuri.org/PlaneTypes.xsd" xmlns:mstns="http://tempuri.org/PlaneTypes.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="PlaneTypes">
    <xs:complexType>
    <xs:choice maxOccurs="unbounded">
    <xs:element name="PLANETYPES">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="PLANETYPE" type="xs:integer" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1"
    msdata:AutoIncrement="true" />
    <xs:element name="PLANETYPEDESC" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    <xs:unique name="DocumentKey1" msdata:PrimaryKey="true">
    <xs:selector xpath=".//mstns:PLANETYPES" />
    <xs:field xpath="mstns:PLANETYPE" />
    </xs:unique>
    </xs:element>
    </xs:schema>
    </code>
    How do I create this at run time and get the benefits in design time?
    Is there a better way to reference the code for the navigation buttons?

    <bump>
    Can anyone from Oracle assist me with this issue?

  • Trouble with supposedly strictly-typed reference...

    I'm having some issues with supposedly strictly-typed references.
    Can anyone look at the code attached (LV2010) and tell me why the top example doesn't work and the bottom does. More over, what's the general way to make the top example work?
    The discussion of strict and weak typed is rather short in the documentation in the help. Any pointers to relevant documentation would be appreciated.
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Test.zip ‏46 KB

    I swear I read that help page like ten times and now I finally see the caveat in documentation. It would be nice if they mentioned this in the Enum Property page or in the table for Strings[] in the documentation instead of hiding it in the documentation.
    That said, now that you say it, it's obvious why. I wish the error I received (1082, I believe) could also be a bit more specific as I don't explicitly make the enum a strict type def, it simply is implicitly.

  • Error 7 occurred at open vi reference in New Report.VI

    Hello!
    I use the report generation toolkit on LabView 7.0 to create a report in Excel. The program works fine until I make an executable version. I the get the error:
    Error 7 occurred at open vi reference in New Report.VI
    I use the New Report.VI, Bring Excel to front.VI and Save Report To File.vi
    Can you pleace help me!!!

    Most likely, you did not include the required libraries in your build script. When building an executable in which you use the Report Generation Toolkit, you must include the _Word Dynamic VIs.vi from _wordsub.llb and _Excel Dynamic VIs.vi from _exclsub.llb as dynamic VIs on the Source Files tab.
    Check this article for more info.
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/86256a47004e16d186256a84004cb883?OpenDocument
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • 高手快帮忙谢谢lab​view7打包后用到​7中新的new report.vi的​地方(选择的是wor​d)都提示error 7 occurred at open vi reference in new report.vi

    高手快帮忙谢谢
    labview7打包后用到7中新的new report.vi的地方(选择的是word)都提示error 7 occurred at open vi reference in new report.vi。
    下面提示的可能原因是Possible reason(s):
    LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on UNIX.
    我愿自己是个胡萝卜,可以自己自足啦!

    我明白您的意思,也可以按您所说的作,
    但是open vi peference这个vi是labview提供的标准new report.vi的子vi中使用到的,如果我手动修改open vi peference中的提供的word路径,也就是说labview提供的模块也要自己修改了??
    我愿自己是个胡萝卜,可以自己自足啦!

  • My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words.

    My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words and looks them up via dictionary. I currently have a wireless mouse connected and I am still having the same problems.
    I fee like I may have a virus or my laptop is perhaps being accessed remotely. All of the sharing options are unchecked.
    HELP PLEASE
    Very worried!!

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).

Maybe you are looking for

  • HT3702 MY ITUNE  REDEEM CARD IS NT WORKING IT SAID THE NUMBER IS WRONG

    i cant redeem my itunes card

  • EDID checksum is invalid

    I have this message at each boot:  [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 128 [ 1.765502] Raw EDID: [ 1.765530] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 1.765559] ff ff ff ff ff ff ff ff ff ff ff ff ff ff f

  • Stop alt from shifting focus to the menu?

    Hi, Every time I press Alt the focus shifts to the menu bar, just as it does with other windows programs. This means I have to escape the menu every time I zoom, which is time consuming and extremely irritating. Does anyone know how to stop this beha

  • Can you change the size of "Code QR" barcode?

    Hi all, The "Code QR" type barcode that is available by default in our system works fine, but creates a very small image that I would like to enlarge. The Objects Field properties list only contains a property called "Data Length = 10" (which I also

  • Max Dashboards&Reports

    Hi Gurus, Any one please give me the answers to the following Questions........... 1)How many Maximum Dashboards can we create? 2)how many Maximum Pages can we create in a single dashboard? 3)What is the Maximum no'of Reports or Sections can we put i