Slow in Fetching Query Results

Hi guys, we have been experiencing a serious performance problem with our Oracle database application. The appplication is a C++ app running on a Windows box, queries an Oracle 9.2 database running on another Windows box, through Oracle 9.2 ODBC driver. What we experienced is that the fetch of query results takes significant length of time - around 1.7 seconds for fetching 3000 result rows on a 2.4Ghz dual processor box, whereas the same app/query takes only 50 milliseconds for fetching the same number of result rows. Do you guys have any idea where I should go to track down the problem? The Oracle database configuration? The ODBC driver? Or our C++ database access code?

Yes, all tables involved in the query have 2 to 3 indexes.
I have re-computed statistics on the tables and changed the optimizer_mode to ALL_ROWS. In the following I am attaching the init parameters of my database and the new execution plan
=========================================================
aq_tm_processes = 1
background_dump_dest = C:\oracle\admin\MBTuning\bdump
compatible = 9.2.0.0.0
control_files = ('C:\oracle\oradata\MBTuning\CONTROL01.CTL', 'C:\oracle\oradata\MBTuning\CONTROL02.CTL', 'C:\oracle\oradata\MBTuning\CONTROL03.CTL')
core_dump_dest = C:\oracle\admin\MBTuning\cdump
db_block_size = 8192
db_cache_size = 134217728
db_domain = ''
db_file_multiblock_read_count = 16
db_name = MBTuning
dispatchers = '(PROTOCOL=TCP) (SERVICE=MBTuningXDB)'
fast_start_mttr_target = 300
hash_join_enabled = TRUE
instance_name = MBTuning
java_pool_size = 33554432
job_queue_processes = 10
large_pool_size = 67108864
log_archive_dest_1 = 'LOCATION=C:\oracle\ora92\RDBMS'
open_cursors = 300
optimizer_features_enable = 9.2.0
optimizer_index_caching = 100
optimizer_mode = ALL_ROWS
pga_aggregate_target = 134217728
processes = 150
query_rewrite_enabled = FALSE
remote_login_passwordfile = EXCLUSIVE
sga_max_size = 403774644
shared_pool_size = 67108864
sort_area_size = 524288
star_transformation_enabled = FALSE
timed_statistics = TRUE
undo_management = AUTO
undo_retention = 10800
undo_tablespace = UNDOTBS1
user_dump_dest = C:\oracle\admin\MBTuning\udump
=========================================================
STAT #1 id=1 cnt=2815 pid=0 pos=1 obj=0 op='SORT ORDER BY '
STAT #1 id=2 cnt=2815 pid=1 pos=1 obj=0 op='NESTED LOOPS OUTER '
STAT #1 id=3 cnt=2815 pid=2 pos=1 obj=0 op='VIEW '
STAT #1 id=4 cnt=2815 pid=3 pos=1 obj=0 op='NESTED LOOPS OUTER '
STAT #1 id=5 cnt=100 pid=4 pos=1 obj=0 op='NESTED LOOPS '
STAT #1 id=6 cnt=100 pid=5 pos=1 obj=0 op='NESTED LOOPS '
=====================
PARSING IN CURSOR #2 len=116 dep=1 uid=0 oct=3 lid=0 tim=18446744070694916859 hv=189272129 ad='146e1308'
select o.owner#,o.name,o.namespace,o.remoteowner,o.linkname,o.subname,o.dataobj#,o.flags from obj$ o where o.obj#=:1
END OF STMT
PARSE #2:c=0,e=460,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=0,tim=18446744070694916853
BINDS #2:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=053b8ac8 bln=22 avl=04 flg=05
value=30312
EXEC #2:c=0,e=261,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=18446744070694917254
FETCH #2:c=0,e=27,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=18446744070694917315
STAT #1 id=7 cnt=100 pid=6 pos=1 obj=30312 op='TABLE ACCESS BY INDEX ROWID ASSETREFS '
STAT #1 id=8 cnt=101 pid=7 pos=1 obj=30382 op='INDEX RANGE SCAN ASSETREF_PARENTID '
BINDS #2:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=053b8ac8 bln=22 avl=04 flg=05
value=30307
EXEC #2:c=0,e=63,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=18446744070694917526
FETCH #2:c=0,e=13,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=18446744070694917564
STAT #1 id=9 cnt=100 pid=6 pos=2 obj=30307 op='TABLE ACCESS BY INDEX ROWID ASSETS '
STAT #1 id=10 cnt=100 pid=9 pos=1 obj=30405 op='INDEX UNIQUE SCAN PK_ASSETS '
BINDS #2:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=053b8ac8 bln=22 avl=04 flg=05
value=30313
EXEC #2:c=0,e=58,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=18446744070694917738
FETCH #2:c=0,e=11,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=18446744070694917773
STAT #1 id=11 cnt=100 pid=5 pos=2 obj=30313 op='TABLE ACCESS BY INDEX ROWID REVISIONS '
STAT #1 id=12 cnt=100 pid=11 pos=1 obj=30502 op='INDEX RANGE SCAN REVISIONBASE '
STAT #1 id=13 cnt=2815 pid=4 pos=2 obj=30410 op='INDEX RANGE SCAN PK_METADATA '
BINDS #2:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=053b8ac8 bln=22 avl=04 flg=05
value=30315
EXEC #2:c=0,e=58,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=18446744070694917965
FETCH #2:c=0,e=12,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=18446744070694918001
STAT #1 id=14 cnt=0 pid=2 pos=2 obj=30315 op='TABLE ACCESS BY INDEX ROWID METADATA '
STAT #1 id=15 cnt=0 pid=14 pos=1 obj=30410 op='INDEX UNIQUE SCAN PK_METADATA '

