CommandTable returning as Procedure

Hi all. Got something strange going on here. I'm writing an app that will search through the SQL in all of our reports (all of our reports are written using a single Command object). Some of the reports for some reason are returning their tables as CrystalReports.Procedure, rather than CrystalReports.CommandTable. Trying to cast it to the latter expectedly causes an invalid cast exception. I've double-checked the ones doing this, and there is only one table behind each report, and each one is indeed a Command.
While playing around for possible solutions, I ended up tidying up some of the code in one of the reports; I didn't make any real changes to anything, just prettied up the code some. One of the things I did was to replace any instances of 4 spaces with a single tab character. And suddenly, it's now seeing it as a CommandTable for that report. I'm assuming it has something to do with a size limit of the CommandText, but I can't find anything documented anywhere on this.
Is this a known issue, and is there any workaround, aside from cleaning up all the code? Main thing I'm concerned about is that if this is indeed caused by hitting a limit for the CommandText, doing some code beautification on the offending reports may work for some, but may not work for others with exceptionally long complex queries. Thanks in advance for any assistance.

Thanks for the responses.
Version Info:
CR Developer, 11.5.10.1263
.NET Framework 3.5
CR Oracle ODBC Driver 5.1 (05.10.0017)
Let me know if you would like any of the exact version numbers for any of the actual libraries.
In this case, I wouldn't guess it's specifically parameters doing it. Usually we do use parameters in our command objects, but not always. For the ones that are giving the problem, the number of parameters varies anywhere from 0 to more than 5.
I agree with you Don that long term the ideal solution would be to move all of these queries into the database (thus alleviating the need for this tool in the first place); I suggested the same thing when I first got here, but not exactly a tiny undertaking (we have hundreds of reports). So yes, long term solution, this would be ideal, it's just not something we can approach at the moment; we may end up having to work towards this by attrition as reports get updated.
An interesting thought about the driver. I'll play around using different ones to see if there's any change and let you know what I come back with, although the app itself is not making any connection to the DB; it's just checking out the table, grabbing the command text, and closing up. However, I suppose it could be something with how the report itself is being saved based on what driver was used when the report was built. I'll follow up on this after testing.

