Error in result set from join query

I get a SQL exception from the JDBC thin driver when I make a getXXX( "string" ) call on a result set object when the query is a join. Aliases don't seem to help.
Below is the stack trace.
Anybody have any ideas?
matt
ResultSet.findColumn
java.sql.SQLException: Invalid column name: get_column_index
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:427)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java, Compiled Code)
at oracle.jdbc.driver.OracleResultSet.findColumn(OracleResultSet.java:680)
at person.PersonMgr.getForEdit(PersonMgr.java:114)
at person.PersonMgr.getForView(PersonMgr.java:168)
at person.PersonMgr.getPersonForView(PersonMgr.java:164)
at nwsession.NWSession.login(NWSession.java:224)
at jsp.dologin._jspService(dologin.java:241)
at com.livesoftware.jsp.HttpJSPServlet.service(HttpJSPServlet.java:31)
at com.livesoftware.jsp.JSPServlet.service(JSPServlet.java:129)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.livesoftware.jrun.JRun.runServlet(JRun.java, Compiled Code)
at com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java:116)
at com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(JRunProxyServiceHandler.java, Compiled Code)
at com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.java, Compiled Code)

Your reference to NS.REQDATE is too deep. Oracle will only allow you to reference a column from the main query one level deep.
I think you can just change that query into this:
(Select AVG(((cpath.REQUESTDATETIME)- NS.REQDATE)*1440) AvgTime
FROM usersessiondetails cpath
Where cpath.Userkey=(Select Userkey from ods_user where userid=NS.UserId and namespace=NS.Namespace)
   and cpath.acctnum=aCCTNUM
   and cpath.transactionname IN (AUTH_LOGOFF' )
   and cpath.REQUESTDATETIME = NS.REQDATE )You do not need the extra query level to do the AVG.

Similar Messages

  • How to export result set from mysql query browser to .sql in oracle

    Hi folks:
    I was trying to export result set from MySql query browser to Oracle. I could able to do
    File->Export Result Set-> Excel format...
    What I am trying to get is .sql file so that I can run it as a script in my oracle db. Is there any way we can get .sql file with inserts and delimeters ....?
    Did you guys get my question.?
    Please throw some light on this....
    Could be very appreciable ....
    Thanks
    Sudhir Naidu

    Hi
    Create a sql statement which generates the insert statements.
    Something like this:
    select 'insert into table1 (column1, column2, column3) values (' ||
    column1 || ', ' || column2 || ', ' || column3 || ');' from table 1;
    The || sign is the string concatenation sign in Oracle, replace it the appropriate sign in MySql. Export the result set of this query into a file, and you can run it in a SqlPlus.
    Ott Karesz
    http://www.trendo-kft.hu

  • Creating a total result set from a query

    I am having an issue trying to come up with a solution to return a table with the following stored procedure and then at the bottom being able to have a table row that shows the totals.  Do I need to run a separate query for this...here is what I have:
    Create PROCEDURE [dbo].[usp_me_totalquestion]
    @startDate datetime = NULL
    , @ENDDate datetime = NULL
    , @userid int = -1
    , @groupByScript int = 0
    , @groupByAgent int = 0
    , @groupByDate int = 0
    AS
    set nocount on
    begin
    DECLARE @sql VARCHAR(max)
    DECLARE @where VARCHAR(200)
    SELECT
    --[AgentName] = (CASE WHEN @userid > 0 THEN FullName ELSE 0 END),
    [scriptload] = count(*),
    [scriptread] = sum(CASE WHEN ScriptRead > 0 THEN 1 ELSE 0 END),
    [scriptreadpercent] = round(CASE WHEN count(*) = 0 THEN 0.00 ELSE (sum(CASE WHEN scriptread > 0 THEN 1 ELSE 0 END)/cASt(count(*) AS DECIMAL(6,2))) * 100 END,1),
    [cancelled] = sum(CASE WHEN STATUS = 'F' THEN 1 ELSE 0 END),
    [retained] = sum(CASE WHEN STATUS = 'S' THEN 1 ELSE 0 END)
    FROM ccp_customer_retention_log r
    inner join ccp_users u
    ON r.id = u.id
    WHERE r.insertdt between CAST(@startDate AS VARCHAR(15)) and CAST(@EndDate AS VARCHAR(15))
    group by
    CASE
    WHEN @GroupByScript = 1 THEN r.scriptID
    WHEN @GroupByAgent = 1 THEN u.fullname

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    Please stop using “usp_” prefixes. It looks like FORTRAN I and II instead of SQL. We have DATE data type now, too! You even put commas at the front of the punchcard, like 1960's FORTRAN. 
    Why are you doing dynamic SQL? That is how you tell the world that you have no idea what you are doing. With a flip of a switch, it becomes a procedure for automobiles, squids or Lady Gaga. Then you have a generic magic “id” that makes no sense. What does it
    identify? To be is to be something in particular (remember the Law of Identity from Logic 101?). Likewise, there is no generic status – marriage? Employment? Graduation? What? I will guess “user_id”, bu that would be awful. An identifier is a tag number and
    would never be an INTEGER. Why do you want to do math with it? Think about how silly “(CASE WHEN @in_user_id > 0 THEN full_name ELSE 0 END)” is; an integer changes to a string (yes, names are strings in data models)
    Why did you cast dates to strings? Why are there no aliases on the column names? Start using “<expression> AS <column name>” instead of 1970's Sybase “<column name> = <expression>”; your code will not port, or be readable to SQL programmers. 
    I have no idea what the proc name should be, but it is a verb and the object upon which it act in a valid data model. 
    CREATE PROCEDURE <verb>_<object>
    (@in_start_date DATE = NULL, @in_end_date DATE = NULL,
       @in_user_id INTEGER = -1)
    AS
    SELECT @in_user_id, ??.script_id, ??.full_name, ??.something_status
      FROM CCP_Customer_Retention_Log AS R,
           CCP_Users AS U
     WHERE R.user_id = U.user_id
       AND @in_user_id = U.user_id
       AND AND R.insertion_date BETWEEN @in_start_date AND @in_end_date;
    But this is still awful. Create a VIEW with this data set. Then do the reports on it. As separate procedures with high cohesion. Follow Netiquette and maybe we can help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Don't get a result set from a query to mySql database

    Hello everyone,
    I am writing a program in which i refer to a mySql database.
    I encountered a problem using the executeQuery in which i don't get a resultSet at the end of the run,
    instead i get a null.
    gust for the record, the api says that it will never return null(se 6), also i queried the DB with a mySql client and the data is there
    and when i use execute("") everything works fine.
    I just can't get my wished result.
    the peace of code I am referring to is here, please feel free to say if you need more code...
    public static ResultSet getAccountResSet(int id) throws SQLException {
             //String query = "SELECT acctNum, acctOwnerId, acctOwnerName, balance, acctType, creditLimit, yearlyInterest, duration, creationDate, relatedCheckingAccoun FROM accounts WHERE acctNum="+id;
             String query = "select * from accounts where id="+id;
             ResultSet rs = statement.executeQuery(query);//this line falls, rs is null and i get null pointer exception
             return rs;
        }thanks for you help :)
    Edited by: gizmokaka on Mar 29, 2008 8:37 AM

    Maybe it's not the function executeQuery(query) that gives you the nullpointer. I think it may be that there is no connection to the DB, in which case the statement variable is null. Call to a method through this variable will trigger a nullpointer. Could you please post the exception text here? It may tell you where the NullPointerException occurs.
    //Chris

  • It is required to get the result set from the last query.

    I need this SP to return the result set from the last query.
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO
    alter        proc spQ_GetASCBillingRateIDs2
    @ScheduleID CHAR(15),
    @startdate smalldatetime,
    @enddate smalldatetime
    as
    set nocount on
    truncate table tbltmpgroup
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tbltmptbltest]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[tbltmptbltest]
    exec sp_CreateTblTmpGroup
    insert into tbltmpgroup
    SELECT DISTINCT
    case when pd.billparent = 'N' then org.eligibleorgid
    else isnull(af.parentid, org.eligibleorgid) end as billorgid,
    pd.individualbill , pd.cobrabill, pd.billparent,
    org.eligibleorgid, org.polid, org.orgpolicyid,
    pp.planid,  pp.rateid,
    ps.ascinvoicedate,
    case when ps.ascclaimfromdate > @startdate then ps.ascclaimfromdate
    else @startdate end as premiumrundayFrom,
    case when ps.ascclaimtodate < @enddate then ps.ascclaimtodate
    else @enddate end as premiumrundayTo,
    fts.effdate, fts.termdate,
    case when fts.effdate > @startdate then fts.EffDate
    else @startdate end as ascStartDate,
    case when fts.termdate < @enddate then fts.termdate
    else @enddate end as ascEndDate
    FROM premiumschedule ps (nolock)
    inner join orgpolicy org (nolock)
    on org.ascinvoicerungroup between ps.premiumrundayfrom and ps.premiumrundayto
    inner join FundingTypeStatus fts
    on fts.orgpolicyid = org.orgpolicyid
    and fts.fundtype = 'ASC'
    and ((fts.effdate between @startdate and @enddate)
    or (fts.termdate between @startdate and @enddate)
    or (fts.effdate < @startdate and fts.termdate > @enddate))
    inner join eligibilityorg o (nolock)
    on org.eligibleorgid = o.eligibleorgid
    inner join policydef pd (nolock)
    on pd.polid = org.polid
    inner join policyplans pp (nolock)
    on pp.polid = org.polid
    inner join program p (nolock)
    on pd.programid = p.programid
    left join orgaffiliation af with (nolock)
    on org.eligibleorgid = af.childid
    WHERE ps.premiumscheduleid = @ScheduleID
    AND org.orgpolicyid <> ''
    go
    SELECT DISTINCT z.rateid, e.enrollid, z.ascstartdate, z.ascenddate
    into tbltmptbltest FROM enrollment E (nolock)
    inner join tbltmpgroup z
    on e.rateid = z.rateid
    go
    CREATE UNIQUE CLUSTERED INDEX IDXTempTable  ON tbltmptbltest(enrollid)
    create index IDXTemptableDates on tbltmptbltest(ascstartdate,ascenddate)
    go
    select distinct t.*
    from tbltmpgroup t
    where rateid in (
    select distinct t.rateid from VW_ASC_Billing)
    order by billorgid
    set nocount off
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules (you have no idea).
    Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    What you did post is bad SQL. 
    The prefix “tbl-” is a design flaw called tibbling and we do not do it. We seldom use temp tables in RDBMS; it is how magnetic tape file programmers fake scratch tapes. 
    If the schema is correct, then SELECT DISTINCT is almost never used. 
    Your “bill_parent” looks like a assembly language bit flag; we never use those flags in SQL. 
    “Funding_Type_Status” is an absurd name for a table. A status is a state of being, not an entity. A type is an attribute property. So this table ought to be column that is either a “funding_type” or “funding_status” (with the time period for the state of being
    shown in other columns). But this hybrid is not possible in a valid data model. 
    Want to try again, with DDL and some specs? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Updateable scrollable result sets with join statement

    I am writing a generic GUI fronend for any database that has a JDBC2.0 driver available.
    I have been using scrollable updateable result sets. These work well for individual tables but as soon as two tables are linked either implicitly or explicitly with a join statement the result set meta data isDefinitelyWriteable is set to false thus preventing the result set from being updated.
    Assuming I am using the JDBC-ODBC driver with java sdk1.4.0 and MS Access (although I have used other databases and JDBCs I assume that the one mentioned will be a common combination and needs to work) is there any way of getting linked tables to be updateable with scollable result sets.
    I am using scrollable result sets since this prevents the necessity of putting the data in a secondary data store.
    I am able to link tables programmatically by requerying the linked table with a new where clause each time the cursor moves in the linked table but this seems rather wasteful. This method is not vey satisfactory when attempting to display data from more than one table which have more than one linked level (i.e. cascaded links).
    Is there a simple solution to this problem or do I have to do a rewrite using an update statement instead of having an updateable result set. I assume this method would also require the result set to be reloaded after the update.
    Any suggestions much appreciated.

    I am trying to make the GUI as flexible as possible by constructing "views" which if necessary link tables on one field in each table. This is fine for two tables but when linking to several tables the information thats produced cannot be read easily because as it stands the information from each table is displayed on a separate tabbed page. This mechanism allows me to keep each record set for each table separate and updateable.
    Since I could see that this was not very user friendly in the way that it displayed the data I decided to try and introduce a join on two or more tables and hence the introduction of the current problem.
    I mentioned that the objective was to be flexible and therefore I also allow queries to be written by the user to facilitate for any shortfalls of the automatic query construction produced by using the "views" mechanism.
    So the answer to your question is yes I do control the SQL selections with one mechanism but ultimately no I do not because I provide a fail safe which allows the user to enter arbitary SQL.
    I only really want a solution for the controlled SQL construction mechanism where I create the link between two or more tables. As mentioned earlier these are linked on one field only but I wish to provide the option of displaying the result in a single table (tabbed page) rather than spread across multiple tabbed pages.

  • Need help in restricting a result set from a UNION in MERGE

    Hello,
    Would really appreciate if anybody could help me out with the issue I am facing with the below statements (I am new to Oracle ):
    merge into table_name_1 p
    using
      select p_key, value_1, value_2
      from some_tables
      UNION
      select p_key, value_1, value_2
      from some_tables
      UNION
    )t
    on (p.p_key = t.p_key)
    when matched then
      update table_name_1 with value_1 and value_2
    when not matched then
      insert table_name_1 with p_key, value_1, value_2;
    Now, the union of all those selects gives me distinct values and it works most of the times but when I get values like below, the merge fails:
    p_key-----value_1-----value_2
    100-----25-----50
    100-----NULL-----50
    I browsed the net and understood the reason behind this: the result set becomes ambiguous and merge doesn't know which row to insert first and which one to update.
    Now, my requirement is: I could have any of the below scenario/result sets from the union and I need only 1 row per p_key -
    result_set_1
    p_key-----value_1-----value_2
    100-----25-----50 ***************need this row
    100-----NULL-----50
    100-----NULL-----NULL
    result_set_2
    p_key-----value_1-----value_2
    100-----25-----NULL ***************need this row
    100-----NULL-----NULL
    result_set_3
    p_key-----value_1-----value_2
    100-----25-----NULL ***************need this row (p_key = 100)
    100-----NULL-----NULL
    200-----NULL-----75 ***************need this row (p_key = 200)
    200-----NULL-----NULL
    300-----90-----95 ***************need this row (p_key = 300)
    So, I basically need a way to restrict the values that I will get from the UNION of all those selects to fit the requirement above, hope I was able to explain the issue I am facing.
    Any help would be greatly appreciated.
    Thanks,
    Dpunk

    In all cases the goal is to find an order by value that will make the row you want be first.
    The query I gave is calculating a priority for each row by adding up values showing whether each column is null or not null. The case statements check whether each column is null and need to be added up to give a total priority value.
    Value_1   Value_2   Priority
    Not Null  Not Null  2 + 1 = 3
    Not Null  Null      2 + 0 = 2
    Null      Not Null  0 + 1 = 1
    Null      Null      0 + 0 = 0
    The priority value ends up being a bitmap showing whether each value is null or not null. I think that reflects my mathematics background.
    Another way of getting the same result (suggested to me by your asking why it needs the "+") would be to use two CASE expressions as separate order by items:
    select p_key, value_1, value_2 from
    (select p_key, value_1, value_2, row_number() over
              (partition by p_key
               order by case when value_1 is null then 0 else 1 end DESC,
                        case when value_2 is null then 0 else 1 end DESC
              ) as rn
      from (your UNION query here)
    where rn = 1
    A third way is to use a more complex case statement:
    select p_key, value_1, value_2 from
    (select p_key, value_1, value_2, row_number() over
              (partition by p_key
               order by case when value_1 is NOT null and value_2 is NOT null then 1
                             when value_1 is NOT null and value_2 is     null then 2
                             when value_1 is     null and value_2 is NOT null then 3
                             when value_1 is     null and value_2 is     null then 4
                         end  ASC
              ) as rn
      from (your UNION query here)
    where rn = 1

  • Performance to fetch result set from stored procedure.

    I read some of related threads, but couldn't find any good suggestions about the performance issue to fetch the result set from a stored procedure.
    Here is my case:
    I have a stored procedure which will return 2,030,000 rows. When I run the select part only in the dbartisan, it takes about 3 minutes, so I know it's not query problem. But when I call the stored procedure in DBArtisan in following way:
    declare cr SYS_REFCURSOR;
    firstname char(20);
    lastname char(20);
    street char(40);
    city char(20);
    STATE varchar2(2);
    begin DISPLAY_ADDRESS(cr);
    DBMS_OUTPUT.ENABLE(null);
    LOOP
    FETCH cr INTO firstname,lastname,street, city, state;
    EXIT WHEN cr%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE( firstname||','|| lastname||','|| street||',' ||city||',' ||STATE);
    END LOOP;
    CLOSE cr;
    end;
    It will take about 100 minutes. When I used DBI fetchrow_array in perl code, it took about same amount of time. However, same stored procedure in sybase without using cursor, and same perl code, it only takes 12 minutes to display all results. We assume oracle has better performance. So what could be the problem here?
    The perl code:
    my $dbh = DBI->connect($databaseserver, $dbuser, $dbpassword,
    { 'AutoCommit' => 0,'RaiseError' => 1, 'PrintError' => 0 })
    or die "couldn't connect to database: " . DBI->errstr;
    open OUTPUTFILE, ">$temp_output_path";
    my $rc;
    my $sql="BEGIN DISPLAY_ADDRESS(:rc); END;";
    my $sth = $dbh->prepare($sql) or die "Couldn't prepare statement: " . $dbh->errstr;
    $sth->bind_param_inout(':rc', \$rc, 0, { ora_type=> ORA_RSET });
    $sth->execute() or die "Couldn't execute statement: " . $sth->errstr;
    while($address_info=$rc->fetchrow_arrayref()){
    my ($firstname, $lastname, $street, $city, $STATE) = @$address_info;
    print OUTPUTFILE $firstname."|".$lastname."|".$street."|".$city."|".$STATE;
    $dbh->commit();
    $dbh->disconnect();
    close OUTPUTFILE;
    Thanks!
    rulin

    Thanks for you reply!
    1) The stored procedure has head
    CREATE OR REPLACE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    cv_1 IN OUT SYS_REFCURSOR
    AS
    err_msg VARCHAR2(100);
    BEGIN
    --Adaptive Server has expanded all '*' elements in the following statement
    OPEN cv_1 FOR
    Select ...
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    err_msg := SQLERRM;
    dbms_output.put_line (err_msg);
    ROLLBACK;
    END;
    If I only run select .. in DBArtisan, it display all 2030,000 rows in 3:44 minutes
    2) But when call stored procedure, it will take 80-100 minutes .
    3) The stored procedure is translated from sybase using migration tools, it's very simple, in sybase it just
    CREATE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    AS
    BEGIN
    select ..
    The select part is exact same.
    4) The perl code is almost exact same, except the query sql:
    sybase verson: my $sql ="exec DISPLAY_ADDRESS";
    and no need bind the cursor parameter.
    This is batch job, we create a file with all information, and ftp to clients everynight.
    Thanks!
    Rulin

  • Virtual column in the result set of the query.

    Hi folks,
    I have table , let it be, EMP. It has columns ENAME,EMPNO,JOB etc.,
    My requirement is to add an extra column, not present in the table, having NULL value at the time of diplaying the results of a query. I hope you got it. So a column that does not exists in the table should get displayed in the resultant set when we query the results from that table. so my question is, how to write the SELECT statement using that virtual column.
    I'd thought of using X column in Dummy table but what if I don't have any dummy table in my particular schema.
    Please do revert back with the solution.
    Your effort'll be genuinely appreciated.
    Cheers
    PCZ

    Hi,
    If you just wany display null values you can write query like this :
    SELECT ENAME,EMPNO,JOB , NULL DUMMY_COLUMN FROM emp;
    Regrads
    Avinash

  • JDBC Result Set from Non-Database Source

    In Java, is it possible to create a result set from a non-database data source?, for example an XML file, text file, vectors, java beans
    We have a Swing application that currently makes direct JDBC calls to the DB2 database for creating result sets. We want to replace JDBC calls with calls to web service, but want to still create result sets on the client, so the replacement of the datasource from database to web service call is transparent to the rest of the code.

    In Java, is it possible to create a result set from a
    non-database data source?, Yes.
    for example an XML file,
    text file, vectors, java beans
    We have a Swing application that currently makes
    direct JDBC calls to the DB2 database for creating
    result sets. We want to replace JDBC calls with calls
    to web service, but want to still create result sets
    on the client, so the replacement of the datasource
    from database to web service call is transparent to
    the rest of the code.You might want to think carefully about what you are doing.
    It is fairly easy, although somewhat tedious (many methods,) to create a new type of ResultSet.
    But if the above application is doing SQL via statements and expecting the result via a ResultSet then you are not just creating a ResultSet but an entire driver and one that will have to deal with SQL as well. And if you have to handle the SQL itself that means you will probably need a parser and interpreter.

  • Xml parsing error while selecting whole result set for sql query

    Hi All,
    I am having xml parsing error while selecting whole query result set. The data is coming fine for default result set of 50 rows.
    My exception is below.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00234: namespace prefix "xsi" is not declared
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    *31011. 00000 - "XML parsing failed"*
    **Cause: XML parser returned an error while trying to parse the document.*
    **Action: Check if the document to be parsed is valid.*
    My sql query is below that is giving results for default result set of 50 rows.
    select extract(xmlType(clob_xml_colm_name), '//v2:node1//childnode/text()','xmlns:v2="namespace_url"').getStringVal()  from table_name
    My sql developer version is below.
    Java(TM) Platform     1.7.0_04
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42
    My database version is below.
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
    Please could any one help me urgently as the sql query is supposed to be correct as it is returning query results, but the problem happening when i try to select whole result set.
    Thanks and regards,

    What does the XML look like? It appears that some of the supposed XML stored as a CLOB is not really valid XML. Find the row in the table that is causing your issue and review the "XML" in it.

  • Query Error Information: Result set is too large; data retrieval ......

    Hi Experts,
    I got one problem with my query information. when Im executing my report and drill my info in my navigation panel, Instead of a table with values the message "Result set is too large; data retrieval restricted by configuration" appears. I already applied "Note 1127156 - Safety belt: Result set is too large". I imported Support Package 13 for SAP NetWeaver 7. 0 BI Java (BIIBC13_0.SCA / BIBASES13_0.SCA / BIWEBAPP13_0.SCA) and executed the program SAP_RSADMIN_MAINTAIN (in transaction SE38), with the object and the value like Note 1127156 says... but the problem still appears....
    what Should I be missing ??????  How can I fix this issue ????
    Thank you very much for helping me out..... (Any help would be rewarded)
    David Corté

    You may ask your basis guy to increase ESM buffer (rsdb/esm/buffersize_kb). Did you check the systems memory?
    Did you try to check the error dump using ST22 - Runtime error analysis?
    Edited by: ashok saha on Feb 27, 2008 10:27 PM

  • Which is more efficient way to get result set from database server

    Hi,
    I am working on a project where I require to query database to fetch result set and then iterate through the resultset. Now, What I want is that I want to create one single java code that would call many different SQLs and create a list out of resultset. There are two approaches for me.
    1.) To create a txt file where I can store my queries. My java program can read this file and get the appropriate query to be used.
    2.) To create a stored procedure containing the queries and call the stored procedure from my java program. Also, not that some of the queries needs to be created dynamically depending upon the parameteters supplied.
    Out of these two approches which is optimum and why?
    Also, following things to be noted.
    1. At times I want to create where clause of the query dynamically depenending upon the parameters passed.
    2. I want one single java file that will handle all database calls.
    3. Paramters to the stored procedure can be passed using array descriptor.
    4. Conneciton I am making using JNDI.
    Please do provide me optimum way of out these two. You may also suggest some other approaches, if any.
    Thanks,
    Rajan
    Edited by: RP on Jun 26, 2012 11:11 PM

    RP wrote:
    In case of queries stored in text files. I will require to replace some pre defined placeholder with actual parameters and then pass that modified query to db engine. Even I liked the second approach as it is more easily maintainable. There are a couple of issues. Shared SQL is one. Irrespective of the method used, the SQL cursor that is created needs to have bind variables. This ensures re-usability of the cursor. This reduces the risk of Shared Pool fragmentation. This lowers hard parsing and reduces CPU utilisation.
    Another issue is flexibility. If the SQL cursors are created by stored procedures, this code resides on the server and abstracts the Java client from the complexities of SQL and SQL performance. The code can easily be updated and fine tuned to deliver faster/better SQL cursors, or modified to take new Oracle features, changes in data model, and so on, into consideration. This stored proc can be updated without having to touch or recompile a single byte of Java client code.
    There's also the security issue. What is more secure? SQL encapsulated in stored procs in a secure database and server environment? Or SQL "encapsulated" in text files on the client?
    The less code you have running on the client, the less code you have running in the wild that can be compromised without having to first compromise the server.
    Only I was worried about any performace issue might happen using this approach. Performance is not a factor of who creates the SQL cursor.
    Whether Java client creates a SQL cursor, or a PL/SQL stored proc creates a SQL cursor, or a .Net client creates a SQL cursor - that SQL cursor does not know what the client is. It does not care what the client is. The SQL cursor performs as well as it is capable of.. given the execution plan, data volumes, server resources and speed/performance of the server.
    The client language and SQL cursor interface used by the client (there are several in PL/SQL), determines the performance of the client's interaction with the cursor (e.g. round trips to the database when interfacing with the cursor). The client language (and its client interface to the cursor) does not dictate the actual performance of that SQL cursor on the database (does not make joins faster, or I/O faster)
    One more question, Will my java program close the cursor that I opened in Procedure?That you need to ask your Java code. Java code leaking ref cursors are unfortunately all too common. You need to make sure that your Java client interface to SQL cursors, closes the cursor handle when done.

  • Random result set from cursor

    Hello all,
    I have a cursor defined that simply performs a SELECT. I would like to be able to dynamically state whether I'd like the entire result set returned or a random selection.
    The issue I'm having is that because the cursor is already defined I am trying to build this functionality into the LOOP. I am able to return random sets by using DBMS_RANDOM but I've only been able to do this when modifying the SELECT statement. I have considered an ORDER BY in the cursor and then simply EXIT'ing when the ROWNUM meets a certain number of returned results. This would, at least, provide the ability to return a user specified number of random records. Perhaps the ORDER BY could be modified by a cursor parameter?
    I'm hoping there's an elegant solution that I'm missing.
    Thanks for any help!
    Mark

    user10368702 wrote:
    Thanks for pointing out this feature to me. The problem is that my cursors are currently doing multi-table joins and the SAMPLE clause will not work with them. To clarify, I would like to programatically decide whether I'd like to return all the rows from the cursor, or just a sampling. The current method being used it to generate a random number and loop through the entire cursor until that rownum is found. I dislike the table walk, but am unable to come up with a way to return a specific sample size or record num. Ideally I'd like to be able to perform the equivalent of ROWNUM = X with the results from the cursor.
    Thanks for any help!Probably you can't use dynamic SQL (using OPEN or EXECUTE IMMEDIATE) for a particular reason? Because in that case you could just use your query as an inline view like that:
    SELECT * FROM (
    <YOUR_QUERY_INCLUDING DBMS_RANDOM_VALUE>
    WHERE <RANDOM_VALUE> <= <YOUR_LIMIT>and construct your query dynamically.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/
    Edited by: Randolf Geist on Sep 29, 2008 11:21 PM
    Removed unnecessary ORDER BY

  • Returning result set from procedure out parameter, display with anon block

    I'm trying to do something pretty simple (I think it should be simple at least). I want to use a pl/sql procedure to return a result set in an OUT parameter. If I run this code by itself (in the given anonymous block at the end, without trying to display any results), toad says that the PL/SQL procedure successfully completed.
    How can I display the results from this procedure? I am assuming that the result set should be stored in the O_RETURN_REDEEM_DTL, but how can I get anything out of it?
    I have this package with the following procedure:
    /* FUNCTION - REDEEM_DTL_READ                          */
         PROCEDURE REDEEM_DTL_READ(
              ZL_DIVN_NBR_IN     IN     REDEEM_DTL.ZL_DIVN_NBR%TYPE,
              GREG_DATE_IN     IN     REDEEM_DTL.GREG_DATE%TYPE,
              ZL_STORE_NBR_IN     IN     REDEEM_DTL.ZL_STORE_NBR%TYPE,
              REGISTER_NBR_IN     IN     REDEEM_DTL.REGISTER_NBR%TYPE,
              TRANS_NBR_IN     IN     REDEEM_DTL.TRANS_NBR%TYPE,
              O_RETURN_REDEEM_DTL OUT REDEEM_DTL_TYPE,
              o_rtrn_cd       OUT NUMBER,
              o_err_cd        OUT NUMBER,
              o_err_msg       OUT VARCHAR2
         IS
         BEGIN
              o_rtrn_cd := 0;
              o_err_msg := ' ';
              o_err_cd := 0;
              --OPEN REDEEM_DTL_READ_CUR(ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN, REGISTER_NBR_IN, TRANS_NBR_IN);
              OPEN O_RETURN_REDEEM_DTL FOR SELECT * FROM REDEEM_DTL;
    --           LOOP
    --                FETCH REDEEM_DTL_READ_CUR INTO O_RETURN_REDEEM_DTL;
    --                EXIT WHEN REDEEM_DTL_READ_CUR%NOTFOUND;
    --           END LOOP;
    --           CLOSE REDEEM_DTL_READ_CUR;
         EXCEPTION
          WHEN OTHERS
          THEN
               o_rtrn_cd := 7;
                 o_err_msg := SUBSTR (SQLERRM, 1, 100);
                 o_err_cd  := SQLCODE;
         END REDEEM_DTL_READ;and call it in an anonymous block with:
    DECLARE
      ZL_DIVN_NBR_IN NUMBER;
      GREG_DATE_IN DATE;
      ZL_STORE_NBR_IN NUMBER;
      REGISTER_NBR_IN NUMBER;
      TRANS_NBR_IN NUMBER;
      O_RETURN_REDEEM_DTL PSAPP.CY_SALESPOSTING.REDEEM_DTL_TYPE;
      O_RETURN_REDEEM_DTL_OUT PSAPP.CY_SALESPOSTING.REDEEM_DTL_READ_CUR%rowtype;
      O_RTRN_CD NUMBER;
      O_ERR_CD NUMBER;
      O_ERR_MSG VARCHAR2(200);
    BEGIN
      ZL_DIVN_NBR_IN := 71;
      GREG_DATE_IN := TO_DATE('07/21/2008', 'MM/DD/YYYY');
      ZL_STORE_NBR_IN := 39;
      REGISTER_NBR_IN := 1;
      TRANS_NBR_IN := 129;
      -- O_RETURN_REDEEM_DTL := NULL;  Modify the code to initialize this parameter
      O_RTRN_CD := NULL;
      O_ERR_CD := NULL;
      O_ERR_MSG := NULL;
      PSAPP.CY_SALESPOSTING.REDEEM_DTL_READ ( ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN,
    REGISTER_NBR_IN, TRANS_NBR_IN, O_RETURN_REDEEM_DTL, O_RTRN_CD, O_ERR_CD, O_ERR_MSG );
      FOR item IN O_RETURN_REDEEM_DTL
      LOOP
        DBMS_OUTPUT.PUT_LINE('ZL_DIVN_NBR = ' || item.ZL_DIVN_NBR);
      END LOOP;
    END; And end up with an error:
    ORA-06550: line 25, column 15:
    PLS-00221: 'O_RETURN_REDEEM_DTL' is not a procedure or is undefined
    ORA-06550: line 25, column 3:
    PL/SQL: Statement ignoredMessage was edited by:
    user607908

    Aha, I knew I forgot something!
    I actually had it defined as a REF CURSOR in PSAPP.CY_SALESPOSTING package spec:
    TYPE REDEEM_DTL_TYPE IS REF CURSOR;since I wasn't sure what to make it.
    Cursor used in procedure:
    CURSOR REDEEM_DTL_READ_CUR (
      zl_divn_nbr_in IN NUMBER,
      greg_date_in IN DATE,
      zl_store_nbr_in IN NUMBER,
      register_nbr_in IN NUMBER,
      trans_nbr_in IN NUMBER)
    IS
    SELECT ZL_DIVN_NBR, GREG_DATE, ZL_STORE_NBR, REGISTER_NBR, TRANS_NBR, PAYMENT_TYP_NBR
    FROM REDEEM_DTL
    WHERE ZL_DIVN_NBR = zl_divn_nbr_in AND GREG_DATE = greg_date_in AND
       ZL_STORE_NBR = zl_store_nbr_in AND REGISTER_NBR = register_nbr_in AND
       TRANS_NBR = trans_nbr_in;Updated code:
    /* PROCEDURE - REDEEM_DTL_READ                          */
         PROCEDURE REDEEM_DTL_READ(
              ZL_DIVN_NBR_IN     IN     REDEEM_DTL.ZL_DIVN_NBR%TYPE,
              GREG_DATE_IN     IN     REDEEM_DTL.GREG_DATE%TYPE,
              ZL_STORE_NBR_IN     IN     REDEEM_DTL.ZL_STORE_NBR%TYPE,
              REGISTER_NBR_IN     IN     REDEEM_DTL.REGISTER_NBR%TYPE,
              TRANS_NBR_IN     IN     REDEEM_DTL.TRANS_NBR%TYPE,
              O_RETURN_REDEEM_DTL OUT REDEEM_DTL_TYPE,
              o_rtrn_cd       OUT NUMBER,
              o_err_cd        OUT NUMBER,
              o_err_msg       OUT VARCHAR2
         IS
         BEGIN
              o_rtrn_cd := 0;
              o_err_msg := ' ';
              o_err_cd := 0;
              OPEN REDEEM_DTL_READ_CUR(ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN,
                   REGISTER_NBR_IN, TRANS_NBR_IN);
              --OPEN O_RETURN_REDEEM_DTL FOR SELECT * FROM REDEEM_DTL;
              LOOP
                  FETCH REDEEM_DTL_READ_CUR INTO O_RETURN_REDEEM_DTL;
                   EXIT WHEN REDEEM_DTL_READ_CUR%NOTFOUND;
                   DBMS_OUTPUT.PUT_LINE('ZL_DIVN_NBR = ' || O_RETURN_REDEEM_DTL.ZL_DIVN_NBR);
                END LOOP;
               CLOSE REDEEM_DTL_READ_CUR;
    --           LOOP
    --                FETCH REDEEM_DTL_READ_CUR INTO O_RETURN_REDEEM_DTL;
    --                EXIT WHEN REDEEM_DTL_READ_CUR%NOTFOUND;
    --           END LOOP;
    --           CLOSE REDEEM_DTL_READ_CUR;
         EXCEPTION
          WHEN OTHERS
          THEN
               o_rtrn_cd := 7;
                 o_err_msg := SUBSTR (SQLERRM, 1, 100);
                 o_err_cd  := SQLCODE;
         END REDEEM_DTL_READ;the updated anon block:
    DECLARE
      ZL_DIVN_NBR_IN NUMBER;
      GREG_DATE_IN DATE;
      ZL_STORE_NBR_IN NUMBER;
      REGISTER_NBR_IN NUMBER;
      TRANS_NBR_IN NUMBER;
      O_RETURN_REDEEM_DTL PSAPP.CY_SALESPOSTING.REDEEM_DTL_TYPE;
      O_RTRN_CD NUMBER;
      O_ERR_CD NUMBER;
      O_ERR_MSG VARCHAR2(200);
    BEGIN
      ZL_DIVN_NBR_IN := 71;
      GREG_DATE_IN := TO_DATE('07/21/2008', 'MM/DD/YYYY');
      ZL_STORE_NBR_IN := 39;
      REGISTER_NBR_IN := 1;
      TRANS_NBR_IN := 129;
      -- O_RETURN_REDEEM_DTL := NULL;  Modify the code to initialize this parameter
      O_RTRN_CD := NULL;
      O_ERR_CD := NULL;
      O_ERR_MSG := NULL;
      PSAPP.CY_SALESPOSTING.REDEEM_DTL_READ ( ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN,
         REGISTER_NBR_IN, TRANS_NBR_IN, O_RETURN_REDEEM_DTL, O_RTRN_CD, O_ERR_CD, O_ERR_MSG );
      FOR item IN 1..O_RETURN_REDEEM_DTL.COUNT
      LOOP
        DBMS_OUTPUT.PUT_LINE('ZL_DIVN_NBR = ' || O_RETURN_REDEEM_DTL(item).ZL_DIVN_NBR);
      END LOOP;
    END;and the new error:
    ORA-06550: line 25, column 38:
    PLS-00487: Invalid reference to variable 'O_RETURN_REDEEM_DTL'
    ORA-06550: line 25, column 3:
    PL/SQL: Statement ignoredAlso, it would be nice if the forums would put a box around code so that it would be easy to
    distinguish between what is supposed to be code and what should be regular text...
    Message was edited by:
    user607908

Maybe you are looking for

  • Exchange Online Management cmdlets return Display Name instead of Identity

    Hello, We've got an issue when managing our Exchange Online environment using remote PowerShell. We use Exchange management cmdlets to manage Exchange Online mailboxes. When we run, for example, the Get-MailboxPermission or Get-RecipientPermission cm

  • Slow down after upgrading OS, issue with Startup item

    Problem description: slow after updating OS EtreCheck version: 2.1.5 (108) Report generated January 14, 2015 at 10:45:00 PM EST Click the [Support] links for help with non-Apple products. Click the [Details] links for more information about that line

  • Macbook Pro 13" Sluggishness

    Hello fellow Applers, I've been convinced I was paranoid for a while now, but recently I just can't take it anymore. Please let me know if these are normal specs for a 2011 MBP 13". 4gb DDR3 RAM, 320gb Hitachi HDD 5400rpm 1:34 seconds to power on and

  • IPod resets during video

    Whenever I watch a TV episode on my iPod 80gb (Such as Family Guy or Chappelle Show) I run into a few issues on my iPod. 1. The episode always starts where I left off, never at the beginning. 2. When I press the back button, which either rewinds or r

  • Installation issues Adobe Air

    trying to run an application that uses adobe air but comes up with a message sayin the installation of this application is damaged, try re-installing or contact the publisher for assisatance...i dont know if the problem is with the application im try