Similar Messages

  • Crystal Report is very slow to fetch the results of a Query used in Command

    Hello All,
    We have a query which is used in command object in Business Objects Crystal reports XI. This report is executed against IBM DB2 database. It is taking 40 min to getback the results. Here is the Query. Please suggest how can i improve the performance of this query in report as another reporting tool is taking 2-3 min time to fetch the results with the same query.
    SELECT
    A1.CARR_NUM ,  A1.CST_CTR_NUM ,A1.CLM_CLOSE_STS_CD ,   A1.CLM_RJCT_STS_CD ,A1.CLM_VOID_STS_CD ,  A1.PMT_MTCH_DT , A1.ASC_TRANS_TYP_CD ,  A1.DRUG_DESC ,               
    A1.BATCH_NUM ,   T5.TPA_RJCT_CD ,  A1.DIV_NUM , A1.INVC_NUM ,  A1.SERVICE_DT ,  A1.ACTL_REFILL_NUM ,  A1.CLM_DSPSN_CD ,  A1.INVC_RSBMT_CD , A1.TP_TOTAL_DUE_AMT ,  
    A1.INTL_BILG_MTHD_CD , A1.CARR_EOB_1_CD ,  T5.CARR_EOB_CD_DESC ,  A1.NTNL_DRUG_CD ,  A1.PTNT_FRST_NM ,  A1.PTNT_MDDL_INTL ,  A1.PTNT_LST_NM ,  A1.PTNT_BIRTH_DT ,
    A1.CRDHLDR_ID_NUM   
    FROM
    (SELECT DISTINCT
        T1.CARR_NUM ,  T1.CST_CTR_NUM ,  T1.CLM_CLOSE_STS_CD ,  T1.CLM_RJCT_STS_CD ,   T1.CLM_VOID_STS_CD ,  T3.PMT_MTCH_DT ,   
        T3.ASC_TRANS_TYP_CD ,  T2.DRUG_DESC ,  T4.BATCH_NUM , T1.DIV_NUM ,  T1.INVC_NUM ,  T1 . SERVICE_DT ,  T1.ACTL_REFILL_NUM ,                                         
        T1.CLM_DSPSN_CD ,  T1.INVC_RSBMT_CD ,T1.TP_TOTAL_DUE_AMT ,  T1.INTL_BILG_MTHD_CD ,T3.CARR_EOB_1_CD ,T1.NTNL_DRUG_CD ,  T2.PTNT_FRST_NM ,         T2.PTNT_MDDL_INTL , T2.PTNT_LST_NM ,  T2.PTNT_BIRTH_DT ,  T2.CRDHLDR_ID_NUM 
       FROM  
                    PDRD2LO.VINVC_CLM T1                             
                   , PDRD2LO.VPMNT_DTL T3                             
                   , PDRD2LO.VINVC_CLM_2 T2                           
                   , PDRD2LO.VINVC_ITM_PHARM  T4                     
                        WHERE  
      T1.CLM_CLOSE_STS_CD ='OP'                     
                  AND  T1.CLM_RJCT_STS_CD ='RJ'                       
                  AND  T1.CLM_VOID_STS_CD ='NV'                       
                  AND  T3.ASC_TRANS_TYP_CD ='40'                      
                  AND  T1.CARR_NUM = T3.CARR_NUM                      
               AND   T1.CST_CTR_NUM = T3.CST_CTR_NUM                  
               AND   T1.DIV_NUM = T3.DIV_NUM                          
               AND   T1.INVC_NUM = T3.INVC_NUM                        
               AND   T1.SERVICE_DT = T3.SERVICE_DT                    
               AND   T1.CLM_CTRL_NUM = T3.CLM_CTRL_NUM                
               AND   T1.ACTL_REFILL_NUM = T3.ACTL_REFILL_NUM          
               AND   T1.INVC_ITM_NUM = T3.INVC_ITM_NUM                
               AND   T1.REFILL_TRANS_NUM = T3.REFILL_TRANS_NUM        
               AND   T1.CARR_NUM = T2.CARR_NUM                        
               AND   T1.CST_CTR_NUM = T2.CST_CTR_NUM                  
               AND   T1.DIV_NUM = T2.DIV_NUM                          
               AND   T1.INVC_NUM = T2.INVC_NUM                        
               AND   T1.SERVICE_DT = T2.SERVICE_DT                  
               AND   T1.ACTL_REFILL_NUM = T2.ACTL_REFILL_NUM        
               AND   T1.CLM_CTRL_NUM = T2.CLM_CTRL_NUM              
               AND   T1.INVC_ITM_NUM = T2.INVC_ITM_NUM              
               AND   T1.REFILL_TRANS_NUM = T2.REFILL_TRANS_NUM      
               AND   T1.INVC_CTRL_NUM = T4.INVC_CTRL_NUM) A1        
    LEFT OUTER JOIN  PDRD2LO.VCARR_EOB T5                
                ON    A1.CARR_EOB_1_CD = T5.CARR_EOB_CD             
                AND   A1.CARR_NUM = T5.CARR_NUM                     
                AND   A1.DIV_NUM = T5.DIV_NUM        
    Thanks!

    Hi Zilla Eh ,
    Thanks for the reply.
    The another reporting tool name is impromptu and it takes 2-3 min , where in Crystal report is taking around 40 min. Please let me know if you any other questions.
    Regards
    Ravi

  • Fetching query result for editbox

    Hello to everyone. I just started developing Windows application (after 2 years pause). So, I'm working 'with' MFC Dialog based app.
    I want to fill combo box (or edit box it doesn't matter) with MySQL query result. I have these codes:
    void CConnectToMySQLDlg::OnWriteToDatabase()
    CString get, set;
    m_edit.GetWindowText(get);
    CT2CA temp_string(get);
    string s_get(temp_string);
    if (m_edit.GetWindowTextLength() != 0) // if you can please write this line better.
    MySQL_Driver *driver;
    Connection *dbConn;
    Statement *statement;
    ResultSet *result;
    driver = get_mysql_driver_instance();
    dbConn = driver->connect("tcp://127.0.0.1:3306", "root", "connection");
    dbConn->setSchema("world");
    statement = dbConn->createStatement();
    result = statement->executeQuery(s_get);
    //CStringArray comboArray;
    /*comboArray.Add(_T("bir"));
    comboArray.Add(_T("iki"));
    comboArray.Add(_T("uc"));
    comboArray.Add(_T("dord"));
    comboArray.Add(_T("bes"));
    comboArray.Add(_T("ffsfsfs"));
    comboArray.Add(_T("bfsfsfsdes"));
    comboArray.Add(_T("bczxczxes"));
    comboArray.Add(_T("aadafdsbes"));
    comboArray.Add(_T("zczxawfebes"));*/
    //comboMysql.ResetContent();
    string s_set = "string";
    set.Format(_T("%S"), s_set.c_str());
    while (result->next())
    // here how can I set edit box value?
    // So, how can I convert
    AfxMessageBox(L"dsadasd");
    delete result;
    delete statement;
    delete dbConn;
    else // handling user input
    AfxMessageBox(L"not allowed");
    I can get input stream and successfully(1) execute it but I don't know how to set its result(s).
    (1) --- In this case I entered this SQL line:
    select ID, Name from city where ID = 1 or ID = 2 or ID = 3 or ID = 4
    and it alerted me 4 times.
    p.s. If there any problematic codes please tell me the correct variant(s).
    Best regards,
    Mirjalal.

    I solved my problem. I pasted working codes below.
    void CmysqlDlg::OnBnClickedButton1()
    CString get, set, ComboString;
    edit.GetWindowText(get);
    CT2CA temp_string(get);
    std::string s_get(temp_string);
    if (edit.GetWindowTextLength() != 0) // if you can please write this line better.
    MySQL_Driver *driver;
    Connection *dbConn;
    Statement *statement;
    ResultSet *result;
    driver = get_mysql_driver_instance();
    dbConn = driver->connect("tcp://127.0.0.1:3306", "root", "connection");
    dbConn->setSchema("world");
    statement = dbConn->createStatement();
    result = statement->executeQuery(s_get); // executes the user "input"
    comboBox.ResetContent();
    // ofstream y("text.txt"); // actually i don't need this anymore :P
    while (result->next())
    string name_string = result->getString("Name"); // Name is the my tbl column name
    CString cs_name_string(name_string.c_str());
    comboBox.AddString(cs_name_string);
    delete result;
    delete[] result;
    delete statement;
    delete[] statement;
    delete dbConn;
    delete[] dbConn;
    else // handling user input
    AfxMessageBox(L"olmaz");
    Thanks.
    Mirjalal

  • How to ensure that the query results are fetched from the BW acclerator.

    Hi Experts,
    Suppose if i want to execute the query with BIA option, I can achieve it in RSRT .
    1)But is there some query settings or properties where we can make sure that whenever a query(say Q1) is executed, always the data should be fetched from the BIA index.
    2)Suppose the BIA indexing has failed due  to some reasons, will the data be fetched from the previously updated BIA index??
    regards
    akshay

    Hi man,
    1)But is there some query settings or properties where we can make sure that whenever a query(say Q1) is executed, always the data should be fetched from the BIA index.
    If you have built up BIA index on a cube, then every query on the cube or MultiProvider will automatically use BIA index. No additional settings required. You can use the following way to test whether a query is using BIA or not:
    Go to RSRT, input query name, click 'execute and debug' and check 'Display Statistics Data' and 'Do Not Use Cache'. Execute. After the query result press F3, now you should be able to see statistics. There's a tab 'BIA Access'. If you see something there then it means BIA index is used.
    2)Suppose the BIA indexing has failed due to some reasons, will the data be fetched from the previously updated BIA index??
    If BIA rollup is failed, then the last request(s) would not available in reporting and query will use BIA index for earlier requests. You can consider it like aggregate. But if initial fill of BIA failed then you would not be able to use BIA index.
    Regards,
    Frank
    Edited by: Frank Lee on Jul 14, 2009 2:22 PM

  • Query Results: Retrieve All Rows?

    I was looking for a feature that will allow me to choose to return "all records" to the Query Results window. The current behavior is to fetch 50 records at a time (e.g. fetch 50 records as you scroll through the results = s-l-o-w). What I'd like to do is "Retrieve All Rows" then use to the scroll bar to "smoothly" scroll to the last record. For example, the 8.0.6 version of Query Builder had this functionality and in SQL Developer 3.0, if I right-click on the results. I can choose to "Count Rows...", seems like this would be a perfect place to put a "Retrieve All Rows" option.

    Hi,
    My advice: do something only if there is a business case for it; satisfying your curiosity can get surprisingly expensive.
    You have already read about using Run Statement to execute a SQL statement, then Ctrl-End to auto-scroll to the end. You can try the same for Run Script, but first you will probably need to increase the value of Tools|Preferences|Database|Worksheet|Max rows to print in a script. Of course, taking either of these approaches slows things down due to displaying output and scrolling. Same with SQL*Plus. And, as mentioned previously, Java memory management in SQL Developer can cause slow downs and hangs if the result set is large enough.
    Here is a way to minimize that delay, avoid hangs, and get a more repeatable result:
    1) Save some query to, say, C:\Temp\AllCustomers.sql. For example, "select * from customers;" or "select id from customers;".
    2) Run it from a SQL Developer worksheet using Run Script (F5), or from the SQL*Plus command line, with a script like this:
    set timing on
    set termout off
    spool C:\Temp\AllCustomers.lst
    @C:\Temp\AllCustomers.sql
    spool offEven then you will see that the timing results will vary. Maybe "select *" runs much slower than "select id" because the logical output lines are long and get wrapped into multiple physical output lines in the file. Minimize that by setting linesize to a longer value (but only in SQL*Plus -- it isn't supported in SQL Developer) and repeat the test to see. Maybe SQL*Plus runs it much faster than SQL Developer because one is a command line environment and the other a GUI tool with more overhead. Or maybe the SQL Developer JVM is near its size limit and lots of Java garbage collection is slowing it down. Simple question, complicated answer.
    Regards,
    Gary
    SQL Developer Team
    P.S.: And if by chance you are using a version of SQL Developer so old it does not include the output time in the query result tab's toolbar, using Run Script with set timing on is your only recourse.
    Edited by: gggraham on Oct 27, 2011 4:54 PM

  • Large query result set

    Hi all,
    At the moment we have some java classes (not ejb - cmp/bmp) for search in
    our ejb application.
    Now we have a problem i.e. records have grown too high( millions ) and
    sometimes query results in retrieval of millions of records. It results in
    too much memory consumtion in our ejb application. What is the best way to
    address this issue.
    Any help will be highly appreciated.
    Thanks & regards,
    Parvez

    you can think of following options
    1) paging: read only few thousands at a time and maintain a index to page
    through complete dataset
    2) caching!
    a) you can create a serialized data file in server to cache the result set
    and can use that to browse through. you may do on the fly
    compression/uncompression while sending data to client.
    b) applet based solution where caching could be in client side. Look in
    http://www.sitraka.com/software/jclass/cs_ims.html
    thanks,
    Srinivas
    "chauhan" <[email protected]> wrote in message
    news:[email protected]...
    Thanks Slava Imeshev,
    We already have search criteria and a limit. When records exceeds thatlimit
    then we prompt user that it may take sometime, do you want to proceed? If
    he clicks yes then we retrieve those records. This results in lot ofmemory
    consumtion.
    I was thinking if there is some way that from database I can retrieve some
    block of records at a time rather the all records of a query. I wander how
    internet search sites work, where thousnds of sites/pages match criteriaand
    client can move back & front on any page.
    Regards,
    Parvez
    "Slava Imeshev" <[email protected]> wrote in message
    news:[email protected]...
    Hi chauhan,
    You may want to narrow search criteria along with processing a
    limited number of resulting records. I.e. if the size of the result
    is bigger than a limit, you stop fetching results and notify the client
    that search criteria should be narrowed.
    HTH.
    Regards,
    Slava Imeshev
    "chauhan" <[email protected]> wrote in message
    news:[email protected]...
    Hi all,
    At the moment we have some java classes (not ejb - cmp/bmp) for
    search
    in
    our ejb application.
    Now we have a problem i.e. records have grown too high( millions ) and
    sometimes query results in retrieval of millions of records. It
    results
    in
    too much memory consumtion in our ejb application. What is the best
    way
    to
    address this issue.
    Any help will be highly appreciated.
    Thanks & regards,
    Parvez

  • SSRS 2008 R2 is extremely slow. The query runs in less than a second in the dataset designer but if you try to view the report it takes over 10 minutes. I have read this is a bug in SSRS 2008 R2. We installed the most recent patches and service packs.

    SSRS 2008 R2 is extremely slow.  The query runs in less than a second in the dataset designer but if you try to view the report it takes over 10 minutes.  I have read this is a bug in SSRS 2008 R2.  We installed the most recent patches and
    service packs.  Nothing we've done so far has fixed it and I see that I'm not the only person with this problem.  However I don't see any answers either.

    Hi Kim Sharp,
    According to your description that when you view the report it is extremely slow in SSRS 2008 R2 but it is very fast when execute the query in dataset designer, right?
    I have tested on my local environment and can‘t reproduce the issue. Obviously, it is the performance issue, rendering performance can be affected by a combination of factors that include hardware, number of concurrent users accessing reports, the amount
    of data in a report, design of the report, and output format. If you have parameters in your report which contains many values in the list, the bad performance as you mentioned is an known issue on 2008 R2 and already have the hotfix:
    http://support.microsoft.com/kb/2276203
    Any issue after applying the update, I recommend you that submit a feedback at https://connect.microsoft.com/SQLServer/ 
    If you don’t have, you can do some action to improve the performance when designing the report. Because how you create and update reports affects how fast the report renders.
    Actually, the Report Server ExecutionLog2  view contains reports performance data. You could make use of below query to see where the report processing time is being spent:
    After you determine whether the delay time is in data retrieval, report processing, or report rendering:
    use ReportServer
    SELECT TOP 10 ReportPath,parameters,
    TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering,
    ByteCount, [RowCount],Source, AdditionalInfo
    FROM ExecutionLog2
    ORDER BY Timestart DESC
    Use below methods to help troubleshoot issues according to the above query result :
    Troubleshooting Reports: Report Performance
    Besides this, you could also follow these articles for more information about this issue:
    Report Server Catalog Best Practices
    Performance, Snapshots, Caching (Reporting Services)
    Similar thread for your reference:
    SSRS slow
    Any problem, please feel free to ask
    Regards
    Vicky Liu

  • How can I architect my data layer to yield query result pages to the application as SQL Server prepares them?

    I tried to make the question as explicit as possible.
    Refer to Sql Server Management Studio's Results view.  Depending upon the structure of the execution plan, the Results pane may begin displaying results while the query is still executing.  Can someone point me in a direction for architecting a
    data layer (I am tech and framework agnostic for this task. Any solution will suffice) that will begin receiving pages of the set before SQL Server has completed the entire query?
    The call from the data layer to SQL Server will obviously have to be asynchronous, but is there any additional ceremony that I need to be aware of when issuing OPTION (FAST x) to the query optimizer?

    Thanks for the reply. (I actually meant to put this in the SQL Data Access forum, not the T-SQL forum)
    "Generally the last step is ORDER BY in a
    query, so nothing can start before that executes."
    I would imagine you cannot ORDER BY and yield results as they are fetched because of the execution plan that would be generated.  For the purposes of this post, please assume that sorting will be done purely client side
    "Can you post your query?"
     For purposes of discussion, let's assume that the query is
    select *
    from information_schema.columns
    and also assume that you have "lots" of columns to display.
    This was an exploratory question to see what would be necessary to replicate the behavior of Management Studio's Query Result view in a custom application. 
    I would imagine that there's going to be a lot of analysis of the execution plans that get generated in order for the OPTION (FAST x) optimizer hint to do any good, but apart from general tuning concerns that would allow SQL SERVER to yield a page of data
    "fast", I was wondering if there was anything else required of the calling client to force it to yield return its first page.
    After thinking about this (and phrasing it the way I did in the last sentence) perhaps this is the incorrect forum for this question.  I imagine that my concerns are better addressed in forums dedicated to the technology of the calling client (which
    would be a .NET assembly)
    Be that as it may, if there is any ceremony that SQL Server imposes on clients in order to yield return, I would expect that my question would be in the scope of SQL Server discussions (even though I intended this to be in a different SQL Server forum)

  • 2.1EA2: Pinning Query Results and changing Connections [fixed in 2.1.0]

    I am on 2.1EA2 (JDK 1.6.0_16) and been playing with the new SQL Worksheet pin query results functionality. I have found that it is possible to run a query against one connection, pin the results and then change connection and run the same (or a different) query against another connection. I really like this, but found a few problems:
    #1 There doesn't seem to be any way to tell which connection a query result tab was actually run against
    #2 Even if all rows are fetched, if I then disconnect from the first connection it can get quite messy. Sometimes I get an empty connection dialog (I can't remember the exact title and it doesn't reproduce consistently) with only the close window X in the corner. Some times I get prompted to log in with a connection information dialog with no reference to the connection it is connecting to - cancelling only brings up the same dialog again until I successfully connect. Some times I get prompted to log in and while that is still on the screen, SQL Developer logs me back in to the connection (even though I don't save passwords) - I even get a new worksheet for the reconnected connection.
    theFurryOne

    Raghu,
    I am happy with both.
    #1 - I would be happy if the connection name was at the start of the tool-tip style pop-up when hovering over Query Results tab and the Query Result SQL dialog that opens on the SQL button. -K-'s suggestion makes it immediately obvious for the currently selected Query Results tab, without having to move the mouse or click on something.
    Ideally, I would like something similar for the other output tabs (ie Script Output), but they seem to show results for all connections that the worksheet has used, so the same concept may not work.
    #2 - I am used to the grid being cleared when disconnecting from earlier versions - I assumed that this was a bug where SQLD was not checking the connection of the results, just the current connection of the worksheet.
    theFurryOne

  • How to use SQL query result in DOS commands

    Hi
    Currently i am runnig below DOS commands manually
    d:\apps\bin>TrueGridsCalc period="Aug 2010"
    Now I want to write one batch file and schedule job on windows and make value of "period" to be dynamic. So to get that value i need to fetch it from DB
    Steps which i am taking are
    1. connect DB from command line (using SQLPLUS)
    2. run query to fetch result
    3.How to use query result in "period" parameter ?
    I am good at step 1 and 2. Dnt know how to use query result in command to make it dynamic
    Thank you
    Sachin
    Edited by: sachin.mali on Oct 26, 2010 4:39 PM
    Edited by: sachin.mali on Oct 26, 2010 4:43 PM

    sachin.mali wrote:
    Hi
    Currently i am runnig below DOS commands manually
    d:\apps\bin>TrueGridsCalc period="Aug 2010"
    Now I want to write one batch file and schedule job on windows and make value of "period" to be dynamic. So to get that value i need to fetch it from DB
    Steps which i am taking are
    1. connect DB from command line (using SQLPLUS)
    2. run query to fetch result
    3.How to use query result in "period" parameter ?
    I am good at step 1 and 2. Dnt know how to use query result in command to make it dynamic
    Thank you
    Sachin
    Edited by: sachin.mali on Oct 26, 2010 4:39 PM
    Edited by: sachin.mali on Oct 26, 2010 4:43 PMYOu'll have to have sqlplus spool the output to a file, then figure out some way of parsing that file. Too bad you're stuck with Windows. With any *nix you could do the file parsing with one line of code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • EJB Issue with return empty children in join fetch query

    I'm a newbie and still trying to learn all of the facets of EJB 3.0 (and other backend capabilities) however could not find this issue anywhere resolved.
    I have a recursive table which has a 0,1-n relationship with itself. In this case, I want to query for all objects and fetch the resulting children.
    To do this I have written the following query:
    select o from Node o inner join fetch o.childrenNodeList order by o.nodeorder
    If my database has the following entries:
    Parent
    Child
    Grandchild
    The above query will get all 3 and allow me to access the list of children through getChildrenNodeList, however, for Grandchild this returns "An attempt was made to traverse a relationship using indirection that had a null Session...." for Parent and Child however it works like it should and gets the fetched rows.
    Is there a way for me to either:
    1. Modify the query so that the getChildrenNodeList will return a 0 sized array (so I can test for no children)
    2. Modify the getter such that I can check that the parent really has no children and not some issue with the query
    Thanks for any help,
    Kris

    fixed

  • Fetch query data in ABAP

    Hi
    We are trying to execute a BW query using the RRW3_GET_QUERY_VIEW_DATA function module but when I test the function module I'm getting the data expected.
    My query is a simple query returning the cost center hierarchy that my authorizations give me access to). I fill the import parameters I_INFOPROVIDER and I_QUERY and leave I_VIEW_ID and I_T_PARAMETER empty. When I execute the function module I only get zeros in the E_CELL_DATA export parameter. The query works fine, when I execute it through the Query Analyzer.
    Any ideas what I might be doing wrong?
    We are using a BW 3.5 SP19
    Regards,
    Jacob Vennervald

    OK, I have found out that the reason I didn't get any data was that I didn't have any key figures in the query. This might sound strange but I'll try to explain.
    What I want to do is to create a query that will return the cost center hierarchy that a specific user has access to. This hierarchy is in the infoobject 0COSTCENTER and I though I could just make a query with this infoobject in it and then fetch the result of this query in ABAP using FM RRW3_GET_QUERY_VIEW_DATA, but apparently that is not possible.
    Is there another way to get contents of the infoobject into the query?
    Is there a way to fetch the contents of the infoobject from ABAP?
    Regards,
    Jacob

  • Search criterias in one page, the query results in another page?

    Hi, can I put search criterias in one page, and get query results in another page?
    Need help
    Thanks in advance
    karman

    If you meant a situation like: Page 1 has some items and page 2 has a report which refers page 1 itemsThen your report _query would fetch proper results provided the page 1 item values are available in the session_.
    That is, after submitting their values(using page submit,dynamic action,ajax etx) to session state , their values would be available in any page (anywhere in that session ) , until the page cache for the item page(page 1) is cleared.

  • Howto: Save prediction query results to relational table

    I believe saving prediction query results to relational tables is possible (the BI studio does it!). I am not clear on how to do this w/o the BI studio, which means if I write a DMX query and want to store its output to a relational table, how do I do it?
    Tips, anyone?
    Thanks!

    a) You can write some code do this on the client-side. Use ADOMD.NET in your C# app to execute the DMX query and fetch a data reader, open up another connection to your relational database and write rows of data to the second connection as you read them from the first.
    b) You can create a linked server to your Analysis Server instance in your SQL Server relational server instance and then execute a "SELECT * INTO <newtable> FROM OPENQUERY(<linkedserver>, <DMX query>)" T-SQL statement from your relational database connection.

  • Dropdown menue or selectlist from fetched SQL results

    Hello i try to build a selectlist or a dropdown menue from fetched Sql results i tryed many ways to realise this but nothing works is anybody here knowing how to do this?
    heres my code example but it isnt work:
    <?php
    if ($conn=OCILogon($HTTP_POST_VARS['user'], $HTTP_POST_VARS['pass'], $HTTP_POST_VARS['dienst'])) {
    echo "Successfully connected to Oracle.\n";
    OCILogoff($c);
    } else {
    $err = OCIError();
    echo "Oracle Connect Error " . $err[text];
    //fetch
    $stmt = OCIParse($conn,"select Table_Name from User_Tables");
    OCIExecute($stmt);
         while (OCIFetch($stmt))
         print "<select name="Rang">";     
         print "<option>$id</option>\n";
         print "</select>";
    OCILogoff($conn);
    ?>
    Message was edited by:
    LOD
    Message was edited by:
    LOD

    There's a basic error in your sample code. You query for table_name from user_tables, which basically just lists the tables that exist in your schema. Since you're using 'id' further on, I suspect your query would look something like 'select id from users'.
         while (OCIFetch($stmt))
         print "<select name="Rang">";     
         print "<option>$id</option>\n";
         print "</select>";
    }This won't work for 2 major reasons.
    1. the $id variable is not set to anything. Note that OCIFetch does not extract variables. You can retrieve them using OCIResult($stmt, 'id'). I myself prefer to use OCIFetchInto as it is much easier to use and gives code that is better readable:
    while (ocifetchinto($stmt, $record))
      print $record['ID'];
    }2. You've put the <select></select> code in your loop. I assume that you only want to loop options, so the <select></select> should be moved to outside the loop.

Maybe you are looking for

  • Unable to create new email from Gmail account in Mail

    I just installed gmail to retrieve messages within Mail: I can receive gmail messages and reply to gmail from Mail. However, I cannot create and send a new message in Mail using my gmail account; when I do I get the following error message: Enter Pas

  • Failure to Connect

    My old Airport Extreme base station quit, and I replaced it with a new one. I configured it with a Power Mac G5, using the same setup and passwords that I used before. Now I can access wi-fi using the base station with my Power Mac G5 and with an iBo

  • Work flow for posted invoice

    hi, I need to create a Workflow which gets triggered whenever an Invoice is posted and should be sending a mail to a specific agent two days before the clearing date, intimating him that the clearing date is nearing. I have used the Event IncomingInv

  • CR2008: BLOB field in preview crash the designer

    I using CR2008 with MSSQL 2008. I have create a table with some default values. On of them should be the compny logo. I have put company.jpg in the table to a BLOB-Column. To insert the BLOB-field a use a SQL-Statement: (SELECT ReportElements.ReportE

  • HELP! iWeb won't open-

    HELP! iWeb won't open- it says "Domain.sites" is invalid. The index.xml file is missing. And then immediately closes. can anyone help? thanks, s.