RSRT Performance Display SQL - Query has variables

I have a query with mandatory variables on Year and Period, which are built into my RKF's.  I am trying to run the query via RSRT to see the SQL, but I keep getting error, variables must have values.....I tried creating variant in RSRT, but it goes to some odd screen.

I do not get a prompt screen.  I go to RSRT,  Enter Query Name, next I Select Performance Info tab, then hit "Display SQL" button.  I get a message:  Specify a value for variable Posting Period (Single Value Entry, Mandatory)
I never get a prompt.  I am on BI 7.

Similar Messages

  • SQL Query with variable range

    Hi
      I want to give range to a user to enter in a variable through sql query . If there are 200 records , if user wants to display from 5-45 , 75-110 , 130-145. how it can be done through SQl Query
    Thanks
    Edited by: Matt on Aug 31, 2010 6:23 PM - modified title - please use a meaningful title in future

    Dear Saini,
    This query will allow you to choose the values only when you know them.
    SELECT T0.[DocEntry], T0.[ItemCode] FROM INV1 T0 WHERE T0.[LineNum] >[%0]   and T0.[LineNum] <[%1]
    If you run it in the query Generator in SAP Business One a little window will pop up and will ask you to choose the 2 variables.
    You can choose different variables every time you run it. At least you won't have to save many queries with different values.
    If you want 2 different groups, e.g. from 10 to 20 and from 30 to 40, then you can add another part in the where clause:
    SELECT T0.[LineNum], T0.[ItemCode], T0.[DocEntry] FROM INV1 T0 WHERE T0.[LineNum]  >= [%0] and  T0.[LineNum]  <= [%2] and T0.[LineNum]  >= [%4] or  T0.[LineNum]  <= [%6]
    Please, let me know if this query helps.
    Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Display SQL query in error text

    Using CFMX 6.1.
    Is it possible to get our error handler page to display the
    SQL query that fails and causes an error?
    If tried #error.sql# but it doesn't exist after a db
    exception. If I put a cftry around a particular query and then use
    cfcatch.sql within a cfcatch tag pair, it works fine. But given our
    error handler page is for the entire site, I can't use cfcatch, at
    least not the way the site is currently architected. I was hoping
    error.sql would work since my quick ref quide states that "Any
    cfcatch variable that applies to exception type can be accessed
    within the Error scope. But then it doesn't list Error.SQL or
    CFCATCH.SQL for that matter in any documentation I've seen, yet the
    later works in cfcatch tags.
    Any help would be appreciated.

    You don't have to place a CFTRY/CFCATCH around each query. I
    don't know how many pages you have in your application, but you
    could do something like the following:
    1. Replace <body> with <body><CFTRY>
    2. Replace </body> with the following
    <CFCATCH TYPE="database">
    <CFMODULE TEMPLATE="customErrorPage.cfm"
    sqlStatement="#CFCATCH.Sql# " message="#CFCATCH.message#">
    </CFCATCH>
    </CFTRY>
    </body>
    You can use a global search-and-replace utility, such as
    SR32, to make this task painless. Click
    here to go to the SR32
    site.

  • How to measure the performance of sql query?

    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i...
    It ll be useful for me to write efficient query....
    Thanks & Regards

    psram wrote:
    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i... You might want to start with a feature of SQL*Plus: The AUTOTRACE (TRACEONLY) option which executes your statement, fetches all records (if there is something to fetch) and shows you some basic statistics information, which include the number of logical I/Os performed, number of sorts etc.
    This gives you an indication of the effectiveness of your statement, so that can check how many logical I/Os (and physical reads) had to be performed.
    Note however that there are more things to consider, as you've already mentioned: The CPU bit is not included in these statistics, and the work performed by SQL workareas (e.g. by hash joins) is also credited only very limited (number of sorts), but e.g. it doesn't cover any writes to temporary segments due to sort or hash operations spilling to disk etc.
    You can use the following approach to get a deeper understanding of the operations performed by each row source:
    alter session set statistics_level=all;
    alter session set timed_statistics = true;
    select /* findme */ ... <your query here>
    SELECT
             SUBSTR(LPAD(' ',DEPTH - 1)||OPERATION||' '||OBJECT_NAME,1,40) OPERATION,
             OBJECT_NAME,
             CARDINALITY,
             LAST_OUTPUT_ROWS,
             LAST_CR_BUFFER_GETS,
             LAST_DISK_READS,
             LAST_DISK_WRITES,
    FROM     V$SQL_PLAN_STATISTICS_ALL P,
             (SELECT *
              FROM   (SELECT   *
                      FROM     V$SQL
                      WHERE    SQL_TEXT LIKE '%findme%'
                               AND SQL_TEXT NOT LIKE '%V$SQL%'
                               AND PARSING_USER_ID = SYS_CONTEXT('USERENV','CURRENT_USERID')
                      ORDER BY LAST_LOAD_TIME DESC)
              WHERE  ROWNUM < 2) S
    WHERE    S.HASH_VALUE = P.HASH_VALUE
             AND S.CHILD_NUMBER = P.CHILD_NUMBER
    ORDER BY ID
    /Check the V$SQL_PLAN_STATISTICS_ALL view for more statistics available. In 10g there is a convenient function DBMS_XPLAN.DISPLAY_CURSOR which can show this information with a single call, but in 9i you need to do it yourself.
    Note that "statistics_level=all" adds a significant overhead to the processing, so use with care and only when required:
    http://jonathanlewis.wordpress.com/2007/11/25/gather_plan_statistics/
    http://jonathanlewis.wordpress.com/2007/04/26/heisenberg/
    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/

  • SQL query has strange behavior on sql server 2014

    Hi All,
    I have a very weird situation where a front end entity framework query (cannot be modified easily) made up of SQL views that are used in subquery format. It generally runs within few seconds but there are times in the day when query just keep on going and
    sometimes start spitting results very slowly and at other times no result but keep on executing. Sysprocesses table shows sos_scheduler_yield wait type when query is running and not returning results. This behavior started on the query since the database was
    upgraded (migrated) from sql 2005 clustered enterprise instance to a new 2014 Enterprise clustered instance on a very powerful server.  This query is used by a batch process and what I have found that if we rebuild indexes on the database (takes
    only 2 mins) , the query appears to be returning results as expected. No other solution is working at the moment. The query had no issue on older sql 2005 instance and I have tested it their a few times. I am assuming it is a SQL 2014 related issue and found
    a fix on CU 5 for sos_scheduler_yield but it has not fixed the issue. At this point SQL 2014 is on latest CU 6 as of last week and index rebuilt wis the only viable work around to get the query going without interruption.
    Has anyone faced this issue on SQl 2014 or have some suggestions I can try. I can reproduce this error on at least two instances on SQL 2014. I have even tried setting max dop at server level to 1 and at half the total processors cores but to no avail. There
    is a 750GB memory on the box.
    Thanks
    dba60
    dba60

    First of all, SOS_SCHEDULER_YIELD has nothing to do with the query as such. SQL Server has a co-operative operating system, which means that processes voluntary yields to permit other threads to executes. This sends them to the wait state SOS_SCHEDULER_YIELD.
    If there is no other process executing, they are directly back in the game.
    The problems with your query is most likely to be an issue with the query plan. It is not uncommon to see plan changes when you move from one version of SQL Server to another because of changes in the optimizer.
    As Satish says, SQL 2014 has a new cardinality estimator (CE), which certainly can change the game. Check the compatibility level of the database. If the compat level is 120, you are using the new CE, else you are using the old one.
    If the level is 120, the first check is to change it to 110 to see if this has any effect. 
    But in the end you will have to work more with the query. Analyse it to see if it can be improved by adding indexes. You say said that this query generated by Entity Framework. Unfortunately, this is an indiciation of that the query is not the best and could
    serve from a rewrite.
    The ultimate rescue would be to freeze the plan when it runs well. I have some text about this here:
    http://www.sommarskog.se/query-plan-mysteries.html#planguides
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Data Display -- SQL Query?

    Hi
    This might be simple but, I have no idea.. how to achieve this via a simple SQL Query..
    Data in a column :
    1
    5
    6
    15
    25
    30
    35
    Should do a SELECT showing like this..
    1 5
    6 15
    25 30
    35 NULL
    Thanks!

    create table t1
    (numcol     number);
    insert into t1 values(1);
    insert into t1 values(5);
    insert into t1 values(6);
    insert into t1 values(15);
    insert into t1 values(25);
    insert into t1 values(30);
    insert into t1 values(35);
    commit;
    select odds.numcol, evens.numcol
    from
       select numcol
             ,row_number() over (order by numcol) rn
       from
          select numcol
                ,row_number() over (order by numcol) rn
          from   t1
       where mod(rn,2) <> 0
    )  odds
       select numcol
             ,row_number() over (order by numcol) rn
       from
          select numcol
                ,row_number() over (order by numcol) rn
          from   t1
       where mod(rn,2) = 0
    )  evens
    where odds.rn = evens.rn (+);
                  NUMCOL               NUMCOL
                       1                    5
                       6                   15
                      25                   30
                      35

  • Performance issues with query input variable selection in ODS

    Hi everyone
    We've upgraded from BW 3.0B to NW04s BI using SP12.
    There is a problem encountered with input variable selection. This happens regardless of using BEx (new or old 3.x) or using RSRT. When using the F4 search help (or "Select from list" in BEx context) to list possible values, this takes forever for large ODS (containing millions of records).
    Using ST01 and SM50 to trace the code in the same query, we see a difference here:
    <u>NW04s BI SQL command</u>
    SELECT                                                                               
    "P0000"."COMP_CODE" AS "0000000032" ,"T0000"."TXTMD" AS "0000000032_TXTMD"                             
    FROM                                                                               
    ( "/BI0/PCOMP_CODE" "P0000" ) LEFT OUTER JOIN "/BI0/TCOMP_CODE" "T0000" ON  "P0000"."COMP_CODE" = "T0000
      "."COMP_CODE"                                                                               
    WHERE                                                                               
    "P0000"."OBJVERS" = 'A' AND "P0000"."COMP_CODE" IN ( SELECT "O"."COMP_CODE" AS "KEY" FROM              
      "/BI0/APY_PP_C100" "O" )                                                                               
    ORDER BY                                                                               
    "P0000"."COMP_CODE" ASC#                                                                               
    <u>BW 3.0B SQL command:</u>
    SELECT ROWNUM < 500 ....
    In 3.0B, rownum is limited to 500 and this results in a speedy, though limited query. In the new NW04s BI, this renders the selection screen unusable as ABAP dumps for timing out will occur first due to the large data volume searched using sequential read.
    It will not be feasible to create indexes for every single query selection parameter (issues with oerformance when loading, space required etc.). Is there a reason why SAP seems have fallen back on a less effective code for this?
    I have tried to change the number of selected rows to <500 in BEx settings but one must reach a responsive screen in order to get to that setting and it is not always possible or saved for the next run.
    Anyone with similar experience or can provide help on this?

    here is a reason why the F4 help on ODS was faster in BW 3.x.
    In BW 3.x the ODS did not support the read mode "Only values in
    InfoProvider". So If I compare the different SQL statements I propose
    to change the F4 mode in the InfoProvider specific properties to
    "About master data". This is the fastest F4 mode.
    As an alternative you can define indexes on your ODS to speed up F4.
    So would need a non-unique index on InfoObject 0COMP_CODE in your ODS
    Check below for insights
    https://forums.sdn.sap.com/click.jspa?searchID=6224682&messageID=2841493
    Hope it Helps
    Chetan
    @CP..

  • Tuning (SQL Query has radically different Buffer GETS in each instance)

    I have been noticing that on Node2 of my 10.2.0.3 RAC cluster CPU has been running 90% for the past couple of days and on Node1 we are at the normal 20-30%. I was comparing AWR for both instances and noticed that the same exact SQL was showing different GETS on each instance.
    Both Instances are configured exactly the same. SGA 3GB, 2 dual core 1.5Ghz CPU on Solaris 10.
    AWR For Node 1
    SQL ordered by Gets
    Resources reported for PL/SQL code includes the resources used by all SQL statements called by the code.
    Total Buffer Gets: 8,199,224
    Captured SQL account for 94.2% of Total
    Buffer Gets  Executions  Gets per Exec  %Total CPU Time (s) Elapsed Time (s) SQL Id SQL Module SQL Text
    4,834,470 16,465 293.62 58.96 442.34 459.42 cs3w0nz7uanhc    BEGIN HRW_EC_QUERY.CHECK_STUDE...
    4,561,082 16,469 276.95 55.63 411.10 430.16 6vbpbvfburc4x    SELECT COUNT(SECURE_PROGRAMS.P... AWR For Node 2
    Buffer Gets  Executions  Gets per Exec  %Total CPU Time (s) Elapsed Time (s) SQL Id SQL Module SQL Text
    219,779,881 9,306 23,617.01 99.26 11791.62 32202.99 cs3w0nz7uanhc    BEGIN HRW_EC_QUERY.CHECK_STUDE...
    219,320,634 9,302 23,577.79 99.05 11760.22 32137.23 6vbpbvfburc4x    SELECT COUNT(SECURE_PROGRAMS.P... Gets on Node 2 are about 45 times what they are on node 1. We are using bind variables in the SQL. The statements are completely identical. Anyone seen this before?
    Thanks,
    Brian

    All parameters are the same between instances. Here is the result of the query.
    PLAN_TABLE_OUTPUT                                                                                                                          
    SQL_ID 6vbpbvfburc4x                                                                                                                       
    SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID                                      
    FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =                                       
    T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND                                                             
    SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2                                                                                                
    Plan hash value: 25280318                                                                                                                  
    | Id  | Operation                           | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |                          
    |   0 | SELECT STATEMENT                    |                           |       |       |   730 (100)|          |                          
    |   1 |  SORT AGGREGATE                     |                           |     1 |    57 |            |          |                          
    |   2 |   HASH JOIN                         |                           |   116 |  6612 |   730   (1)| 00:00:09 |                          
    |   3 |    COLLECTION ITERATOR PICKLER FETCH|                           |       |       |            |          |                          
    |   4 |    NESTED LOOPS                     |                           | 48596 |  2610K|   705   (1)| 00:00:09 |                          
    |   5 |     INDEX RANGE SCAN                | SECURE_PROGRAMS_IDX_04    |     4 |    76 |     2   (0)| 00:00:01 |                          
    |   6 |     INDEX RANGE SCAN                | HRW_EC_ACTIVE_ITEM_IDX_03 | 10984 |   386K|   176   (1)| 00:00:03 |                          
    Query Block Name / Object Alias (identified by operation id):                                                                              
       1 - SEL$62A3881B                                                                                                                        
       5 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1                                                                                                
       6 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1                                                                                             
    SQL_ID 6vbpbvfburc4x                                                                                                                       
    SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID                                      
    FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =                                       
    T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND                                                             
    SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2                                                                                                
    Plan hash value: 219484150                                                                                                                 
    | Id  | Operation                            | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |                         
    |   0 | SELECT STATEMENT                     |                           |       |       |  4845 (100)|          |                         
    |   1 |  SORT AGGREGATE                      |                           |     1 |    57 |            |          |                         
    |   2 |   HASH JOIN                          |                           |  2066 |   115K|  4845   (2)| 00:00:59 |                         
    |   3 |    INDEX RANGE SCAN                  | SECURE_PROGRAMS_IDX_04    |    79 |  1501 |     2   (0)| 00:00:01 |                         
    |   4 |    HASH JOIN                         |                           |  3284 |   121K|  4843   (2)| 00:00:59 |                         
    |   5 |     COLLECTION ITERATOR PICKLER FETCH|                           |       |       |            |          |                         
    |   6 |     INDEX FAST FULL SCAN             | HRW_EC_ACTIVE_ITEM_IDX_03 |  1373K|    47M|  4803   (2)| 00:00:58 |                         
    Query Block Name / Object Alias (identified by operation id):                                                                              
       1 - SEL$62A3881B                                                                                                                        
       3 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1                                                                                                
       6 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1                                                                                             
    Note                                                                                                                                       
       - SQL profile "SYS_SQLPROF_014414387fd00001" used for this statement                                                                    
    SQL_ID 6vbpbvfburc4x                                                                                                                       
    SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID                                      
    FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =                                       
    T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND                                                             
    SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2                                                                                                
    Plan hash value: 740005210                                                                                                                 
    | Id  | Operation                           | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |                          
    |   0 | SELECT STATEMENT                    |                           |       |       |  4845 (100)|          |                          
    |   1 |  SORT AGGREGATE                     |                           |     1 |    57 |            |          |                          
    |   2 |   HASH JOIN                         |                           |     7 |   399 |  4845   (2)| 00:00:59 |                          
    |   3 |    COLLECTION ITERATOR PICKLER FETCH|                           |       |       |            |          |                          
    |   4 |    HASH JOIN                        |                           |  2992 |   160K|  4821   (2)| 00:00:58 |                          
    |   5 |     INDEX RANGE SCAN                | SECURE_PROGRAMS_IDX_04    |    33 |   627 |     2   (0)| 00:00:01 |                          
    |   6 |     INDEX FAST FULL SCAN            | HRW_EC_ACTIVE_ITEM_IDX_03 |  1373K|    47M|  4803   (2)| 00:00:58 |                          
    Query Block Name / Object Alias (identified by operation id):                                                                              
       1 - SEL$62A3881B                                                                                                                        
       5 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1                                                                                                
       6 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1                                                                                             
    Note                                                                                                                                       
       - SQL profile "SYS_SQLPROF_014414387fd00001" used for this statement                                                                    
    SQL_ID 6vbpbvfburc4x                                                                                                                       
    SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID                                      
    FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =                                       
    T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND                                                             
    SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2                                                                                                
    Plan hash value: 1418188916                                                                                                                
    | Id  | Operation                           | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |                          
    |   0 | SELECT STATEMENT                    |                           |       |       |  2136 (100)|          |                          
    |   1 |  SORT AGGREGATE                     |                           |     1 |    57 |            |          |                          
    |   2 |   HASH JOIN                         |                           |     3 |   171 |  2136   (1)| 00:00:26 |                          
    |   3 |    NESTED LOOPS                     |                           |  1103 | 60665 |  2111   (1)| 00:00:26 |                          
    |   4 |     INDEX RANGE SCAN                | SECURE_PROGRAMS_IDX_04    |    12 |   228 |     2   (0)| 00:00:01 |                          
    |   5 |     INDEX RANGE SCAN                | HRW_EC_ACTIVE_ITEM_IDX_03 | 10984 |   386K|   176   (1)| 00:00:03 |                          
    |   6 |    COLLECTION ITERATOR PICKLER FETCH|                           |       |       |            |          |                          
    Query Block Name / Object Alias (identified by operation id):                                                                              
       1 - SEL$62A3881B                                                                                                                        
       4 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1                                                                                                
       5 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1      Thanks,
    Brian

  • Displaying SQL Query results in rows instead of Columns

    Hi,
    I'm fairly new to Oracle so forgive me if this is a really stupid question.
    I used Mysql for a while and if I wanted to display query results in rows instead of columns I could end the SQL command with '\G' instead of a semicolon.
    This would give me output like...
    Column_1: AAAA
    Column_2: BBBB
    Column_3: CCCC
    Instead of the normal
    Column_1 Column_2 Column_3
    AAAAAA BBBBBBB CCCCCCC
    Is there an equivalent in SQLPlus to the MySQL \G termination?
    Thanks.
    John

    > so forgive me if this is a really stupid question.
    It is certainly not a stupid question, but pivoting is a very frequently asked and answered question:
    [url http://forums.oracle.com/forums/search.jspa?threadID=&q=pivot&objID=f75&dateRange=all&userID=&numResults=15]http://forums.oracle.com/forums/search.jspa?threadID=&q=pivot&objID=f75&dateRange=all&userID=&numResults=15
    In 11g you have special PIVOT and UNPIVOT functions.
    Regards,
    Rob.

  • Display Sql query result

    i have a c++ form that accepts data and saves it on a table in a database via a button click, this is the code for the eventprivate: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    String^ constring=L"datasource=localhost;port=3306;username=root;password=lampard";
    MySqlConnection^ conDatabase=gcnew MySqlConnection(constring);
    MySqlCommand^ cmdDatabase=gcnew MySqlCommand("insert into test.Data(Full_Name,Matric_No) values('"+this->textBox1->Text+"','"+this->textBox10->Text+"') ;" ,conDatabase);
    MySqlDataReader^ myReader;
    try{
    conDatabase->Open();
    myReader=cmdDatabase->ExecuteReader();
    MessageBox::Show("Saved");
    while(myReader->Read()){
    }catch(Exception^ex){
    MessageBox::Show(ex->Message);
    NOW i want to send a query to give out this information in a new form or in a form exactly like the one used to enter the data, this is how far i have come
    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    this->Hide();
    MyForm ^ Form = gcnew MyForm(this);
    Form->ShowDialog();
    String^ constring=L"datasource=localhost;port=3306;username=root;password=lampard";
    MySqlConnection^ conDatabase=gcnew MySqlConnection(constring);
    MySqlCommand^ cmdDatabase=gcnew MySqlCommand("Select * from test.Data where Matric_No='"+textBox1->Text +"';",conDatabase);
    MySqlDataReader^ myReader;
    try{
    conDatabase->Open();
    myReader=cmdDatabase->ExecuteReader();
    while(myReader->Read()){
    textBox1->Text ;
    }catch(Exception^ex){
    MessageBox::Show(ex->Message);
    NOte: MyForm is the title of the form used to enter in the data sent to the database please how do i get the program to display the data meeting the query criteria into a form?

    i made textBox1 a public memeber of MyForm class and i changed  
    Form->ShowDialog(); to Form->Show() and i entered the code you advised me to and it displayed the result.i am very grateful, thank you

  • WRH$** tables, Need to know by which user SQL Query has been executed

    Hi,
    From the AWR data (WRH$) tables , I need to know how many sql code is using some specific indexes, I found that information by using the mentioned code. but I need to find out by which user this code has been executed ( not the PARSING_SCHEMA_NAME). Can someone please help me, how can I get that info?
    select a.operation,a.OBJECT_OWNER,a.OBJECT_NAME ,dbms_lob.substr(b.SQL_TEXT,4000,1) from WRH$_SQL_PLAN a,WRH$_SQLTEXT b
    where a.operation='INDEX' and a.SNAP_ID=b.SNAP_ID and a.SQL_ID=b.SQL_ID and a.OBJECT_NAME in (
    'I_CUSTORDER_STAT_CHG_DTM',
    'I_LINE_ITEM_STAT_CHG_DTM',
    'I_SHOPCART_MODIFIEDDTM',
    'I_VISITOR_CART_UPDATED_DTM',
    'R_ORDER_LOG_EVENT_DTM',
    'I_LI_STATUS_HISTORY_EVENT_DTM',
    'I_SHOPPING_CART_CREATEDDTM',
    'I_VISITOR_CART_CREATED_DTM',
    'I_LINE_ITEM_CREATED_DTM_FTM')

    872903 wrote:
    Hi,
    From the AWR data (WRH$) tables , I need to know how many sql code is using some specific indexes, I found that information by using the mentioned code. but I need to find out by which user this code has been executed ( not the PARSING_SCHEMA_NAME). Can someone please help me, how can I get that info?
    select a.operation,a.OBJECT_OWNER,a.OBJECT_NAME ,dbms_lob.substr(b.SQL_TEXT,4000,1) from WRH$_SQL_PLAN a,WRH$_SQLTEXT b
    where a.operation='INDEX' and a.SNAP_ID=b.SNAP_ID and a.SQL_ID=b.SQL_ID and a.OBJECT_NAME in (
    'I_CUSTORDER_STAT_CHG_DTM',
    'I_LINE_ITEM_STAT_CHG_DTM',
    'I_SHOPCART_MODIFIEDDTM',
    'I_VISITOR_CART_UPDATED_DTM',
    'R_ORDER_LOG_EVENT_DTM',
    'I_LI_STATUS_HISTORY_EVENT_DTM',
    'I_SHOPPING_CART_CREATEDDTM',
    'I_VISITOR_CART_CREATED_DTM',
    'I_LINE_ITEM_CREATED_DTM_FTM')consider enabling AUDIT SELECT FROM TABLE upon which INDEX is based.

  • Performance tuning sql query

    Hi,
    Can anyone assist me in tuning the below query
    Thanks in Advance
    A.Gopal
    SELECT nvl(sum(p.GRP_ACTUALQUANTITY),0)                
    FROM GOODSRECEIPTS r, GOODSRECEIPTPOSITIONS p
    ,reportparameters plt,reportparameters spl,reportparameters mat
    WHERE r.GRH_NO = p.GRP_GRH_NO
    AND TRUNC(r.GRH_ARRIVAL) BETWEEN NVL(TO_DATE('01-jan-09'), TRUNC(r.GRH_ARRIVAL)) AND NVL(TO_DATE('31-jan-09'), TRUNC(r.GRH_ARRIVAL))
    AND (p.GRP_PLT_ID = 'VDN' OR 1 =0)
    AND (r.GRH_SPL_ID = '15035122' OR 1 =0)
    AND (p.GRP_MAT_ID = '1001360' OR 1 =0)
    AND ('01.01.2009' = 'TOTAL' or trunc(r.GRH_ARRIVAL,'mm') = to_date('01.01.2009','dd.mm.yyyy'))
                             and plt.rep_field = 'PLT_ID' AND plt.rep_id = 'AN_EXC_RAT' AND plt.rep_user = 'ANANTGOP'      
                        and spl.rep_field = 'SPL_ID' AND spl.rep_id = 'AN_EXC_RAT' AND spl.rep_user ='ANANTGOP'
                        and mat.rep_field = 'MAT_ID' AND mat.rep_id = 'AN_EXC_RAT' AND mat.rep_user = 'ANANTGOP'
                        and r.GRH_SPL_ID = decode(spl.rep_value,'All',r.GRH_SPL_ID,spl.rep_value)
                        and p.GRp_plt_ID = decode(plt.rep_value,'All',p.GRp_plt_ID,plt.rep_value)
                   and p.GRp_mat_ID = decode(mat.rep_value,'All',p.GRp_mat_ID,mat.rep_value)
    AND NOT EXISTS (SELECT 1 FROM GOODSRECEIPTUSAGESTATUS u
    WHERE p.GRP_GRH_NO = u.GRU_GRP_GRH_NO
    AND p.GRP_NO =u.GRU_GRP_NO
    AND u.GRU_UST_ID = 'CANCEL')

    This query is used in my Oracle report. The original query is like beow
         SELECT nvl(sum(p.GRP_ACTUALQUANTITY),0)                
    FROM GOODSRECEIPTS r, GOODSRECEIPTPOSITIONS p
    ,reportparameters plt,reportparameters spl,reportparameters mat
    WHERE r.GRH_NO = p.GRP_GRH_NO
    AND TRUNC(r.GRH_ARRIVAL) >= NVL(:l_date_from, TRUNC(r.GRH_ARRIVAL)) AND
              TRUNC(r.GRH_ARRIVAL) <=NVL(:l_date_to, TRUNC(r.GRH_ARRIVAL))
    AND (p.GRP_PLT_ID = :p_plt_id OR :ip_plt_group =0)
    AND (r.GRH_SPL_ID = :p_spl_id OR :ip_spl_group =0)
    AND (p.GRP_MAT_ID = :p_mat_id OR :ip_mat_group =0)
    AND (:l_flag = 'TOTAL' or trunc(r.GRH_ARRIVAL,'mm') = to_date(:p_month_abc_sp,'dd.mm.yyyy'))
                             and plt.rep_field = 'PLT_ID' AND plt.rep_id = :ip_rep_id AND plt.rep_user = :ip_rep_user      
                        and spl.rep_field = 'SPL_ID' AND spl.rep_id = :ip_rep_id AND spl.rep_user = :ip_rep_user
                        and mat.rep_field = 'MAT_ID' AND mat.rep_id = :ip_rep_id AND mat.rep_user = :ip_rep_user     
                        and r.GRH_SPL_ID = decode(spl.rep_value,'All',r.GRH_SPL_ID,spl.rep_value)
                        and p.GRp_plt_ID = decode(plt.rep_value,'All',p.GRp_plt_ID,plt.rep_value)
                   and p.GRp_mat_ID = decode(mat.rep_value,'All',p.GRp_mat_ID,mat.rep_value)
    AND NOT EXISTS (SELECT 1      
                                            FROM GOODSRECEIPTUSAGESTATUS u
                                            WHERE p.GRP_GRH_NO = u.GRU_GRP_GRH_NO
                        AND p.GRP_NO =u.GRU_GRP_NO
                                                                AND u.GRU_UST_ID = 'CANCEL');
    :ip_rep_id = 'AN_EXC_RAT'
    :ip_rep_user = 'ANANTGOP
    Value of :l_flag = '01.01.2009'
    (:p_month_abc_sp = '01.01.2009'
    Thanks
    A.Gopal

  • Need some guidance - SQL Query Bind Variables for VO Object

    Hi,
    I'm trying to customize a custom page and I'm new to this. Can you please guide me or send me an example on how to do this?
    1) VO is having the query as "SELECT INVOICE_NUM, INVOICE_DATE, INVOICE_AMOUNT, ...... from AP_INVOICES_ALL" (no parameters in the where clause)
    2) Added VO to AM
    3) XML PG is designed with MainRN, QueryRN, and Instance of VO1 as Table region. Selected INVOICE_NUM, INVOICE_DATE as Searchable. QueryRN is ResultbasesSearch.
    4) Deployed to E-Biz and users were able to query using INVOICE_NUM or INVOICE_DATE fields that are available in the QueryRN.
    Now, they want to add FROM_INVOICE_DATE and TO_INVOICE_DATE to the Search Condition. So, I have added the condition in the VO Query as "SELECT INVOICE_NUM, INVOICE_DATE, INVOICE_AMOUNT, ...... from AP_INVOICES_ALL WHERE INVOICE_DATE between :0 and :1".
    How to add these fields FROM_INVOICE_DATE and TO_INVOICE_DATE to the QueryRN? These are not part of VO.
    How to bind them to :0 and :1? I don't see any controller here? Do I need set a new controller and write logic for getting result set?
    Any sample script or link would really help.
    Thanks in advance.
    Ram

    Hi Ram,
    Hmmm, it is interesting.
    Add two attributes to the page fromDate and toDate and in the controller class capture the values (like String fromDate = pageContext.getParameter("FromDate");) and invoke a method from AM and pass these parameters.
    In the AM method call a method of VO and the VOImpl set and pass the bind parameters and execute the query again.
    like
    setWhereClause(" from_date = :1 AND to_date = :2");
    setWhereClauseParams(null); // Always reset
    setWhereClauseParam(0, fromDate);
    setWhereClauseParam(1, toDate);
    executeQuery();
    Hope this will answer your question.
    Krishna.

  • Displaying SQL query results in tabular fashion

    Hi,
    I've a table having following three fields."Market segment","Status","No of Cust".
    This table contains the name of market segment, name of user status(4 in no) and number of customers belonging to that status.
    I need to create a query that will show the result in a tabular manner.like the following
    Market segment.....status1.....status2........status3.......Total
    MS1...................... 5..............6............... 7................18
    ms2........................1..............6................8...............15
    Total.......................x..............y.................z................T
    (Ignore the dots(.))
    Can some one help me with the query?
    Thanks,
    jajati

    See this link:
    http://tonyandrews.blogspot.com/2004/10/pivot-queries.html

  • Performance of Sql query

    Hi,
    Is Insert (or) Update which one is faster. can any one explain breifly?

    There is no meaning in this comparison..
    You cannot replace INSERT with UPDATE or vice verse..
    It is like comparing screw driver and hammer..They are designed for different purposes, and they are fit for what they are supposed to do.
    Anyhow, you may say UPDATE is costly - Logically in case of UPDATE you need to hold OLD and NEW values. But in INSERT it is only new values..

Maybe you are looking for

  • HT5361 I can no longer scroll with my mouse up or down through my email messages?

    Never had this problem before and it only happens while I am in mail.

  • Error in reports 10g

    Hi, I developed a report in reports developer 10g. Is running well in reports developer, but when i run this report in apps 11i it says REP-1219: 'Margin' has no size -- length or width is zero. What is the issue.

  • DomHandle can not fetch special characters like , or &......

    hi friends...... I'm using following packages........... When I store special characters....like < , > or &......DomHandle can not fetch the values from xml file......why so??? Anybody faced same problem?????? import javax.xml.transform.*; import jav

  • MacBook Pro suddenly running very slowly

    Hi, My MacBook Pro usually runs quite fast, but since last night, it's been so slow. I was watching BBC One live online and it just froze, so I restarted the mac and the speed of everything is now silly. Even doing things such as opening a new tab or

  • Catalog(Punchout) Vendor

    Hi, We have a Punchout Vendor, where the shopping cart is eligible for free shipping if it is 10$, less than 10$, no free shipping, Our requirement is if the user submits a shopping cart less than 10$, it should not submit and instead it should show