Query-ECM-ASAP-Help

Hi,
I have a Query.
I have done all customization relating to Budget set-up relating to guidelines in ECM. I have configured guidelines too but when I try to assign guidelines in
IT 0759 it is giving me an error that Budget is not set-up and not allowing me to apply guidelines. I have set the Butget type too and run the Budget assignment in PCP.
Can anyone help me.
Regards,
Happy

Hi,
I did the following customization
Generate Budget (PECM_GENERATE_BUDGET) &
Upload Budget Values fromPCP (PECM_INIT_BUDGET)
But the IT 0666 is not getting generated.Any way to-do so.
Regards,
Happy

Similar Messages

  • Just upgraded and iPhoto said it has to upgrade library but keeps freezing. Have tried it too many times now and I need those photos ASAP  HELP!!

    Just upgraded and iPhoto said it has to upgrade library but keeps freezing. Have tried it too many times now and I need those photos ASAP  HELP!!

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Query about Search help exits

    Hi experts,
               I have one query regarding search help. I have created a elementary search help which is having two fields.Now my requirement is that in the selection screen when I will enter any value in one field and i will press F4 in other field the list should contain only the values corresponding to the first field.
    e.g.two fields comp code and name of company. When I will select the company code and press F4 in the second field the companies corresponding to the particular code should appear. Should I write a particular exit for that.
      Experts please help me.
      I will reward points accordingly.
      Thanks in advance,
        Abir.

    hi abir,
    no neeed for that.
    here i am fetching zones under a country.
    so first user enters a country.
    eg india.
    then on the zone field f4 help, only the zones of india shulod come.
    chk how i did it.
    *&      Form  F_GET_ZONE_DESC
          THIS SUB ROUTINE WILL FETCH THE ZONE DESCRIPTION
    -->  p1        F_GET_ZONE_DESC
    <--  p2        F_GET_ZONE_DESC
    FORM f_get_zone_desc .
      CLEAR int_ret.
      IF wf_country_code IS INITIAL.
    *--MESSAGE IS 'Country Not Selected'.
        MESSAGE s016(zm050).
      ELSE.
    *--THIS WILL FETCH THE ZONE CODES INTO THE INTERNAL TABLE'INT_ZONE_CODE'
    *--WITH RESPECT TO A COUNTRY CODE.
        SELECT zonecode zone_desc
          FROM zmpets_zone
            INTO TABLE int_zone_code
              WHERE land1 = wf_country_code
               AND loekz NE 'X'.
        IF sy-subrc NE 0.
    *MESSAGE IS 'No Zone Available In <COUNTRY_NAME>
          MESSAGE s019(zm050) WITH wf_country_desc.
        ELSE.
          CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
            EXPORTING
      DDIC_STRUCTURE         = ' '
              retfield               = 'WF_ZONE_CODE'
      PVALKEY                = ' '
      DYNPPROG               = ' '
      DYNPNR                 = ' '
      DYNPROFIELD            = ' '
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
             value_org              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
            TABLES
              value_tab              = int_zone_code
      FIELD_TAB              =
             return_tab             = int_ret
      DYNPFLD_MAPPING        =
           EXCEPTIONS
             parameter_error        = 1
             no_values_found        = 2
             OTHERS                 = 3
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          READ TABLE int_ret INDEX 1." INTO INT_RET.
          wf_zone_code = int_ret-fieldval.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " F_GET_ZONE_DESC
    rgds
    anver
    if helped mark points

  • Pass username and password ADFS without using query string, Please help.

    pass username and password ADFS without using query string, Please help.
    I used query string , but it is unsecured to pass credentials over url, with simple tool like httpwatch , anyone can easily get the password and decrypt it.

    Hi,
    According to your post, my understanding is that you had an issue about the ADFS.
    As this issue is related to ADFS, I recommend you post your issue to the forum for ADFS.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=Geneva
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding and support.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Query regarding F4 Help

    Hi Experts,
    I need your help in solving a query about F4 help. I would like to know whether it is possible to return more than one column value from a F4 help. I am working on a scenario where, consider i have a table control with 3 columns. I have F4 helps for two columns. The third column which does not have the F4 help is the primary key and the two columns which have F4 help has repeated values. Consider the following values in the F4 help internal table.
    ColumnA  ColumnB  ColumnC
    1              01            10.09.2009
    2              01            10.09.2009
    3              01            10.09.2009
    Now consider the user selects first row '10.09.2009' in ColumnC and selects '01' from first row columnB from F4 help. I need to populate '1' in columnA of table control.  For this i am using read statement in PBO of my screen. But the read statement fails since ColumnB and ColumnC have repeated values. Kindly provide a solution to fix this problem. Is it possible to get the row id of the row selected by the user from F4 help? I am using the Fm F4IF_INT_TABLE_VALUE_REQUEST. This Fm returns a return_tab. The return_tab has a field record_pos which is 001 always. So it is of no use. Pls help me with a proper suggestion.
    Regards
    Rohan

    hi
    if u want an f4 help and get the other values in the row u need to write the code in process on values request.
    in PVR
    GET CURSOR LINE LINE.
      IF TC-TOP_LINE > 1.
        LINE = LINE + ( TC-TOP_LINE - 1 ).
      ENDIF.
    read table itab index line.
    in that itab u will get the values .

  • ABAP QUERY REPORT : please help me ASAP.

    hi friends,
    I need to change the existing custom abap query.
    1) I need to add two more fields on selection screen. I have added using INFOSET and checked the input and output check boxes.
    But the text of the one field should be different from standard tetx.
    "Reference date" to be changed to "Dairy date".
    I have changed in Infosets. updated text is displaying as "Dairy date" in the out put LIST, but standard text (Reference date) is appearing on the selection screen.
    I need it to be displaed as "Dairy date"
    2)The column "Dairy" date is adding as the last column in the list after executing the query. But I need it to be displayed at 8th column.
    Please help me ASAP.

    hi Eric,
    Could you please explain in detail.
    1)I HAVE CHANGED THE NAME IN iNFOSET, FIELD GROUP.
    IT IS NOT REFLECTING IN SELECTION SCREEN. ONLY REFLECTING IN THE OUT  PUT.
    2) I have tried by changing the sort sequence number. but still it is displaying at the end of the columns.
    please explain in detail.

  • Select Query Problem-need help

    hi,
    Help me out from this problem.
    Actually i have a table and the data in it as follows:
    Department Name Job Name
    Accounts Sr. Accountant
    Accounts Jr. Accountant
    Accounts Cleark
    But i dont want the repeated Department Name.. and i want the same output as follows.
    Department Name Job Name
    Accounts Sr. Accountant
    Jr. Accountant
    Cleark
    Without using sql reports and Sql Plus additional commands.
    The same output should come from a sql query only.
    Thanks in Advance
    Md Anwer Ali

    I shouldn't try to code before I have had at least three cups of coffee. The actual answer is:
    select decode(department,lag(department) over (order by department),null,department)
    , job
    from departments
    order by department.
    I ran this:
    select decode(job,lag(job) over (order by job),null,job)
    , ename
    from emp
    order by job
    and got this result:
    SQL> /
    DECODE(JO ENAME
    ANALYST SCOTT
    FORD
    CLERK SMITH
    ADAMS
    MILLER
    JAMES
    MANAGER JONES
    CLARK
    BLAKE
    PRESIDENT KING
    SALESMAN ALLEN
    MARTIN
    TURNER
    WARD
    14 rows selected.

  • Query Designer: Need help.

    Hi All,
    This is regarding query issue.
    Is this the right forum for this issue or is there a forum for that?
    Kindly tell me where should i post this kind of issue.
    BTW, below is my issue. I'm finding it hard resolving the defect.
    Needs advice on this issue.
    The user wants a record for a certain organization.
    He/she input all the required parameters.
    Let's say:
    Business leader ID: XXX01
    Begin date: 2010, 2011
    End date: 2010, 2011
    Status: Active
    After executing the report, it returns all of the necessary data records.
    But when he click on variable screen or change selection, then changes "ONLY" the Business leader ID.
    It goes:
    Business leader ID: XXY02
    Begin date: 2010, 2011
    End date: 2010, 2011
    Status: Active
    No Applicable Data were returned.
    User closes the report the reopen.
    He initially entered again with the second ID, parameters now are initially:
    Business leader ID: XXY02
    Begin date: 2010, 2011
    End date: 2010, 2011
    Status: Active
    Then necessary records were returned.
    Question: why is it not returning any data records when he/she change the Business leader ID?
    That problem arises only when Business Leader ID was being changed.
    But when he/she change selection and change the filter on Begin Date, End Date, Status, the report still provide the data.
    The report is not refreshing only when Business Leader ID was being changed.
    Thanks!

    Hi,
    You have to check it in your Bex Designer what kind of filter have given report.  I think the variable which are user entering the value in the initial screen which may for hard filter. 
    Open your query in designer and give the details of Variable screen would be very much easy to identify the issue. 
    Just try this
    V1 is the variable for  Business leader ID: XXX01  
    V2 is the variable for  Begin date: 2010, 2011
    V3 is the variable for  End date: 2010, 2011
    V4 is the variable for  Status: Active
    Except V1 variable all can be included in hard filter and Include V1 as restriction. 
    Hope this will help you to close the issue .. if you need any further assistance , please give the screen shot of your report in bex designer.
    Thanks
    BVR

  • Query Performance Tuning - Help

    Hello Experts,
    Good Day to all...
    TEST@ora10g>select * from v$version;
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE     10.2.0.4.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
    NLSRTL Version 10.2.0.4.0 - Production
    SELECT fa.user_id,
              fa.notation_type,
                 MAX(fa.created_date) maxDate,
                                      COUNT(*) bk_count
    FROM  book_notations fa
    WHERE fa.user_id IN
        ( SELECT user_id
         FROM
           ( SELECT /*+ INDEX(f2,FBK_AN_ID_IDX) */ f2.user_id,
                                                      MAX(f2.notatn_id) f2_annotation_id
            FROM  book_notations f2,
                  title_relation tdpr
            WHERE f2.user_id IN ('100002616221644',
                                          '100002616221645',
                                          '100002616221646',
                                          '100002616221647',
                                          '100002616221648')
              AND f2.pack_id=tdpr.pack_id
              AND tdpr.title_id =93402
            GROUP BY f2.user_id
            ORDER BY 2 DESC)
         WHERE ROWNUM <= 10)
    GROUP BY fa.user_id,
             fa.notation_type
    ORDER BY 3 DESC;Cost of the Query is too much...
    Below is the explain plan of the query
    | Id  | Operation                                  | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                           |                                |    29 |  1305 |    52  (10)| 00:00:01 |
    |   1 |  SORT ORDER BY                             |                                |    29 |  1305 |    52  (10)| 00:00:01 |
    |   2 |   HASH GROUP BY                            |                                |    29 |  1305 |    52  (10)| 00:00:01 |
    |   3 |    TABLE ACCESS BY INDEX ROWID             | book_notations                 |    11 |   319 |     4   (0)| 00:00:01 |
    |   4 |     NESTED LOOPS                           |                                |    53 |  2385 |    50   (6)| 00:00:01 |
    |   5 |      VIEW                                  | VW_NSO_1                       |     5 |    80 |    29   (7)| 00:00:01 |
    |   6 |       HASH UNIQUE                          |                                |     5 |    80 |            |          |
    |*  7 |        COUNT STOPKEY                       |                                |       |       |            |          |
    |   8 |         VIEW                               |                                |     5 |    80 |    29   (7)| 00:00:01 |
    |*  9 |          SORT ORDER BY STOPKEY             |                                |     5 |   180 |    29   (7)| 00:00:01 |
    |  10 |           HASH GROUP BY                    |                                |     5 |   180 |    29   (7)| 00:00:01 |
    |  11 |            TABLE ACCESS BY INDEX ROWID     | book_notations                 |  5356 |   135K|    26   (0)| 00:00:01 |
    |  12 |             NESTED LOOPS                   |                                |  6917 |   243K|    27   (0)| 00:00:01 |
    |  13 |              MAT_VIEW ACCESS BY INDEX ROWID| title_relation                         |     1 |    10 |     1   (0)| 00:00:01 |
    |* 14 |               INDEX RANGE SCAN             | IDX_TITLE_ID                   |     1 |       |     1   (0)| 00:00:01 |
    |  15 |              INLIST ITERATOR               |                                |       |       |            |          |
    |* 16 |               INDEX RANGE SCAN             | FBK_AN_ID_IDX                  |  5356 |       |     4   (0)| 00:00:01 |
    |* 17 |      INDEX RANGE SCAN                      | FBK_AN_ID_IDX                  |   746 |       |     1   (0)| 00:00:01 |
    Table Details
    SELECT COUNT(*) FROM book_notations; --111367
    Columns
    user_id -- nullable field - VARCHAR2(50 BYTE)
    pack_id -- NOT NULL --NUMBER
    notation_type--     VARCHAR2(50 BYTE)     -- nullable field
    CREATED_DATE     - DATE     -- nullable field
    notatn_id     - VARCHAR2(50 BYTE)     -- nullable field      
    Index
    FBK_AN_ID_IDX - Non unique - Composite columns --> (user_id and pack_id)
    SELECT COUNT(*) FROM title_relation; --12678
    Columns
    pack_id - not null - number(38) - PK
    title_id - not null - number(38)
    Index
    IDX_TITLE_ID - Non Unique - TITLE_ID
    Please help...
    Thanks...

    Linus wrote:
    Thanks Bravid for your reply; highly appreciate that.
    So as you say; index creation on the NULL column doesnt have any impact. OK fine.
    What happens to the execution plan, performance and the stats when you remove the index hint?
    Find below the Execution Plan and Predicate information
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 126058086"
    "| Id  | Operation                                  | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |"
    "|   0 | SELECT STATEMENT                           |                                |    25 |  1125 |    55  (11)| 00:00:01 |"
    "|   1 |  SORT ORDER BY                             |                                |    25 |  1125 |    55  (11)| 00:00:01 |"
    "|   2 |   HASH GROUP BY                            |                                |    25 |  1125 |    55  (11)| 00:00:01 |"
    "|   3 |    TABLE ACCESS BY INDEX ROWID             | book_notations                 |    10 |   290 |     4   (0)| 00:00:01 |"
    "|   4 |     NESTED LOOPS                           |                                |    50 |  2250 |    53   (8)| 00:00:01 |"
    "|   5 |      VIEW                                  | VW_NSO_1                       |     5 |    80 |    32  (10)| 00:00:01 |"
    "|   6 |       HASH UNIQUE                          |                                |     5 |    80 |            |          |"
    "|*  7 |        COUNT STOPKEY                       |                                |       |       |            |          |"
    "|   8 |         VIEW                               |                                |     5 |    80 |    32  (10)| 00:00:01 |"
    "|*  9 |          SORT ORDER BY STOPKEY             |                                |     5 |   180 |    32  (10)| 00:00:01 |"
    "|  10 |           HASH GROUP BY                    |                                |     5 |   180 |    32  (10)| 00:00:01 |"
    "|  11 |            TABLE ACCESS BY INDEX ROWID     | book_notations                 |  5875 |   149K|    28   (0)| 00:00:01 |"
    "|  12 |             NESTED LOOPS                   |                                |  7587 |   266K|    29   (0)| 00:00:01 |"
    "|  13 |              MAT_VIEW ACCESS BY INDEX ROWID| title_relation                      |     1 |    10 |     1   (0)| 00:00:01 |"
    "|* 14 |               INDEX RANGE SCAN             | IDX_TITLE_ID                   |     1 |       |     1   (0)| 00:00:01 |"
    "|  15 |              INLIST ITERATOR               |                                |       |       |            |          |"
    "|* 16 |               INDEX RANGE SCAN             | FBK_AN_ID_IDX                  |  5875 |       |     4   (0)| 00:00:01 |"
    "|* 17 |      INDEX RANGE SCAN                      | FBK_AN_ID_IDX                  |   775 |       |     1   (0)| 00:00:01 |"
    "Predicate Information (identified by operation id):"
    "   7 - filter(ROWNUM<=10)"
    "   9 - filter(ROWNUM<=10)"
    "  14 - access(""TDPR"".""TITLE_ID""=93402)"
    "  16 - access((""F2"".""USER_ID""='100002616221644' OR ""F2"".""USER_ID""='100002616221645' OR "
    "              ""F2"".""USER_ID""='100002616221646' OR ""F2"".""USER_ID""='100002616221647' OR "
    "              ""F2"".""USER_ID""='100002616221648') AND ""F2"".""PACK_ID""=""TDPR"".""PACK_ID"")"
    "  17 - access(""FA"".""USER_ID""=""$nso_col_1"")"
    The cost is the same because the plan is the same. The optimiser chose to use that index anyway. The point is, now that you have removed it, the optimiser is free to choose other indexes or a full table scan if it wants to.
    >
    Statistics
    BEGIN
    DBMS_STATS.GATHER_TABLE_STATS ('TEST', 'BOOK_NOTATIONS');
    END;
    "COLUMN_NAME"     "NUM_DISTINCT"     "NUM_BUCKETS"     "HISTOGRAM"
    "NOTATION_ID"     110269     1     "NONE"
    "USER_ID"     213     212     "FREQUENCY"
    "PACK_ID"     20     20     "FREQUENCY"
    "NOTATION_TYPE"     8     8     "FREQUENCY"
    "CREATED_DATE"     87     87     "FREQUENCY"
    "CREATED_BY"     1     1     "NONE"
    "UPDATED_DATE"     2     1     "NONE"
    "UPDATED_BY"     2     1     "NONE"
    After removing the hint ; the query still shows the same "COST"
    Autotrace
    recursive calls     1
    db block gets     0
    consistent gets     34706
    physical reads     0
    redo size     0
    bytes sent via SQL*Net to client     964
    bytes received via SQL*Net from client     1638
    SQL*Net roundtrips to/from client     2
    sorts (memory)     3
    sorts (disk)     0
    Output of query
    "USER_ID"     "NOTATION_TYPE"     "MAXDATE"     "COUNT"
    "100002616221647"     "WTF"     08-SEP-11     20000
    "100002616221645"     "LOL"     08-SEP-11     20000
    "100002616221644"     "OMG"     08-SEP-11     20000
    "100002616221648"     "ABC"     08-SEP-11     20000
    "100002616221646"     "MEH"     08-SEP-11     20000Thanks...I still don't know what we're working towards at the moment. WHat is the current run time? What is the expected run time?
    I can't tell you if there's a better way to write this query or if indeed there is another way to write this query because I don't know what it is attempting to achieve.
    I can see that you're accessing 100k rows from a 110k row table and it's using an index to look those rows up. That seems like a job for a full table scan rather than index lookups.
    David

  • Access SQL Query Problem - Pls help

    Hi,
    I'm connecting to an Access database and have a query which looks somehting like this:
    SELECT Accept.ACCEPT_NO,
         Accept.CURRENCY,
         Accept.INT_RATE,
         Accept.F_AMOUNT,
         Accept.DEALER,
         Accept.MATURITY,
         Accept.START_DATE,
         Accept.DEAL_DATE,
         Accept.DEALTICKET,
         Accept.BANK_NAME,
         Accept.CALC_DAYS,
         "2001/11/22" AS CurrentDate
    FROM Accept;
    It works fine without the line with CurrentDate so i'm sure something's wrong there. What i want to do is set CurrentDate as a constant ("2001/11/22") i dont have any experience with Access so any help you could give me would be greatly appreciated.
    Thanx in advance.

    I was able to successfully query an access 97 database using the following SQL:
    String sql = "SELECT emp.emp_fname, emp.emp_lname, '2001/11/22' AS CurrentDate FROM emp";don't know why your's wouldn't work. Was there a SQLException? Or are you trying to get it to work using the Access SQL editor?
    Jamie

  • Query using binding help?!?!

    I am fairly new to the world of SQL and I am having a problem with a query using binding. I am using SQL Developer (3.1.07).
    If I run the query with no bindings, everything works fine. On normal occasions I run this query on the day I want my totals and I achieve my desired results:
    SELECT SA.CRAFT,nvl(SUM (SA.LABORHRS),0) as "Loaded Hours"
    FROM SOL_SCHEDULEBASELINEWOASGMNT SA
    LEFT JOIN SOL_SCHEDULEBASELINE SB ON SB.BASELINEID = SA.BASELINEID
    WHERE SB.DATECODE = 'DAILY'
    AND TO_CHAR(SB.FROMDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    AND TO_CHAR(SB.TODATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    AND TO_CHAR(SA.SCHEDULEDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    group by sa.craft
    order by sa.craft asc
    CRAFT     Loaded Hours
    CONTR.     24
    MM     12
    MT     6
    BUT* I want to be able to enter my own date instead of using sysdate. This will be for if I miss running this for a day, am asked for the values from a previous date, etc...
    The value will always be the same date for all three date fields(SB.FROMDATE,SB.TODATE,SA.SCHEDULEDATE)
    I've modified the query to here and the query still works great at this stage: (I'm using 01-APR-2012 in my binding...)
    SELECT SA.CRAFT,nvl(SUM (SA.LABORHRS),0) as "Loaded Hours"
    FROM SOL_SCHEDULEBASELINEWOASGMNT SA
    LEFT JOIN SOL_SCHEDULEBASELINE SB ON SB.BASELINEID = SA.BASELINEID
    WHERE SB.DATECODE = 'DAILY'
    AND SB.FROMDATE = :DDMONYYYY
    AND SB.TODATE = :DDMONYYYY
    AND TO_CHAR(SA.SCHEDULEDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    group by sa.craft
    order by sa.craft asc
    CRAFT     Loaded Hours
    CONTR.     24
    MM     12
    MT     6
    The instant I change my query to the following I get a different result:
    SELECT SA.CRAFT,nvl(SUM (SA.LABORHRS),0) as "Loaded Hours"
    FROM SOL_SCHEDULEBASELINEWOASGMNT SA
    LEFT JOIN SOL_SCHEDULEBASELINE SB ON SB.BASELINEID = SA.BASELINEID
    WHERE SB.DATECODE = 'DAILY'
    AND SB.FROMDATE = :DDMONYYYY
    AND SB.TODATE = :DDMONYYYY
    AND SA.SCHEDULEDATE = :DDMONYYYY
    group by sa.craft
    order by sa.craft asc
    CRAFT     Loaded Hours
    CONTR.     10
    All columns have a data_type of Date.
    As soon as I change SA.SCHEDULEDATE from
    AND TO_CHAR(SA.SCHEDULEDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    to
    SA.SCHEDULEDATE = :DDMMYYYY
    it stops returning the results I need.
    Why is this? Does anyone have an idea of what is going on here? Any help would be GREATLY appreciated!
    Thank You

    Cook wrote:
    I am fairly new to the world of SQL and I am having a problem with a query using binding. I am using SQL Developer (3.1.07).
    If I run the query with no bindings, everything works fine. On normal occasions I run this query on the day I want my totals and I achieve my desired results:
    SELECT SA.CRAFT,nvl(SUM (SA.LABORHRS),0) as "Loaded Hours"
    FROM SOL_SCHEDULEBASELINEWOASGMNT SA
    LEFT JOIN SOL_SCHEDULEBASELINE SB ON SB.BASELINEID = SA.BASELINEID
    WHERE SB.DATECODE = 'DAILY'
    AND TO_CHAR(SB.FROMDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    AND TO_CHAR(SB.TODATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    AND TO_CHAR(SA.SCHEDULEDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    group by sa.craft
    order by sa.craft asc
    CRAFT     Loaded Hours
    CONTR.     24
    MM     12
    MT     6
    BUT* I want to be able to enter my own date instead of using sysdate. This will be for if I miss running this for a day, am asked for the values from a previous date, etc...
    The value will always be the same date for all three date fields(SB.FROMDATE,SB.TODATE,SA.SCHEDULEDATE)
    I've modified the query to here and the query still works great at this stage: (I'm using 01-APR-2012 in my binding...)
    SELECT SA.CRAFT,nvl(SUM (SA.LABORHRS),0) as "Loaded Hours"
    FROM SOL_SCHEDULEBASELINEWOASGMNT SA
    LEFT JOIN SOL_SCHEDULEBASELINE SB ON SB.BASELINEID = SA.BASELINEID
    WHERE SB.DATECODE = 'DAILY'
    AND SB.FROMDATE = :DDMONYYYY
    AND SB.TODATE = :DDMONYYYY
    AND TO_CHAR(SA.SCHEDULEDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    group by sa.craft
    order by sa.craft asc
    CRAFT     Loaded Hours
    CONTR.     24
    MM     12
    MT     6
    The instant I change my query to the following I get a different result:
    SELECT SA.CRAFT,nvl(SUM (SA.LABORHRS),0) as "Loaded Hours"
    FROM SOL_SCHEDULEBASELINEWOASGMNT SA
    LEFT JOIN SOL_SCHEDULEBASELINE SB ON SB.BASELINEID = SA.BASELINEID
    WHERE SB.DATECODE = 'DAILY'
    AND SB.FROMDATE = :DDMONYYYY
    AND SB.TODATE = :DDMONYYYY
    AND SA.SCHEDULEDATE = :DDMONYYYY
    group by sa.craft
    order by sa.craft asc
    CRAFT     Loaded Hours
    CONTR.     10
    All columns have a data_type of Date.
    As soon as I change SA.SCHEDULEDATE from
    AND TO_CHAR(SA.SCHEDULEDATE, 'DD-MON-YYYY') = TO_CHAR(SYSDATE, 'DD-MON-YYYY')
    to
    SA.SCHEDULEDATE = :DDMMYYYY
    it stops returning the results I need.
    Why is this? Does anyone have an idea of what is going on here? Any help would be GREATLY appreciated!
    Thank YouWhat are the datatypes involved?
    It is likely that you are being impacted by implicit datatype conversion.
    Realize that you can only enter strings; so you need to use TO_DATE() to convert string to DATE.

  • Query Output Formatting Help

    Hello All,
    I'm having problems trying to format the output of one of my queries. I'm new to SQL and I consider my writing the query a HUGE win.... but I can't seem to get the correct output format.
    Per the code below, it is outputting the Last Name (lname) of the employee, a count of what I want, and the overall rank.  I would like to concatenate the employee number (emp#) the first (fname) and last name (lname) together into the same column in the output.
    The concatenation code would be something like the below.
    Desired concatenation:
    emp# || ' - ' || lname || ', ' || fname AS EMPLOYEE
    I'm using Oracle 11g Express. Please let me know if you need any supporting information to assist you.
    I appreciate all your help!!! Thank you.
    Query
    SELECT EMPLOYEE, PREPARED,
    RANK() OVER (ORDER BY Prepared DESC) AS rank
    FROM (SELECT lname EMPLOYEE , COUNT(DISTINCT reportnum) PREPARED
          FROM employee
          LEFT OUTER JOIN faultreport USING (empno)
          GROUP BY lname
          ORDER BY Prepared DESC)
    WHERE rownum < 15;

    Hi,
    8bb7968b-e6ae-456c-8459-f418352e9e0a wrote:
    Hello All,
    I'm having problems trying to format the output of one of my queries. I'm new to SQL and I consider my writing the query a HUGE win.... but I can't seem to get the correct output format.
    Per the code below, it is outputting the Last Name (lname) of the employee, a count of what I want, and the overall rank.  I would like to concatenate the employee number (emp#) the first (fname) and last name (lname) together into the same column in the output.
    The concatenation code would be something like the below.
    Desired concatenation:
    emp# || ' - ' || lname || ', ' || fname AS EMPLOYEE
    I'm using Oracle 11g Express. Please let me know if you need any supporting information to assist you.
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    I appreciate all your help!!! Thank you.
    Query
    SELECT EMPLOYEE, PREPARED,
    RANK() OVER (ORDER BY Prepared DESC) AS rank
    FROM (SELECT lname EMPLOYEE , COUNT(DISTINCT reportnum) PREPARED
          FROM employee
          LEFT OUTER JOIN faultreport USING (empno)
          GROUP BY lname
          ORDER BY Prepared DESC)
    WHERE rownum < 15;
    It looks like you've found the right way to concatenate the columns.  How to use that in your query depends on your data, and what you want the query to do with that data.
    If you GROUP BY lname, what do you want the concatenated value to be when different rows having the same lname have different fnames and/or emp#s?
    Do you want to GROUP BY the new concatenated employee instead of lname?

  • Query Performance Please Help

    Hi can any body tell me how do I improve the performance of this query.This query takes forever to execute.
    PLEASE HELP
    select substr(d.name,1,14) "dist",
    sum(r.room_net_sq_foot) "nsf",
    sum(r.student_station_count) "sta",
    sum(distinct(r.cofte)) "fte"
    from b_fish_report r,
    g_efis_organization d
    where substr(r.organization_code,-2,2) = substr(d.code,-2,2) and
    d.organization_type = 'CNTY' and
    r.room_satisfactory_flag = 'Y' and
    substr(d.code,-2,2) between '01' and '72'
    -- rownum < 50
    group by d.name, r.organization_code
    order by d.name
    It has nonunique Indexes on Organization code
    Thanks
    Asma.

    Asma,
    I tried your SQL on my tables T1 and T2. Indexes are on C1,C2,C3 and N1,N2,N3. The data in T1 and T2 are shown below with the explain plan (also called EP) listed. You really need to do an explain plan (free TOAD is easiest to do this in) and respond showing your EP results.
    By simply changing the optimizer mode to RULE I was able to get it to use indexes on both T1 and T2.
    T1 data
    C1     C2     C3     N1     N2
    001     Y     AAA     1     11
    002     Y     BBB     2     22
    003     Y     CCC     3     33
    111     N     DDD     4     44
    222     N     EEE     5     55
    333     Y     FFF     6     66
    070     Y     GGG     7     77
    071     N     HHH     8     88
    072     Y     III     9     99
    TEST     TEST     TEST     10     100
    T2 data
    C1     C2     C3     N1     N2
    001     CNTY     AAA     1     11
    002     CNTY     BBB     2     22
    003     CNTY     CCC     3     33
    111     XXX     DDD     4     44
    222     XXX     EEE     5     55
    333     CNTY     FFF     6     66
    070     CNTY     GGG     7     77
    071     XXX     HHH     8     88
    072     CNTY     III     9     99
    TEST     TEST     TEST     10     100
    This is the results when I run the SQL based on this data ...
    dist     nsf     sta     fte
    AAA     1     11     10
    BBB     2     22     20
    CCC     3     33     30
    FFF     6     66     60
    GGG     7     77     70
    III     9     99     90
    --[SQL 1] : with CHOOSE as the optimizer mode, which is normally the DEFAULT if no hint is specified
    select /*+ CHOOSE */
    substr(d.c3,1,14) "dist",
    sum(r.n1) "nsf",
    sum(r.n2) "sta",
    sum(distinct(r.n3)) "fte"
    from t1 r, t2 d
    where substr(r.c1,-2,2) = substr(d.c1,-2,2) and
    d.c2 = 'CNTY' and
    r.c2 = 'Y' and
    substr(d.c1,-2,2) between '01' and '72'
    group by d.c3, r.c1
    order by d.c3
    This is what the EP shows for your SQL (which will probably be the same for you once you do an EP on your actuall sql) ...
    SELECT STATEMENT Optimizer=CHOOSE (Cost=4 Card=1 Bytes=37)
    SORT (GROUP BY) (Cost=4 Card=1 Bytes=37)
    NESTED LOOPS (Cost=2 Card=1 Bytes=37)
    TABLE ACCESS (FULL) OF T1 (Cost=1 Card=1 Bytes=12)
    TABLE ACCESS (BY INDEX ROWID) OF T2 (Cost=1 Card=1 Bytes=25)
    INDEX (RANGE SCAN) OF I_NU_T2_C2 (NON-UNIQUE)
    Notice the FULL table scan of T1 which you don't want, and neither C1 index is getting used (I've explained why below).
    --[SQL 2] : only changed the hint to RULE ...
    select /*+ RULE */
    substr(d.c3,1,14) "dist",
    sum(r.n1) "nsf",
    sum(r.n2) "sta",
    sum(distinct(r.n3)) "fte"
    from t1 r, t2 d
    where substr(r.c1,-2,2) = substr(d.c1,-2,2) and
    d.c2 = 'CNTY' and
    r.c2 = 'Y' and
    substr(d.c1,-2,2) between '01' and '72'
    group by d.c3, r.c1
    order by d.c3
    SELECT STATEMENT Optimizer=HINT: RULE
    SORT (GROUP BY)
    NESTED LOOPS
    TABLE ACCESS (BY INDEX ROWID) OF T2
    INDEX (RANGE SCAN) OF I_NU_T2_C2 (NON-UNIQUE)
    TABLE ACCESS (BY INDEX ROWID) OF T1
    INDEX (RANGE SCAN) OF I_NU_T1_C2 (NON-UNIQUE)
    Though the C2 index is getting used (your r.c2 = 'Y' part in the where clause) the main problem your having here is the JOIN column (C1 in both tables) is not getting used. So the join you have ...
    where substr(r.c1,-2,2) = substr(d.c1,-2,2)
    isn't using an index and you want it too. There are 2 solutions to correct this..
    Solution #1
    The first is to make a function-based index for data. Since your doing SUBSTR on C1 that C1 index does not contain that partial information so it will not use it. Below is the syntax to make a function based index for this partial data ...
    CREATE INDEX I_NU_T1_C1_SUBSTR ON T1 (SUBSTR(C1,-2,2));
    CREATE INDEX I_NU_T2_C1_SUBSTR ON T2 (SUBSTR(C1,-2,2));
    or also this way if it's still not using the above indexes ...
    CREATE INDEX I_NU_T1_C1_SUBSTR ON T1 (SUBSTR(C1,-2,2),C1);
    CREATE INDEX I_NU_T2_C1_SUBSTR ON T2 (SUBSTR(C1,-2,2),C1);
    Solution #2
    The second solution is to make another column in both table and place this 2 digit information in it, and then index this new column. That way the join will look like ...
    where r.c_new_column = d.c_new_column
    and
    r.c_new_column between '01' and '72'
    also with this new column the BETWEEN clause at the end you will not need the substring as well. Also remember BETWEEN on character values is different than numbers.
    Final Notes
    I just tried creating the functional index and I can't get it to be used it for some reason (I might not have the right amount of data), but I really think that is your best option here. As long as it uses the functional index you won't have to change your code. You might want to try using INDEX() in the hint to get it to be used, but hopefully it will use it right away. Try all 4 types of optimizer modes (CHOOSE, RULE, ALL_ROWS, FIRST_ROWS) in your primary hints to see if it will use the new function-based index.
    You really do need to get explain plan going. Even if you make these functional indexes you won't know if its going to be using them until you look at the EP results. You can do EP manually (the SQL of how to produce the results is in OTN, though I find free TOAD is by far the easiest) and you will still need to have run the utlxplan.sql script. Oracle I do think has some GUI tools, maybe in OEM, that have explain plan built in as well.
    I hope this helps ya,
    Tyler D.

  • Query Performance COST - HELP

    Hello Experts,
    Please help me how the table "digital_compatibility" be modified for faster performance?
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Productio
    NLSRTL Version 10.2.0.1.0 - Production
    Count of records for the tables:-
    SELECT count(*) FROM DEVICE_TYPE; --421
    SELECT count(*) FROM DIGITAL_COMPATIBILITY; --227757
    CREATE TABLE  DEVICE_TYPE
         DEVICE_TYPE_ID          NUMBER(38,0),
         DEVICE_TYPE_MAKE        VARCHAR2(256 BYTE),
         DEVICE_TYPE_MODEL       VARCHAR2(256 BYTE),
         DEVICE_DISPLAY_NAME     VARCHAR2(256 BYTE),
         PARTNER_DEVICE_TYPE     VARCHAR2(256 BYTE),
         DEVICE_IMAGE_URL        VARCHAR2(256 BYTE),
         FOH_BUTTON_NAME         VARCHAR2(256 BYTE),
         FOH_ACTIVE_FLAG         CHAR(1 BYTE),
         BB_RETAIL_FLAG          CHAR(1 BYTE),
         DISPLAY_DESCRIPTION     VARCHAR2(256 BYTE),
         DEVICE_CATEGORY_ID      NUMBER(38,0),
         DEVICE_SUB_CATEGORY_ID  NUMBER(38,0),
         DEVICE_BRAND_ID         NUMBER(38,0),
         PARENT_ID               NUMBER(38,0),
         POWERED_BY              VARCHAR2(256 BYTE),
         CARRIER                 VARCHAR2(256 BYTE),
         CAPABILITY_SET_ID       NUMBER(38,0),
         CREATED_BY              VARCHAR2(32 BYTE),
         CREATED_DATE  DATE,
         UPDATED_BY  VARCHAR2(32 BYTE),
         UPDATED_DATE  DATE,
         POWERED_BY_DEVICE_TYPE    VARCHAR2(64 BYTE),
         OPERATING_SYSTEM          VARCHAR2(32 BYTE),
         OPERATING_SYSTEM_VERSION  VARCHAR2(32 BYTE),
         BROWSER                   VARCHAR2(32 BYTE),
         BROWSER_VERSION           VARCHAR2(32 BYTE),
         CLASSIFICATION            VARCHAR2(32 BYTE),
        CONSTRAINT  PK_DEVICE_TYPE  PRIMARY KEY ( DEVICE_TYPE_ID));
    CREATE INDEX  DEVICE_TYPE_IDX  ON  DEVICE_TYPE
         CAPABILITY_SET_ID ,
        UPPER( PARTNER_DEVICE_TYPE )
    CREATE TABLE DIGITAL_COMPATIBILITY
        DIGITAL_COMPATIBILITY_ID NUMBER NOT NULL ENABLE,
        CAPABILITY_SET_ID        NUMBER,
        OBJECT_TYPE              VARCHAR2(38 BYTE) NOT NULL ENABLE,
        CREATED_DATE DATE NOT NULL ENABLE,
        CREATED_BY VARCHAR2(38 BYTE) NOT NULL ENABLE,
        UPDATED_DATE DATE NOT NULL ENABLE,
        UPDATED_BY        VARCHAR2(38 BYTE) NOT NULL ENABLE,
        OBJECT_ID         VARCHAR2(114 BYTE),
        ENCODE_PROFILE_ID NUMBER
    CREATE INDEX ENCODE_PROFILE_ID_IDX ON DIGITAL_COMPATIBILITY
        ENCODE_PROFILE_ID,
        OBJECT_ID,
        OBJECT_TYPE
             Query
    =====
    EXPLAIN PLAN FOR
    SELECT  /*+ INDEX(dc, ENCODE_PROFILE_ID_IDX) */
    DISTINCT dc.object_id AS title_id
    FROM digital_compatibility dc,
      device_type dt
    WHERE dc.capability_set_id        = dt.capability_set_id
    AND upper(dt.partner_device_type) = :1
    AND dc.object_id                 IN (:2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29, :30, :31, :32, :33)
    AND dc.object_type                =:"SYS_B_0";
                                 Explain plan
    | Id  | Operation                       | Name                  | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT                |                       |     2 |   472 |   274   (4)|
    |   1 |  HASH UNIQUE                    |                       |     2 |   472 |   274   (4)|
    |*  2 |   MAT_VIEW ACCESS BY INDEX ROWID| DIGITAL_COMPATIBILITY |     1 |    93 |    68   (3)|
    |   3 |    NESTED LOOPS                 |                       |     2 |   472 |   273   (4)|
    |*  4 |     INDEX FULL SCAN             | DEVICE_TYPE_IDX       |     4 |   572 |     1   (0)|
    |*  5 |     INDEX FULL SCAN             | ENCODE_PROFILE_ID_IDX |     8 |       |    67   (3)|
    Predicate Information (identified by operation id):
       2 - filter("DC"."CAPABILITY_SET_ID"="DT"."CAPABILITY_SET_ID")
       4 - access(UPPER("PARTNER_DEVICE_TYPE")=:1)
           filter(UPPER("PARTNER_DEVICE_TYPE")=:1)
       5 - access("DC"."OBJECT_TYPE"=:SYS_B_0)
           filter(("DC"."OBJECT_ID"=:2 OR "DC"."OBJECT_ID"=:3 OR "DC"."OBJECT_ID"=:4 OR
                  "DC"."OBJECT_ID"=:5 OR "DC"."OBJECT_ID"=:6 OR "DC"."OBJECT_ID"=:7 OR
                  "DC"."OBJECT_ID"=:8 OR "DC"."OBJECT_ID"=:9 OR "DC"."OBJECT_ID"=:10 OR
                  "DC"."OBJECT_ID"=:11 OR "DC"."OBJECT_ID"=:12 OR "DC"."OBJECT_ID"=:13 OR
                  "DC"."OBJECT_ID"=:14 OR "DC"."OBJECT_ID"=:15 OR "DC"."OBJECT_ID"=:16 OR
                  "DC"."OBJECT_ID"=:17 OR "DC"."OBJECT_ID"=:18 OR "DC"."OBJECT_ID"=:19 OR
                  "DC"."OBJECT_ID"=:20 OR "DC"."OBJECT_ID"=:21 OR "DC"."OBJECT_ID"=:22 OR
                  "DC"."OBJECT_ID"=:23 OR "DC"."OBJECT_ID"=:24 OR "DC"."OBJECT_ID"=:25 OR
                  "DC"."OBJECT_ID"=:26 OR "DC"."OBJECT_ID"=:27 OR "DC"."OBJECT_ID"=:28 OR
                  "DC"."OBJECT_ID"=:29 OR "DC"."OBJECT_ID"=:30 OR "DC"."OBJECT_ID"=:31 OR
                  "DC"."OBJECT_ID"=:32 OR "DC"."OBJECT_ID"=:33) AND "DC"."OBJECT_TYPE"=:SYS_B_0)
    Note
       - 'PLAN_TABLE' is old version
                               Trace
    recursive calls     280
    db block gets     16
    consistent gets     97
    physical reads     0
    redo size     3224
    bytes sent via SQL*Net to client     589
    bytes received via SQL*Net from client     1598
    SQL*Net roundtrips to/from client     2
    sorts (memory)     4
    sorts (disk)     0
                            Thanks ....

    You index on DIGITAL_COMPATIBILITY is on ENCODE_PROFILE_ID, OBJECT_ID, OBJECT_TYPE
    But you query for object_id and object_type.
    How much rows you you identify with this? What the PK?
    The way it's now, it needs to read the full index, then the table and as DEVICE_TYPE is small it makes a NL to it.
    Makes sense.
    If you would add an index on OBJECT_ID, OBJECT_TYPE and capability_set_id ORACLE would just need to read the INDEX.

  • Query on Decode --help reqd

    Hi
    I am executing a query:
    select vetno,category from vetno where vetno.category IN (select decode (REP_VET_CATG,NULL,'('A','B')','REP_VET_CATG') from dual);
    The REP_VET_CATG variable takes the value from the GUI.
    I want the functionality such that if it is NULL then the query should be
    select vetno,category from vetno where vetno.category IN ('A','B');
    else
    Take the values that is passed i.e the query should be like this
    select vetno,category from vetno where vetno.category = 'REP_VET_CATG';
    I tried the above query but it gives me a error missing right paranthesis.
    Can anyone help ......with this OR suggest a better alternative..

    Do you mean this?
    SQL> create table vetno
      2  as
      3  select 1 vetno, 'A' category from dual union all
      4  select 2, 'B' from dual union all
      5  select 3, 'C' from dual
      6  /
    Tabel is aangemaakt.
    SQL> var REP_VET_CATG varchar2(1)
    SQL> exec :REP_VET_CATG := null
    PL/SQL-procedure is geslaagd.
    SQL> select vetno
      2       , category
      3    from vetno
      4   where (   :REP_VET_CATG is null
      5         and vetno.category in ('A','B')
      6         )
      7      or (   :REP_VET_CATG is not null
      8         and vetno.category = :REP_VET_CATG
      9         )
    10  /
                                     VETNO C
                                         1 A
                                         2 B
    2 rijen zijn geselecteerd.
    SQL> exec :REP_VET_CATG := 'C'
    PL/SQL-procedure is geslaagd.
    SQL> select vetno
      2       , category
      3    from vetno
      4   where (   :REP_VET_CATG is null
      5         and vetno.category in ('A','B')
      6         )
      7      or (   :REP_VET_CATG is not null
      8         and vetno.category = :REP_VET_CATG
      9         )
    10  /
                                     VETNO C
                                         3 C
    1 rij is geselecteerd.Regards,
    Rob.

Maybe you are looking for