Similar Messages

  • Return pricing procedure-

    Dear all-
    After defining separate pricing procedure for return sales .
    when we are creating return sales with the refference of billing why return pricing procedure is not coming.Coming pricing proceure is previous sales procedure.I want in case of  return sales my return procedure will come , for that will creat a credit note.
    Already created procedure and assigned to sales area , with doc type(ovkk) after all this why it isnot coming - is there any possibility pls tell me -and that will come when will creat reurn sales with the refference of previous billing my return pricing procedure will be excuted
    thanks
    sunil

    Dear Sunil,
    Check in T. CODE VOFA - SD document categ.   M & Transaction group    7 and Document pricing procedure A or as per u r requirement.
    Then COPY CONTROL by T. Code VTAF item level pricing type D.
    I hope sloved this.
    Regards....
    Sanjeev

  • What is the procedure for  Return Pricing Procedure

    Dear Experts,
       Pricing Routine for Return Pricing Procedure To create Return sales order w.r.t billing document without copying the Pricing Procedure. To capture the net price from the Billing document to the Return Sales order .To change the net price to 0.01 based on the scrap item category RSCR in return sales  order. please help me out from this issue .Thanks in advance.I'll give you full points.

    Dear Experts,
       Dear Experts,
      I've been working in an implementation project..I never worked on pricing routines...so please give me any inputs which can help full for me...
    To create Return sales order w.r.t billing document without copying the Pricing Procedure.
    To capture the net price from the Billing document to the Return Sales order
    To change the net price to 0.01 based on the scrap item category RSCR in return sales
         order.
    please help me out from this issue
    Thanks in advance..
    I'll give you full points..

  • Oracle.sql.STRUCT and returns from procedures

    I need to know how to retrieve information out of a stored procedure. I have a stored procedure that has a IN/OUT parameter that is used to return an array of an oracle TYPE that is set up in the database (it consists of two numbers and a varchar2. So I am returning an array of these types). I need to call this stored procedure from JDBC and retrieve the data out of it. I can setup the outParameter of the statement and also get the Object out of the statement once the procedure is called. But what is returned to me? An array of oracle.sql.STRUCT objects? A single oracle.sql.STRUCT object? A multi-dimensional array of java objects? Or something else?
    Thanks
    null

    as far as I know, the STRUCT is the returned geometry. so you can declare a SDO_GEOMETRY variable and assing the STRUCT directly to this variable.
    For example you have a variable 'geo_variable' and assign it the result of a function like this:
    geo_variable := SDO_GEOM.SDO_DIFFERENCE(geom1, geom2, tol );
    what you see written like this "oracle.sql.STRUCT@6c08b2.." I believe is the stuct @ the memory address 6c08b2..

  • Multiple row return in Procedure

    I am trying to convert a SQL Server to Oracle 8i. They have a bunch of procedures that return multiple rows. How can this be handled in Oracle?

    In Oracle this is done by using collections. It is really only viable if you are creating packages out of the procedures since you will need to define the type definitions prior to defining the procedure. Here are some hints and a link:
    TYPE rec IS RECORD OF something ;
    TYPE tab IS TABLE OF rec ;
    PROCEDURE getTable (
    p_table_output OUT tab )
    http://technet.oracle.com/doc/oracle8i_816/appdev.816/a77069/04_colls.htm#1059

  • Returns pricing procedure for sales document RE !!

    Hi, friends !
    I have doubt in the logic that while doing sales flow from order to billing it picks one pricing procedure. And for returns i want another pricing procedure should be picked.
    As we are giving reference fo Invoice for Returns document it normally picks the old pricing procedure but not the new pricing procedure.
    Please let me know how to configure to pick the new pricing procedure for RE document type.
    Thanks & Regards,
    Sreedhar.
    Email ID: [email protected]

    Hiii Sredhar How are you !!!! where are u !!!
    Go through this steps
    --> First you define the New pricing procedure in the transaction V/08.
    >You define the new document pricing procedure in the IMG path>SPRO>Sales and distribution>Basic functions>Pricing>Price control>Define and assign pricing procedures>Define Document pricing procedure.
    -->Now you assign this Document pricing procedure to the Return order type in the detail screen.
    -->Now you determine the pricing procedure through OVKK transaction with new defined document pricing procedure and pricing procedue.
    -->Maintain the condition records for that condition types.
    -->Now you create the Return order it will pick the new pricing
    Still if it not picks check the Copy control settings In the VTAF transaction
    Go to item details there you eneter "B" carry out new pricing in the Pricing type field
    I hope it will help you
    Regards,
    Your Murali.T

  • XML TYPE return in procedure

    Hi,
    I have a procedure which takes input as Order_id and returns Order related information.
    Question is i can return the data using SYS_REFCURSOR but the requirement demands that it should be sent in XML format.
    can you please suggest how i can send the data in XML format.
    Thanks,
    Vinod

    A Demo:-
    create or replace function retEmpData (p_in_dept_id   in      number)
    return CLOB
    is
      v_clob    clob;
    begin
      select to_clob(
                      sys_xmlgen(first_name || ' ' || last_name, XMLFormat.createformat('EMPName')).getclobval()
        into v_clob
        from hr.employees
       where department_id = p_in_dept_id;
       return v_clob;
    end;
    select retempdata(10) from dual;
    RETEMPDATA(10)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    (CLOB) <?xml version="1.0"?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    <EMPName>Jennifer Whalen</EMPName>   

  • How these values can return from procedure

    Hi,
    Here is my procedure, i wanted to return values through this procedure as i assinged values to the d,e and f.But getting error as shown. Is this the way to use the procedure in this case. Also would like to know can i use function instead of procedure for this case.
    create or replace procedure Test(a number ,b number, c number, d out number,e out number,f out number ) as
    r1 number :=45 ;
    r2 number:=43;
    r3 number :=32 ;
    begin
    select 1,2,3 into r1,r2,r3 from dual;
    d :=r1;
    e :=r2;
    f :=r3;
    end ;
    ORA-06550: line 1, column 18:
    PLS-00363: expression '' cannot be used as an assignment target
    ORA-06550: line 1, column 21:
    PLS-00363: expression '' cannot be used as an assignment target
    ORA-06550: line 1, column 24:
    PLS-00363: expression '' cannot be used as an assignment target
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Thanks

    How did you call the procedure? From the error message my guess would be that it was something like:
    SQL> exec test(1, 2, 3, '', '', '');
    BEGIN test(1, 2, 3, '', '', ''); END;
    ERROR at line 1:
    ORA-06550: line 1, column 18:
    PLS-00363: expression '' cannot be used as an assignment target
    ORA-06550: line 1, column 22:
    PLS-00363: expression '' cannot be used as an assignment target
    ORA-06550: line 1, column 26:
    PLS-00363: expression '' cannot be used as an assignment target
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredWhen it should be more like:
    SQL> var d number;
    SQL> var e number;
    SQL> var f number;
    SQL> exec test(1,2,3,:d, :e, :f)
    PL/SQL procedure successfully completed.
    SQL> select :d, :e, :f from dual;
            :D         :E         :F
             1          2          3Since you are returning multiple values, you should not use a function for this. You could return a collection from the function, but you probably master the basics before you start trying things like that.
    John

  • Varchar Return from Procedure

    Hi,
    I have a procedure that returns VARCHAR, but my return string length is more than 4000 characters sometime, what datatype should I use in this case and how?
    Thanks

    What I am wondering is if yuo have a situation somewhat like this:
    SQL> SELECT id, descr, length(descr) len
      2  FROM t1;
            ID DESCR                            LEN
             1 T1 One                             6
             2 T1 Two                             6
             1 T1 One Two                        10
             1 T1 One Three                      12
             1 T1 One Four                       11
    SQL> DECLARE
      2     l_descr VARCHAR2(10);
      3     l_out   VARCHAR2(2000);
      4     CURSOR c IS
      5        SELECT descr FROM t1;
      6  BEGIN
      7     OPEN c;
      8     LOOP
      9        FETCH c INTO l_descr;
    10        EXIT WHEN c%NOTFOUND;
    11        l_out := l_out||l_descr;
    12     END LOOP;
    13  EXCEPTION
    14     WHEN OTHERS THEN
    15        DBMS_OUTPUT.Put_Line('Out Length is '||LENGTH(l_out));
    16  END;
    17> /
    Out Length is 22
    PL/SQL procedure successfully completed.I have values in t1.descr that are longer than my declared length of l_descr (10 characters). So, although the length of l_out is well below the declared length of 2000, I am still getting the ORA-06502, but the exception handler is hiding it.
    If I run the same code without the exception handler:
    SQL> DECLARE
      2     l_descr VARCHAR2(10);
      3     l_out   VARCHAR2(2000);
      4     CURSOR c IS
      5        SELECT descr FROM t1;
      6  BEGIN
      7     OPEN c;
      8     LOOP
      9        FETCH c INTO l_descr;
    10        EXIT WHEN c%NOTFOUND;
    11        l_out := l_out||l_descr;
    12     END LOOP;
    13* END;
    SQL> /
    DECLARE
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 9It tells me that the error is on line 9 which is the fetch into l_descr, and has nothing to do with l_out.
    John

  • Sales return tax procedure

    Respected ones,
    while creating a sales return order based on the billing document date , if the sales return is within six months we need to capture net value + tax and after six months we need to capture only the net value . How do go about this.
    I read in the forums and they asked to wiite a routine for this.
    what would be the logic behind this.

    thanks..........not received any reply from forums

  • Can we use return statement in procedure?

    Can we use return statement in procedure or we can use more than one return statement in procedure?

    HamidHelal wrote:
    NOReally? Did you at least test it? You can use RETURN in procedure or in anonymous PL/SQL block. The only restriction is you can't specify return value:
    SQL> begin
      2      dbms_output.put_line('Before return');
      3      return;
      4      dbms_output.put_line('After return');
      5  end;
      6  /
    Before return
    PL/SQL procedure successfully completed.
    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          dbms_output.put_line('Before return');
      6          return;
      7          dbms_output.put_line('After return');
      8  end;
      9  /
    Procedure created.
    SQL> exec p1;
    Before return
    PL/SQL procedure successfully completed.
    SQL> begin
      2      dbms_output.put_line('Before return');
      3      return 99;
      4          dbms_output.put_line('After return');
      5  end;
      6  /
        return 99;
    ERROR at line 3:
    ORA-06550: line 3, column 5:
    PLS-00372: In a procedure, RETURN statement cannot contain an expression
    ORA-06550: line 3, column 5:
    PL/SQL: Statement ignored
    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          dbms_output.put_line('Before return');
      6          return 99;
      7          dbms_output.put_line('After return');
      8  end;
      9  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE P1:
    LINE/COL ERROR
    5/9      PL/SQL: Statement ignored
    5/9      PLS-00372: In a procedure, RETURN statement cannot contain an
             expression
    SQL> SY.

  • Resultset returns null while calling a DB2 stored procedure using hibernat

    Hi All ,
    I am trying to call a db2 stored proc with cursor open from my java code but it always returns me null results though it executes fine when I call the procedure from the command line
    Java code....................
    CallableStatement stmt3 = EyeHibernateApp.getHibernateSession().connection().prepareCall("{call answers_select_id( ? )}");
    stmt3.setString(1,20);
    stmt3.execute();
    ResultSet rs1 = stmt3.getResultSet();
    System.out.println("rs1 " + rs1); --> returns null
    procedure-------------
    CREATE PROCEDURE answers_select_id (IN question_id bigint )
    P1:BEGIN
    DECLARE cursor1 CURSOR WITH RETURN TO CLIENT FOR
    SELECT a.answer_id from answers as a where a.question_id = question_id;
    open cursor1;
    END P1;
    I am using the same java code with mysql stored procs . It works fine there but I assume open cursors in db2 stored proc is causing the problem . If I can help it , I need to maintain the same java code for mysql ad db2 . Please help me ...
    Thanks,
    Av~

    Hi,
    I am trying to do something like this but with Oracle stored procedure which returns an associate array and a cursor and these are defined as INOUT. I am not finding a way how to do it with editable row set. Can you plese list the steps used to make things work.
    Thanks.

  • Resultset returns null while calling a DB2 stored procedure using hibernate

    Hi All ,
    I am trying to call a db2 stored proc with cursor open from my java code but it always returns me null results though it executes fine when I call the procedure from the command line
    Java code....................
    CallableStatement stmt3 = EyeHibernateApp.getHibernateSession().connection().prepareCall("{call answers_select_id( ? )}");
    stmt3.setString(1,20);
    stmt3.execute();
    ResultSet rs1 = stmt3.getResultSet();
    System.out.println("rs1 " + rs1); --> returns null
    procedure-------------
    CREATE PROCEDURE answers_select_id (IN question_id bigint )
    P1:BEGIN
    DECLARE cursor1 CURSOR WITH RETURN TO CLIENT FOR
    SELECT a.answer_id from answers as a where a.question_id = question_id;
    open cursor1;
    END P1;
    I am using the same java code with mysql stored procs . It works fine there but I assume open cursors in db2 stored proc is causing the problem . If I can help it , I need to maintain the same java code for mysql ad db2 . Please help me ...
    Thanks,
    Av~

    Hi,
    I am trying to do something like this but with Oracle stored procedure which returns an associate array and a cursor and these are defined as INOUT. I am not finding a way how to do it with editable row set. Can you plese list the steps used to make things work.
    Thanks.

  • Stored Procedure: Function returns Array

    I was just wondering if following scenario is possible in a stored procedure.
    I have a package, which includes 4 different functions and 1 procedure. Procdure uses ref cursor to return values in my reporting tool. What I am trying to do is to write a function which takes input and return array of varchar. Something like..
    Package ABC
    Function student_classes (student_no in Varchar2) return [array]
    begin
    select class_nbr into [array]
    from student_table
    where student_nbr = student_no;
    return [array];
    end student_classes;
    procedure students_info (rpt_cursor IN OUT rpt_type)
    begin
    OPEN rpt_cursor FOR
    select
    student_name,
    student_nbr,
    student_address,
    student_classes (student_nbr) --returns array
    from student_table;
    end student_info; --end of procedure
    end abc; --end of pacakge.
    I used [array], as I am ont sure how to define (syntax) it in spec part of package or in body. I will really appreciate if someone could help me with this function.
    Thank you

    Thanks for the reply Tonguc Y.
    I declared an array in my package declaration
    CREATE OR REPLACE PACKAGE rpt_TESTING_pkg
    AS TYPE rpt_type IS REF CURSOR;
         TYPE DIAGARRAY IS VARRAY(20) OF VARCHAR2(6);
         FUNCTION DIA_CODES (MNO IN VARCHAR2) RETURN DIAGARRAY;
         PROCEDURE member (rpt_cursor IN OUT rpt_type);
    END rpt_TESTING_pkg;
    but then when I try to use it in my function it gives me error that I should declare DIAGARRAY.
    CREATE OR REPLACE PACKAGE BODY rpt_TESTING_pkg
    as
    FUNCTION DIA_CODES (MNO IN VARCHAR2)
                   RETURN DIGARRAY AS diags DIGARRAY;
    begin
    <sql block>
    end dia_codes;
    end rpt_TESTING_pkg;
    Any suggestions.

  • Invoking stored procedure that returns array(oracle object type) as output

    Hi,
    We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
    JPA Class:
    import java.io.Serializable;
    import java.sql.Array;
    import java.util.List;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import org.eclipse.persistence.annotations.Direction;
    import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
    import org.eclipse.persistence.annotations.StoredProcedureParameter;
    * The persistent class for the MessagePublish database table.
    @Entity
    @NamedStoredProcedureQuery(name="GetTeamMembersDetails",
         procedureName="team_emp_maintenance_pkg.get_user_team_roles",
         resultClass=TeamMembersDetails.class,
         returnsResultSet=true,
         parameters={  
         @StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
         @StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
    public class TeamMembersDetails implements Serializable {
         private static final long serialVersionUID = 1L;
    @Id
         private long userId;
         private List<TeamMembersDetailsOT> teamMembersDetailsOT;
         public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
              this.teamMembersDetailsOT = teamMembersDetailsOT;
         public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
              return teamMembersDetailsOT;
    Procedure
    PROCEDURE get_user_team_roles (
    i_user_id IN ue_user.user_id%TYPE
    , o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
    , i_debugmode IN NUMBER :=0)
    AS
    OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
    TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.

    A few things.
    You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
    Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
    In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
    If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
    To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
    I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
    James : http://www.eclipselink.org

Maybe you are looking for