Problem in design the sql query

Hi,
I have following requirement on sql
table 1 time and table 2 person entry in class room
time date column
entries time date column
tab1 tab2
time room no entries_time
09:00 1 09:00
09:15 1 09:15
09.30 null null
09:45 null null
10.00 null null
I want to display last entry time for every time column, i mean output like
time room no entries_time
09:00 1 09:00
09:15 1 09:15
09.30 1 09:15
09:45 1 09:15
10.00 1 09:15
10.15 1 09:15
10.30 1 09:15
Regards,
Ram

CREATE TABLE "TAB1"
("REF_TIME" DATE NOT NULL ENABLE
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.00.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.01.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.02.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.03.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.04.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.05.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.06.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.07.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.08.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.09.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.10.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.11.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.12.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.13.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.14.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.15.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.16.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.17.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.18.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.19.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.20.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.21.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB1 (REF_TIME) values (to_date('25-JUN-2012 12.22.00 AM','DD-MON-YYYY HH.MI.SS AM'));
commit;
CREATE TABLE "TAB2"
("ROOM_NO" NUMBER, "TIME" DATE NOT NULL ENABLE
Insert into TAB2 (ROOM_NO,TIME) values (1,to_date('25-JUN-2012 12.00.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB2 (ROOM_NO,TIME) values (1,to_date('25-JUN-2012 12.02.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB2 (ROOM_NO,TIME) values (1,to_date('25-JUN-2012 12.03.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB2 (ROOM_NO,TIME) values (1,to_date('25-JUN-2012 12.04.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB2 (ROOM_NO,TIME) values (1,to_date('25-JUN-2012 12.10.00 AM','DD-MON-YYYY HH.MI.SS AM'));
Insert into TAB2 (ROOM_NO,TIME) values (1,to_date('25-JUN-2012 12.15.00 AM','DD-MON-YYYY HH.MI.SS AM'));
commit;
output need in this format
12.00.00 AM     1     12.00.00 AM
12.01.00 AM     1     12.00.00 AM
12.02.00 AM     1     12.02.00 AM
12.03.00 AM     1     12.03.00 AM
12.04.00 AM     1     12.04.00 AM
12.05.00 AM     1     12.04.00 AM
12.06.00 AM     1     12.04.00 AM
12.07.00 AM     1     12.04.00 AM
12.08.00 AM     1     12.04.00 AM
12.09.00 AM     1     12.04.00 AM
12.10.00 AM     1     12.10.00 AM
12.11.00 AM     1     12.10.00 AM
12.12.00 AM     1     12.10.00 AM
12.13.00 AM     1     12.10.00 AM
12.14.00 AM     1     12.10.00 AM
12.15.00 AM     1     12.15.00 AM
12.16.00 AM     1     12.15.00 AM
12.17.00 AM     1     12.15.00 AM
12.18.00 AM     1     12.15.00 AM
12.19.00 AM     1     12.15.00 AM
12.20.00 AM     1     12.15.00 AM
12.21.00 AM     1     12.15.00 AM
12.22.00 AM     1     12.15.00 AM
Thanks

Similar Messages

  • How to view the sql query generated in query designer..?

    Hi experts,
       Can i view the sql query generated by the query designer for a query in sap bw?
    regards,
    ksvsivam

    Hi Sivam,
    You can definitely view the sql query.
    Go to RSRT and give the report name. Then goto Execute+Debug and click on it.
    A new window will open, there tick the box  Display SQL/BIA Query and the press on the ok button.
    Finally click on execute. The Sql query will be displayed.
    Hope this helps.
    Thanks,
    Rahul

  • The SQL query is not executing

    Hi
    I have the following situation: In a project we designed our reports calling a stored procedure the exits in a MS SQL Server 200 database. The Stored Procedures works fine and when they are used in the report everything works perfectly.
    The reports are being made with CR DEsigner 11, when the designer ends them, ha pass them to me and we put them in our java web application. I open them and even preview them since the Crystal Reprots Perspective of Eclipse and I can see the data, so everything to this point is OK.
    The problem comes when I change of connection, I'm trying to connect every report to the same host and database, and when the reprot is displayed in the browser there is no data. I profile the SQL commands that are executed when the report is requested and I found that the reprot is not executing the stored procedure.
    I guess because i'm connectring the report to the same database and host that was used when the report is created and i'm also passing exactly the same parameters of the stored procedure, then report thinks that it doesn't have executing again becuase it will be the same information.
    SO, i wonder if there is a way to request to the report to execute the sql query every time i have to display it.
    thanks for any help.

    What happens when you try to view the report using a simple viewer.jsp?without changing the connection?
    2009-05-25 14:06:09,250 ERROR com.businessobjects.reports.sdk.JRCCommunicationAdapter -  detected an exception: Error de conexión: [SQLServer 2000 Driver for JDBC]Error establishing socket.
    But the database server is ok, so i think the rpt needs more information to be connect to the database.
    Also what happens if you dont use the data bean and give everything there only?
    The same, the rpt is not executing the stored procedure.
    Did anything change on the RDBMS side? Additional packages, changes to the schema, ownership, etc?
    No, the server is ok and the database is ok.
    If you configure Log4J logging to DEBUG, you should see the database invokes from the Crystal Java engine, specifically the queries sent and the number of rowsets returned. Do you notice any errors?
    I have a problem here with log4j. In my project i'm using spring and with the help of spring i configure log4j, basically with spring is easier to configure log4j.
    I'm telling you this because i have log4j working but when my application reaches the code to change the connection to the rerport, log4j dies and stop sending any message to the stdout or to a log file. I haven't since this behavior in any other app o library. So i want to guess i have something wrong with my log4j or maybe with log4j+spring.
    So, i remove all the code of spring referring to log4j, but the problem with log4j wasn't solved.
    What i will try now is to remove spring from the project.
    This is my log4j.properties:
    log4j.rootLogger=DEBUG, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

  • ADF BC / Why bind variables are mandatory in the sql query

    I got this error during view object excecution in the component browser :
    (oracle.jbo.SQLStmtException) JBO-27122: Erreur SQL lors de la préparation d'une instruction. Instruction : SELECT * FROM (Select distinct(socialgroup.socialgroup_i) from socialgroup, socialgroupmember, lodgingallocation, lodge
    where socialgroup.socialgroup_i = socialgroupmember.socialgroup_i and socialgroupmember.t_socialgrouprole_i = t_rolegroup_ipar.fgetflextypologyclassitem_i(t_rolegroup_ipar.fisbeneficiary) and socialgroupmember.datefrom <= :DateTo and nvl(socialgroupmember.dateto, :DateFrom) >= :DateFrom and socialgroupmember.requester_i = lodgingallocation.requester_i and lodgingallocation.datefrom <= :DateTo and nvl(lodgingAllocation.DateTo, :DateFrom) >= :DateFrom and lodgingallocation.lodge_i = lodge.lodge_i) QRSLT ORDER BY "SOCIALGROUP_I"
    ----- LEVEL 1: DETAIL 0-----
    (java.sql.SQLException) Tentative de définition d'un nom de paramètre qui ne se trouve pas dans le SQL: T_SICategory_I
    The bind variables T_SICategory_I is not yet use in the sql query but will be used later so i defined it for the view object.
    Is it a reason that the run time check this ? It would be more convenient to set the bind variables early when defining the view object and add them later during the development iteration.

    Design-time defined named bind variables can be marked as required, or not.
    This is decided by the use in the where clause or in view criteria. In my case the bind variable was not used in where clause neither in view criteria and that causes the error.
    May be i would be nice to add a check box (a flag) that enable or disable the bind variables for this checking so we will be able to let it defined even we removed some part of the query corresponding to the corresponding restriction or we defined it earlier for a part of the query that is not yet defined.
    In my current case i fully defined the bind variables but would refine my query later ... in that cause i would have to remove this bind variable and loose all the definitions to run this view object.
    sorry for my english ...

  • XSU  and CURSOR expression in the sql query

    Platform: oracle 8.X on ibm aix and java client code from
    windows NT.
    JDBC DRIVER: JDBC Oracle thin driver version 1.2.
    when i execute a Sql satement with Cursor expression from the
    java client code with XSU it returns an XML DOM But if the
    CURSOR EXPRESSION IN THE SQL QUERY RETURNS EMPTY ROWS i get
    back an error node with "ORA-01001 Invalid Cursor" error
    message.i had aslo set the setNullAttributes(true) property
    on oraclexmlquery.
    Interestingly, if i exceute the same query in the SQL plus
    it returns the column names with no rows.
    is there any way where i can get xml document with table
    structure, when there are no rows instead of ORA error message.

    Ok.
    I assume that you have for one activity several asset PNR and for one asset several activity.
    The factPNR is on this way a real bridge table. It's a way to be able to design a many-to-many relationship.
    Have a look here for more detail on how to build a many-to-many relationship :
    http://gerardnico.com/wiki/dw/data_quality/relationships#many-to-many
    Therefore I assume that you want this design :
    DimActivity -< FactActivity >- < FactPNR >- DimPNR  and you will have :
    DimActivity -< FactActivity >- < BridgeTable >- DimPNR  How to build your bridge table ?
    In the physical layer, :
    * create a new table BridgeActivityPNR, open it and select "statement"
    * enter your sql statement
    SELECT DISTINCT A.ROW_WID ACTIVIDAD_WID, B.ROW_WID ASSET_WID
    FROM W_ACTIVITY_F A,
    W_ASSET_D B,
    W_SRVREQ_D C,
    X_S_CMPT_MTRC_F D,
    X_S_ASSET_FEA_D E
    WHERE A.X_SRA_SR_ID=C.INTEGRATION_ID AND
    C.X_VLG_FLIGHT_ID=D.X_ROW_ID AND
    D.X_ROW_ID=E.X_CM_ID AND
    E.X_ASSET_ID=B.X_ROW_ID* add two columns in the column tab : ACTIVIDAD_WID and ASSET_WID
    * create the physical join with the table FactActivity and DimPNR
    * drag and drop in the business model your table BridgeActivityPNR
    * in the BMM, create the complex join like this :
    DimActivity -< FactActivity >- < BridgeTable >- DimPNR  * open your logical bridge table and check the bridge table option.
    And you are done if I didn't forget anything.
    A complete example here :
    http://gerardnico.com/wiki/dat/obiee/obiee_bridge_table

  • Modifying the sql query in doDML of entity

    I am using Jdev 11.1.1.4.0 and SQLServer Database
    I want to modify the sql query in "doDML(int operation, TransactionEvent e)"
    I could check what kind of operation like (operation == DML_UPDATE) and do some additional stuff.. But I want to edit the query because of which we entered doDML..
    I want to edit the query because when i use SQLServer database with SQLBuilder as SQL92, the update statement will have table alias like "update table <table alias>" which the SQLServer is not recognizing.. So I want to remove that alias from sql query in doDML..

    It isn't possible.
    However as per the following MSDN page a table alias is fine in an UPDATE statement so are you sure this is your problem?: http://msdn.microsoft.com/en-us/library/aa260662(v=sql.80).aspx
    CM.

  • How to view the sql query?

    hi,
      how to view the sql query formed from the xml structure in the receiver jdbc?

    You can view SAP Note at
    http://service.sap.com/notes
    But you require SMP login ID for this which you should get from your company. The content of the notes are as follows:
    Reason and Prerequisites
    You are looking for additional parameter settings. There are two possible reasons why a feature is available via the "additional parameters" table in the "advanced mode" section of the configuration, but not as documented parameter in the configuration UI itself:
    Category 1: The parameter has been introduced for a patch or a SP upgrade where no UI upgrade and/or documentation upgrade was possible. In this case, the parameter will be moved to the UI and the documentation as soon as possible. The parameter in the "additional parameters" table will be deprecated after this move, but still be working. The parameter belongs to the supported adapter functionality and can be used in all, also productive, scenarios.
    Category 2. The parameter has been introduced for testing purposes, proof-of-concept scenarios, as workaround or as pre-released functionality. In this case, the parameter may or may not be moved to the UI and documentation, and the functionality may be changed, replaced or removed. For this parameter category there is no guaranteed support and usage in productive scenarios is not supported.
    When you want to use a parameter documented here, please be aware to which category it belongs!
    Solution
    The following list shows all available parameters of category 1 or 2. Please note:
    Parameter names are always case-sensitive! Parameter values may be case-sensitive, this is documented for each parameter.
    Parameter names and values as documented below must be used always without quotaton marks ("), if not explicitly stated otherwise.
    The default value of a parameter is always chosen that it does not change the standard functionality
    JDBC Receiver Adapter Parameters
    1. Parameter name: "logSQLStatement"
                  Parameter type: boolean
                  Parameter value: true for any string value, false only for empty string
                  Parameter value default: false (empty String)
                  Available with: SP9
                  Category: 2
                  Description:
                  When implementing a scenario with the JDBC receiver adapter, it may be helpful to see which SQL statement is generated by the JDBC adapter from the XI message content for error analysis. Before SP9, this can only be found in the trace of the JDBC adapter if trace level DEBUG is activated. With SP9, the generated SQL statement will be shown in the details page (audit protocol) of the message monitor for each message directly.
                  This should be used only during the test phase and not in productive scenarios.
    Regards,
    Prateek

  • How to get cm:search to use the max attribute when creating the SQL query?

    When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.
    We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.
    The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.
    Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?

    Hi Erik,
    The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.
    -Ryan

  • How to find out which Tables have been accessed without looking at the SQL query ?

    Hi,
    I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
    I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
    has the most recently executed queries, but
    I did'nt see any queries connected to my process.
    Could anybody help me on this ?
    Thanks
    Jagdeep
    [email protected]
    null

    PRECISE/SQL can help you if you have access to it
    2nd option can be that turn on SQL_TRACE
    Run executable of ur c++ program
    it will create a trace file in user_dump_dest
    and then using TKPROF u can see all quesries and their plan also.
    HTH
    Gagan Deep Singh
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by (jagdeeps):
    Hi,
    I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
    I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
    has the most recently executed queries, but
    I did'nt see any queries connected to my process.
    Could anybody help me on this ?
    Thanks
    Jagdeep
    [email protected]<HR></BLOCKQUOTE>
    null

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • Problem in designing the complex report for the client requirement

    Post Author: venkateshvarakala
    CA Forum: General
    Hi,
    I have problem in designing the report (Crystal Report 9.0) with multiple groups wih a sub report in each group with a a group header and footer with a
    detail section in each report.
    My requirement is as follows.1) Xxxx-sub reportwill have one header conetnt and footer content and detail ection in the middle grouped on one parameter2) Yyyyysub reportwill have one header conetnt and footer content and detail ection in the middle grouped on one parameter3) Zzzzzsub reportwill have one header conetnt and footer content and detail ection in the middle grouped on one parameter4)ABCdsub reportwill have one header one footer in group headers grouper on two prameters, My requirement demands customised detail section i.e.static conetent followed by detail section and a static conetnt(which should not repeat with child table records,should come only once with the a record and
    s) and detail section.
    example:
    main table of the sub report 4 has records m1,m2,m3,m4... and child table has
    m1c1m,m1c2,m1c3,m1c4,m2c1,m2c2,m2c3,m2c4,m3c1,m3c2,m3c3,m3c4,m4c1,m4c2,m4c3,m4c4...
    The staic content should come only with m1,m2,m3,m4 not with m1c1,m1c2....like this I need in two places in the same report which may have 500 recors printed in single report.
    all the above section should be suppressable with a condition including the top 3 reports.
    I am able to get the top 3 reports as per the requirement but my forth sub report is getting displayed after each sub-group 1,2,3 which is not happening with
    1,2,3. Only 4th set is repeating with 1,2,3.
    THis report is attached with 6 datasets.
    I linked the main report main table with 1,2,3 (main Table) report filling table but when I am trying to link the 4th table main table  I am able to link but
    I am not getting the result on the report.All the dataset has the one common column. sub report 1,2,3 are filled with common datasets with condition suppressing where as 4th report is filled with
    different results .
    1) My question is why the 4 the report is report is repeating with 1,2,3 why 1,2,3 are coming as expected.2) Is it possible to create
    Please help me in designing the report as per the requiremnt and suggest me if I need any design modifictions.
    Your suggestions and inputs are highy appreciated.Thanks for sparing time in going through my problem and I will be grateful if give solution and share if you have similar experiences.
    Thanks
    Venkatesh Varakala.

    If you create a multiprovider with the two ODS you won’t have this problem.
    Hope it helps.
    Regards.

  • How to display the out put of the sql query in a text file using forms

    I want to display the out put of the sql query in a text file using forms 6.0.Same could be done using spool command in sqlplus but i want it using forms....Fiaz

    Have a look at the text_io package:
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=
    cheers

  • Find out the sql query for special characters.

    Hi,
    I have the emp table with column name first_name.In that table i have lot records with first_name inlcudes the below mentioned special characters.
    ¡ , ¿, ,Ä,Å,ä,ª,À,Á,Ã,à,á,ã,å,Æ,æ,Ç,ç,È,É,Ê,Ë,è,é,ê,ë,Ì,Í,Î, Ï,ì,í,î,ï, Ñ,ñ, ô, º, Ò, Ó, Ô, Õ, Ö, Ø, ò, ó, õ, ö, ø, ß, Û, Ù, Ú, Ü,ù, ú, û, ü, ÿ,
    I am looking for the records with includes the above mentioned special characters in the first_name column.
    Can u please give the sql query to find out the records.
    Thanks&Regards
    N.Sivaraman

    I am looking for the records with includes the above mentioned special characters in the first_name column.One way would be:
    select emp.*
      from emp,
           table (
             sys.odcivarchar2list ('¡',
                                   'Ä',
                                   'Å',
                                   'ä',
                                   'ª',
                                   'À',
                                   'Á',
                                   'Ã',
                                   'à',
                                   'á',
                                   'ã',
                                   'å',
                                   'Æ',
                                   'æ',
                                   'Ç',
                                   'ç',
                                   'È',
                                   'É',
                                   'Ê',
                                   'Ë',
                                   'è',
                                   'é',
                                   'ê',
                                   'ë',
                                   'Ì',
                                   'Í',
                                   'Î',
                                   'Ï',
                                   'ì',
                                   'í',
                                   'î',
                                   'ï',
                                   'Ñ',
                                   'ñ',
                                   'ô',
                                   'º',
                                   'Ò',
                                   'Ó',
                                   'Ô',
                                   'Õ',
                                   'Ö',
                                   'Ø',
                                   'ò',
                                   'ó',
                                   'õ',
                                   'ö',
                                   'ø',
                                   'ß',
                                   'Û',
                                   'Ù',
                                   'Ú',
                                   'Ü',
                                   'ù',
                                   'ú',
                                   'û',
                                   'ü',
                                   'ÿ'
    where instr (ename, column_value) > 0

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • Pinning the sql query in cache

    Hi All,
    I want to pin the sql query is cache because the physical reads are very high. Can anyone tell me steps to pin the sql query in the cache. Current version 10.2.1.0 OS : Windows.
    Reads CPU Elapsed
    Physical Reads Executions per Exec %Total Time (s) Time (s) SQL Id
    19,836 38 522.0 2.1 25.40 50.00 1r0wh3v6bayyk
    With regards
    kccrga

    Oscar,
    I've read Carys paper and a good paper it is.
    The point I was trying to get across is that there should be no rules of thumb. (par this one of course ;) )
    It all depends. Should one concentrate on reducing cpu usage on a disk-bound system? Is doing, say, 100 single-block reads from disk faster than doing 100 current mode gets?

Maybe you are looking for

  • Copy&paste between textedit and javachat

    I'm running a MacBook Pro 2.4GHz intel OSX 10.5.6. I moderate a java chat room and keep broadcasts and IP#'s in text edit and so copy and paste between the two. But lately I'm running into a loss of this ability. I can copy and paste within textedit

  • Cd won,t play on car CD player

    I have burn my purchased CD's and now when I go and try to play I get an "err". If I play it on my computor it plays fine.

  • Why do I have 2 iPhoto Library icons?

    Hello I have 2 unrelated issues. (I believe) First, In my home folder...picutures folder, I have 2 iPhoto Library icons. one with a date modified 20/6/2010 size 45.98GB. the other date modified Today 44.65 GB. In the last few days I have been deletin

  • Skipped Numbering for Materials

    Hi, We currently have a situation wherein we noticed that material numbers are inconsistently numbered. Instead of sequential all throughout, some numbers are skipped. For example, we would have materials 300010, 300011, 300012, 300020, 300021 (see t

  • Lightroom 5 new insatll missing Edit in Photoshop.exe,  missing sc5 add in?? do I have to pay extra to get this feature??

    I final got my LR5 up and working with my photos , but when I right click and select EDIT in Photoshop.exe it is dimmed?? do I have to pay extra for this file?? I was reading and it says to Add the path and  new value to your Register, which I did by