Oracle query output size

Hi,
How to findout the sql statement output size...?
Thanks,
Edited by: Jaya.ilankovan on Nov 28, 2011 1:26 PM

Jaya.ilankovan wrote:
Hi,
How to findout the sql statement output size...?
We are having large amount of data in one of my master table, when i run the query it showing large amount of data in that columns. so i required the size of output columns...?
Note: We dont want table occupied size.
Thanks,Its not clear what you want. Do you mean to say that when you see the output, its large and doesn't fit properly? If yes than probably you need the formatting of the output. If not, be more precise in telling us what you want along with the database version of yours.
Aman....

Similar Messages

  • Oracle Query output erro (MX7)

    Hi
    Coldfusion page throwing ODBC error when Oracle (9i) Query
    executed. No useful error message shown.
    Same query gets executed successfully in Oracle Client.
    When i use CLOB Column type in my select query error has
    shown. In the same query i have used substr anticipating that some
    issues when oracle column type being being CLOB in coldfushion
    page. It did not work.
    Query output returns some html tags also. I guess we need to
    set some configurations in Coldfusion server. As the same code runs
    perfectly on the test/production environment.
    Pointers are highly appreicated.
    Regards
    Ram
    Beginner in coldfusion Technology

    since you didn't show the query, or the error message, I'll
    just take a guess and say that you ended your sql with a
    semi-colon.

  • Query output based on date - Oracle 8i

    I am trying to write a very simple query to output data based
    on date ranges, but I keep encountering an error.
    When I do this statement:
    select * from my.table
    where startdate > '2008-01-01'
    I get this error:
    [ODBC][Ora]ORA-01861: literal does not match format string
    When I format the select statement this way:
    select * from my.table
    where startdate > #2008-01-01#
    i get this error:
    [ODBC][Ora]ORA-00932: inconsistent datatypes: expected DATE
    got NUMBER
    Currently using CF8, and what I believe is Oracle 8i. I have
    tried formatting this data in many other ways, but can't get it to
    work. I know that when I query the database via access, it has no
    problem returning results with the SQL date formatted like
    #01/01/2008#

    You can use the Oracle to_date() function to convert your
    string to a date/time object:
    select * from my.table
    where startdate > to_date('2008-01-01', 'YYYY-MM-DD')
    Or, since you are using an ODBC connection to Oracle, you can
    try using the ColdFusion CreateODBCDate() function:
    select * from my.table
    where startdate > #CreateODBCDate("2008-01-01")#
    Or, as already suggested, use cfqueryparam with the
    appropriate CFSQLType, such as
    CF_SQL_TIMESTAMP instead of CF_SQL_INTEGER like you are
    attempting to do.
    You can't use a "string" date value against a date/time
    column in an Oracle query, as it won't perform an implicit type
    conversion.
    Phil

  • Query Array Size

    There is a property in Oracle Forms "Query Array Size" that specifies the maximum number of records that Forms Developer should fetch from the database at one time. How to reaslize similar functionality through SQL or PL/SQL.

    hi,
    this is the OracleAS Portal Content Management forum. Please post your question in the Oracle Forms forum
    Forms
    thanks,
    christian

  • Error message "Maximum character output size limit reach Err_WIS_30272"

    Users are getting the Error message "Maximum character output size limit reach Err_WIS_30272" while creating the Universe Query in the Live Office, but when they create the same query in the Web intelligence Report then it work fine.
    To resolve this error message we can have to increase the value of "Maximum Character Stream Size" parameter in the Web intelligence Processing Server.
    But i want to know the reason why the error message is only appearing in the Live Office Query, where it work fine in Web intelligence Query.
    Are there architectural difference in Web intelligence and Live Office?

    Hi,
    maybe one of the following SAP Notes will answer your Question.
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3133373030343526
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3133373537353526
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3133383336363426
    Regards
    -Seb.

  • How to get oracle table occupied size

    Hi,
    Actually my task is arrange to get an oracle table occupied size for a particular schema.
    I have an query to get allocated table size,the query as follows
    SELECT SEGMENT_NAME,sum (BYTES)/1024/1024 FROM user_SEGMENTS WHERE segment_type='TABLE' group by segment_name order by sum(bytes) desc;
    But actually i need to get "how much space occupied for each table in that particular schema"
    Thanks in advance...............

    Do you want this?
    SELECT t.owner, t.table_name, t.tablespace_name,
    (sum(d.bytes)/1024/1024) table_size
    FROM dba_segments d, all_tables t
    WHERE d.segment_name = t.table_name
       AND d.segment_type = 'TABLE'
       AND t.owner = 'SCOTT'  --- you can change or delete this condition
    GROUP BY   t.owner, t.table_name, t.tablespace_name;

  • Query Result Sizes Using LiveOffice

    I'd like to get a community response on this one:
    Can viewers of this post who have LiveOffice product experience answer a question for me?  I am using the Universe Query functionality to place data into Excel.  The result size is roughly 4500 rows by 6 columns of data.  If I remove a condition in the query to expand the results LiveOffice fails with this error:
    Failed to get the document information. (LO 26315)  Maximum character output size limit reached. Contact your BusinessObjects administrator. (Error: ERR_WIS_30272)(6315)
    After checking in Desktop Intelligence...I found the result size of the failed query to be just under 10,000 rows.
    I've been using LiveOffice for some time now, but this is the first instance where I have attempted to run a large amount of data into Excel.  I wouldn't call 10,000 rows a lot, but it is a lot more than I have done in the past.
    Can users of LiveOffice tell me the largest row result they have thrown into Excel using LiveOffice?  It can be with a report part or straight query.  I tried to provide with a webi report part and got the same failure.
    I've logged this with SAP Support and they're baffled so far...

    Hi Gregg,
    what's the data source behind your universe? Can it be the case that somewhere in your results exists a field that holds more than 32K. As far as I know Excel allows 32 K per cell.
    Regards,
    Stratos

  • Why my Input/output size of backup increased

    I have a following rman backup script
    run {
    backup as compressed backupset incremental level 1 cumulative device type disk tag 'Baan_bkup$LEVEL_0' data
    base;
    recover copy of database;
    backup device type disk tag 'Baan_bkup$LEVEL_0' archivelog all not backed up;
    backup archivelog until time 'sysdate-3' delete all input;
    crosscheck backupset;
    crosscheck archivelog all;
    delete noprompt obsolete;
    delete noprompt expired backup;
    running once daily for almost three weeks. the first 9 days, the input/output sizes were fractional (ex 3G/88M), then it switched to ~16G/1.3G and stayed that level. Because this is test DB server, basically there is no activity on it except the mentainace activity by DB itself. So how did it happen to cause the size change? The real backup sets only maintain at 3 days level as the script. My database size is 16.88G of 10g R2 on RH EL3

    That is the behavior in 9i and 10g1. In 10gR2 things change.
    Unused Block Compression Of Datafile Backups to Backup Sets
    When backing up datafiles into backup sets, RMAN does not back up the contents of data blocks that have never been allocated. (In previous releases, this behavior was referred to as NULL compression.)
    RMAN also skips other datafile blocks that do not currently contain data, if all of the following conditions apply:
    The COMPATIBLE initialization parameter is set to 10.2
    There are currently no guaranteed restore points defined for the database
    The datafile is locally managed
    The datafile is being backed up to a backup set as part of a full backup or a level 0 incremental backup
    The backup set is being created on disk.
    http://download-east.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta009.htm#RCMRF98765

  • How to Align Query output in vertical grids in Classic Reports

    HI all,
    I have a requirement to display query output in a vertical grid.
    For example, If my query output is :
    SQL, PL/SQL, Forms,Reports, XMLP, APEX etc then output should be displayed in following format:
    1. SQL 2. PL/SQL 3. Forms
    4. Reports 5. XMLP 6. APEX
    Thanks in Advance!!
    Regards,
    Vamsi

    866010 wrote:
    Thanks for the response!!
    SQL: select * from emp
    where 1=1
    and emp = 1 ;
    We want to display emp details from the above query in the following format:
    EMP No : 1 Ename: XXX Manager_Id: 2
    Job: Consultant Sal: 1000 Commission: 5
    We want a break after three columns.Create a custom named column template and base the tabular form report on this: {message:id=10399762}
    Please read the FAQ and forum sticky threads (if you haven't done so already), and update your forum profile with a real handle instead of "866010".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • How to send email alert to users from the query output ?

    Hi all,
    I intend to write a pl/sql to send email alert to user based on the following query output :-
    Item_______Qty_on_hand________Min_qty______email
    [email protected]
    [email protected]
    [email protected]
    once run, I will like to distribute to those email id. How should I code that in pl/sql ? or any other better idea is welcome. Thanks.
    Rgds
    Lim

    http://asktom.oracle.com/pls/ask/f?p=4950:8:3439330610438686683::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:255615160805,

  • Formatting SQL query as of iSQL*PLUS query output format through PL/SQL

    This is my procedure through which i m sending an e-mail. In my e-mail i want to show output from error log query. I can show it in simple text but i want the output for the error log to be formatted as the query result is formated in iSQLPlus.
    In simple words instead of the message i want to send the query result which is formatted as iSqlPlus query output. Thankx in advance. Please provide a simple solution that iSqlPlus engine recieves my any given query and gives the formatted output for that query in the e-mail
    DECLARE
    conn utl_smtp.connection;
    v_log number;
    BEGIN
    conn := demo_mail.begin_mail(
    sender => '<sender-email>',
    recipients => '<recipient-email>',
    subject => 'HTML E-mail Test',
    mime_type => 'text/html');
    </h1>
    -- This method will be used for oracle error reporting');
    demo_mail.write_text(
    conn => conn,
    message => '<h1>Hi! This is a <i>test msg</i>);
    demo_mail.end_mail( conn => conn );
    END;

    oe@ORA102>
        select * from
        (select rownum r1, p.promo_id, promo_name from promotions p where rownum <5)
        full outer join
        (select rownum r2, w.warehouse_id from warehouses w where rownum <4)
       on (r1 = r2)
    oe@ORA102>/
            R1   PROMO_ID PROMO_NAME                   R2 WAREHOUSE_ID
             1          1 everyday low price            1            1
             2          2 blowout sale                  2            2
                                                        3            3
    oe@ORA102>But there should be "some connection" between the result sets, otherwise the resulting result set become unpredictable / meaning less.
    I am joining on ROWNUM, Do you want every row from emp related to every row from stocks (like a cartesian join)?
    Trying to understand the requirement.
    vr,
    Sudhakar B.

  • Query on using Variables in Oracle Query

    Hi
    i am new to Oracle, i have tried extracting data from the Oracle Database using the following Query which includes 1 variable SYSDATE_UTS, however when i try to execute the Query i get an error. Please let me know what am i doing wrong and how can i correct it.
    Error Message
    ORA-06550: line 4, column 1:
    PLS-00428: an INTO clause is expected in this SELECT statement
    Oracle Query
    DECLARE SYSDATE_UTS NUMBER := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    BEGIN
    SELECT
    INCIDENT_NUMBER,
    to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME,
    ,GROUP_TRANSFERS
    ,LAST_MODIFIED_BY
    ,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
    ,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
    ,CASE
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
    ELSE 'UNKNOWN'
    END AS AGE_GROUP
    FROM IncidentDataBase
    and STATUS not in (4,5,6)
    and rownum <10;
    END;

    Hi Frank
    i am using the following Oracle Version
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    and Quest Toad for Oracle to write and execute the queries:
    Toad for Oracle Xpert
    Version 10.1.1.8
    The code i am using is:
    variable SYSDATE_UTS NUMBER;
    exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    SELECT
    INCIDENT_NUMBER,
    to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME
    ,GROUP_TRANSFERS
    ,LAST_MODIFIED_BY
    ,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
    ,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
    ,CASE
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
    ELSE 'UNKNOWN'
    END AS AGE_GROUP
    FROM IncidentDataBase
    WHERE STATUS not in (4,5,6)
    and rownum <10;
    Notes:
    1. When i put the cursor before "variable" (starting of the query) and execute the script i get an Error: ORA-00900: invalid SQL statement.
    2. When i put the cursor just before "SELECT" i get a pop up.
    a. it is a Toad window which displays the available variables (in this case :SYSDATE_UTS).
    b. gives me a dropdown option to select the type (by default VARCHAR2 is selected).
    c. there is a value field where i need to enter the value for the Variable.
    d. the SQL statement shown in this dilog box does not include the 1st 2 lines
    variable SYSDATE_UTS NUMBER;
    exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    Q: is there something wrong in the syntax i am using?
    Sven W. - I have been using your method all these days, which works just fine. i wanted to know how i could use a variable instead.
    Business Requirement - My whole intent is to calculate the Age of an incident (Difference between "Reported Date" and current date) and to assign Age Groups (0-1 Days, 2-4 Days,....,20+ Days).
    Edited by: 921713 on Mar 19, 2012 12:23 PM

  • Oracle query help

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    Report Builder 10.1.2.0.2
    ORACLE Server Release 10.1.0.4.2
    Oracle Procedure Builder 10.1.2.0.2
    Oracle ORACLE PL/SQL V10.1.0.4.2 - Production
    Oracle CORE    10.1.0.4.0    Production
    Oracle Tools Integration Services 10.1.2.0.2
    Oracle Tools Common Area 10.1.2.0.2
    Oracle Toolkit 2 for Windows 32-bit platforms 10.1.2.0.2
    Resource Object Store 10.1.2.0.2
    Oracle Help 10.1.2.0.2
    Oracle Sqlmgr 10.1.2.0.2
    Oracle Query Builder 10.1.2.0.2 - Production
    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
    Oracle ZRC 10.1.2.0.2
    Oracle XML Developers Kit 10.1.0.4.2 - Production
    Oracle Virtual Graphics System 10.1.2.0.2
    Oracle Image 10.1.2.0.2
    Oracle Multimedia Widget 10.1.2.0.2
    Oracle Tools GUI Utilities 10.1.2.0.2
    I have enclosed sample data and also table structure. I need help in getting the query.
    select dept_id,proc_code,override_goal,goal_override_date
      from table2
    where goal_override_date between '02-jan-2014' and '11-jan-2014'
       and dept_id = 10
       and proc_code = 'CP'
    select DEPT_ID, PROC_CODE, DAY_SUNDAY, DAY_MONDAY,
           DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
             DAY_FRIDAY, DAY_SATURDAY
      from table1
    where dept_id =10
    and proc_code = 'CP'; 
    Table1  is kind of maintenance table.
    In Table2 values can be overridden.
    Requirement
    Check to see if there is data in table 2 for the date range . If table2 has no value then take value from table1 for that day the date falls into. Any more clarification please ask me.
    Sundays are all zeros.
    I want this data. and the sum for the date range.
    2-jan-2014  - 3
    3-jan-2014  - 3
    4-jan-2014  - 3
    5-jan-2014  - 0
    6-jan-2014  - 1
    7-jan-2014  - 3
    8-jan-2014  - 5
    9-jan-2014  - 5
    10-jan-2014 - 3
    11-jan-2014 - 3
    Sum for the date range has to be 29
    Sample table and data
    CREATE TABLE TABLE1
      DEPT_ID NUMBER NOT NULL,
      PROC_CODE VARCHAR2(2 BYTE) NOT NULL,
      DAY_SUNDAY NUMBER(4) NOT NULL,
      DAY_MONDAY NUMBER(4) NOT NULL,
      DAY_TUESDAY NUMBER(4) NOT NULL,
      DAY_WEDNESDAY NUMBER(4) NOT NULL,
      DAY_THURSDAY NUMBER(4) NOT NULL,
      DAY_FRIDAY NUMBER(4) NOT NULL,
      DAY_SATURDAY NUMBER(4) NOT NULL
    Insert into TABLE1
      (DEPT_ID, PROC_CODE, DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY,
      DAY_WEDNESDAY, DAY_THURSDAY, DAY_FRIDAY, DAY_SATURDAY)
    Values
      (10, 'CP', 0, 3, 3,
      3, 3, 3, 3);
    COMMIT;
    CREATE TABLE TABLE2
      DEPT_ID NUMBER NOT NULL,
      PROC_CODE VARCHAR2(2 BYTE) NOT NULL,
      OVERRIDE_GOAL NUMBER(4),
      GOAL_OVERRIDE_DATE DATE NOT NULL
    Insert into TABLE2
      (DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
    Values
      (10, 'CP', 1, TO_DATE('01/06/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TABLE2
      (DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
    Values
      (10, 'CP', 3, TO_DATE('01/07/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TABLE2
      (DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
    Values
      (10, 'CP', 5, TO_DATE('01/08/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TABLE2
      (DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
    Values
      (10, 'CP', 5, TO_DATE('01/09/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TABLE2
      (DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
    Values
      (10, 'CP', 3, TO_DATE('01/10/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TABLE2
      (DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
    Values
      (10, 'CP', 3, TO_DATE('01/11/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    Help is highly appreciated.

    SELECT dates,
           override_goal,
           SUM(override_goal) OVER()
           FROM(SELECT dates,
                       CASE WHEN EXISTS(SELECT 1
                                        FROM table2 t2
                                        WHERE t2.goal_override_date = qry1.dates
                                        AND t2.dept_id = 10
                                        AND t2.proc_code = 'CP')
                            THEN (SELECT override_goal
                                  FROM table2 t2
                                  WHERE t2.goal_override_date = qry1.dates
                                  AND t2.dept_id = 10
                                  AND t2.proc_code = 'CP')
                       ELSE (SELECT DECODE(days,'SUN',day_sunday,
                                                'MON',day_monday,
                                                'TUE',day_tuesday,
                                                'WED',day_wednesday,
                                                'THU',day_thursday,
                                                'FRI',day_friday,
                                                'SAT',day_saturday )
                              FROM table1)
                       END as override_goal
                FROM (SELECT in_dt1+(LEVEL-1) dates,
                             TO_CHAR(in_dt1+(LEVEL-1),'DY') days
                      FROM(SELECT TO_DATE(&from_date,'DD-MON-YYYY') in_dt1,
                                  TO_DATE(&to_date,'DD-MON-YYYY') in_dt2
                                 FROM dual)
                      CONNECT BY LEVEL <= (in_dt2 - in_dt1)+1) qry1);
    Now run the query it will prompt you for the inputs. You can pass the date values and check the result. Otherwise replace &from_date,&to_date with user inputs

  • How can I reduce the output size of what I want to print?

    I have an HP Touchsmart Web and recently needed to enlarge the document I was printing.  I thought I enlarged it under the Advanced tab in Printer Preferences, but now I can't find anywhere that you gives you the option to change the output size.  I remember it gave me drop down choices of 25%, 50%, 75%, 100%, 150%, 200% etc.  Now  I can't print most of the things I need because it enlarges everything.  However, when I scan, it prints real size, it's only when I print something from the computer.  Please help!  I can't use my printer when I need it!

    Thank you for your help.  Your reply wasn't actually the answer I needed, but it somehow jogged my memory as to how to fix it.  I kept thinking the problem wasn't with the printer, but with a setting in my computer and I was correct.  I had to go to File, then Print Preview, then change the Scale, which had the drop down choices I remembered.  I changed it back to 100% but was surprised it stayed permanently at the setting I had used before.  I thought it always went back to 100% after turning off the computer, but that obviously isn't the case.  Thanks again!

  • Central Management server - executed a query but how to send the query output in the form of mail?

    Hi All,
    i have used CMS in SQL 2008 R2. i have added couple of servers in its group. i have executed a query & i need to send the query output in the form of email.
    basically query is checking the rows count from couple of user tables in servers.
    issue here is how to copy the data that is used by CMS? i need to work on automate the rows count in difft user table in db servers
    could you please suggest how can i achieve this?

    Copy to what?
    SELECT COUNT(*) FROM sys.objects
    Running the above statement returns two columns (server name and count)
    All the servers SS2005  and onwards , then use
    EXEC msdb.dbo.sp_send_dbmail 
         @profile_name = 'name', 
         @recipients = '[email protected]', 
         @query = 'SELECT COUNT(*) FROM sys.objects', 
         @subject = 'Count rows'
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • ThinkPad Yoga won't connect to external display

    I just received a ThinkPad Yoga and have not been able to get output to external display. I am using mini hdmi to display port. Lenovo tech support was completely useless. Does anyone have experience with this issue? Thanks

  • Is the IPod Nano 6th Generation Apple's least reliable product?

    Do apple have a product that is less reliable than the IPod nano 6 G? Do any companies have less reliable products than the IPod nano 6 G? If so, what are they? I got my 6th replacement nano 6G (7th nano 6G since February) at the beginning of July. 

  • Transaction Isolation Level to Read UnCommited in Non OLTP Database

    HI, We are having a database which for NOT OLTP process. That is OLAP DB. Operation on that DB is only Select and (Incremental Insert - FOR DWH ) not Update/Delete and we are performing ROLAP operations in that DB. By Default SQL Server DB isolation

  • Select multiple mails in a conversation

    Hi, My emails are organized by conversation. Great feature. My problem is that I sometime receives hundreds of emails in one conversation and I delete some of them and only keep good ones. I try to select multiple emails at once using cmd or shift: n

  • Cannot select things in Disc Repair

    I did a verify disc in the Disc Utility and got this message: 2012-07-25 20:48:11 -0600: The volume Taylor's HD was found corrupt and needs to be repaired. 2012-07-25 20:48:11 -0600: Error: This disk needs to be repaired using the Recovery HD. Restar