Oracle Query in forms

select bleed_end_time
from units@qlab
where unit_id = 'W039712003127'
BLEED_END_TIME
1/17/2012 8:10:00 AM
from the system time I have to get the elapsed time (system time - bleed_end_time)
As the unit_id and product_code is entered, we find the bleed_end_time for the unit.
Considering the system time, get the elapsed time. If elapsed time less than 30 minutes from bleed_end_time, the time_from_collection has to display in red, 30 minutes to 7:59 will display in green, time greater than 8 hours will display in red. Need help in getting these conditions.
SET_ITEM_PROPERTY('TIME_FROM_COLLECTION',VISUAL_ATTRIBUTE,'VA_RED');
I need help in the if conditions.

Google (or really, any Internet Search tool) is your friend. What you really need is to figure out how to perform date and time calculations. A quick Google search gave me numerous hits. Here are a few:
Date/Time Arithmetic with Oracle
Oracle / PLSQL Date Functions
Operating on Oracle Dates and Date Functions
If these don't help, do an Internet search on "oracle date functions and calculations" for more options.
Craig...

Similar Messages

  • How to Implement KFF Range (Low and High) in query find form in oracle apps

    Hi,
    Please provide some sample script for using KFF range LOV (Low and High) in one of the query find form in Oracle apps R12.
    I need to customize one of the standard form and add this range functionality for that search form.
    Thanks,
    Prasanna

    Yuvaraaj,
    Your request is unique to the Oracle Enterprise Business Suite (EBS). Please post your question in the General EBS Discussion forum. If you have a general Forms question, by all means, ask it here! ;-)
    Craig...

  • Issue in Enter Query mode (F11) is not changing color to blue in oracle apps custom form 10g

    Experts,
    I have created a custom form , everything is working fine but when i pressed on the oracle apps custom form ( F11)  then its not changing the form color to blue.
    I have already done below setup but nothing is working fine :-
    1.APP_STANDARD.EVENT('WHEN-NEW-RECORD-INSTANCE'); at your block level Trigger.
    2.Execution Hierarchy Property to "Before" or "After" at block level trigger.
    Could anyone help on this.

    please compile the CUSTOM form and retest the issue
    $ frmcmp_batch.sh module=<form name>.fmb userid=apps/<apps password> output_file=$CUSTOM_TOP/forms/US/<form name>.fmx module_type=form compile_all=special
    AppsMasti
    shairng is Caring

  • Query on Forms Personalization of Oracle Assignment Form

    Hi All,
    My customer has a requirement of personalization on the Assignment form. They would like to show the People group flex field segments but make them non-editable.
    Since the People Group is a KFF, I am unable to figure out how to personalize this. If any of you has done this with any KFF, could you please let me know the steps to follow?
    Thank you.
    Regards,
    Prathima.

    Balamurugan wrote:
    We are migrating Oracle forms 4.5 to oracle 10g. We have following apporaches.
         1. Oracle 4.5-->6i-->10g, In this what are benefits of migrating into intermediate version.Oracle's migration path is 4.5, 6i, 10g it is more logical to migrate using this path and it is recommended by Oracle, the obsolete built-ins would be pointed out at compilation and fixes would be more automated and simple since Forms 6i was designed to accept migration from 4.5 and the internal design of the forms will be much more adaptable to later releases.
         2. if we migrating into intermediate version 6i, do we need to fix all the errors before moving to 6i.It would be better and easier to fix things in Forms 6i rather than 10g, you can leave them and than you'll have to fix them under 10g.
         3. if no, do we lose any functionlity while migrating to 10g.Functionality built on obsolete built-ins and commands will be lost, you are more likely to face bugs.
         4. Does Oracle support direct migration to 10g?Oracle's official migration path is 4.5 to 6i to 10g
         5. if we open oracle 4.5 form in 10g form builder, do we lose any functionality? do we need to lot manual replacement?It all depends on your application size and features. I suggest you migrate to Forms 6i first and than to 10g although you can do it directly to 10g since Forms 6i is no longer supported.
    I personally rather follow the recommended path and use Oracle support in 10g migration.
    For more Forms migration information check out [Forms Upgrade Center|http://www.oracle.com/technology/products/forms/htdocs/upgrade/index.html] .
    Tony

  • LOV & Query in Forms 10g not working

    Hi All,
    I have a strange problem with custom forms that i am developing using Dev Suite 10g (10.1.2) for Oracle AS 10g (10.1.2.0.2).
    When i test the form in DevSuite the LOVs in the form are working properly, but after i deploy the form on the server and use the default config the LOVs stop showing up.
    The same happens with Execute Query. There is no error message displayed either.
    Since the jiniitator was downloaded from the same server, so that cannot be the problem.
    The version of java used is also the same, 1.4.2.
    I have no idea why the forms are behaving like this on the server. Any help would be great.
    Thanks in advance,
    Arun

    I was able to get the trace file from the FRD.
    Please see below for the trace file of the form.
    trace.xml
    - <FORMSTRACE>
    <CollectionName>/u01/oracle/ias10g/bif/forms/trace/forms_23684.trc</CollectionName>
    ***TRACE STARTED BY EM***
    - <Form>
    <FormID>1</FormID>
    <Name>TPA_HEADER(1)</Name>
    </Form>
    - <Form.START Name="TPA_HEADER">
    <EventID>3</EventID>
    <EventNum>64</EventNum>
    <Timestamp>688001334</Timestamp>
    - <Details>
    <Name>TPA_HEADER</Name>
    <FormName>TPA_HEADER(1)</FormName>
    </Details>
    </Form.START>
    - <NETWORK.READ>
    <EventID>4</EventID>
    <EventNum>133</EventNum>
    <Timestamp>688014994</Timestamp>
    <EndEvent>7</EndEvent>
    <Duration>0</Duration>
    - <Details>
    <Packets>1</Packets>
    <Bytes>0</Bytes>
    </Details>
    </NETWORK.READ>
    - <MENU_SELECT Name="DEFAULT.Query.eXecute">
    <EventID>5</EventID>
    <EventNum>33</EventNum>
    <Timestamp>688014994</Timestamp>
    - <Details>
    <FormName>TPA_HEADER(1)</FormName>
    <Type>DEFAULT</Type>
    <Menu>Query</Menu>
    <Item>eXecute</Item>
    </Details>
    </MENU_SELECT>
    - <TRIGGER.START Name="TPA_HEADER(1).KEY-EXEQRY">
    <EventID>6</EventID>
    <EventNum>66</EventNum>
    <Timestamp>688014994</Timestamp>
    - <Details>
    <Block>TPA_HEADER</Block>
    <Item>(Null)</Item>
    <Name>KEY-EXEQRY</Name>
    <FormName>TPA_HEADER(1)</FormName>
    </Details>
    </TRIGGER.START>
    - <NETWORK.WRITE>
    <EventID>7</EventID>
    <EventNum>133</EventNum>
    <Timestamp>688014994</Timestamp>
    <StartEvent>4</StartEvent>
    <Duration>0</Duration>
    - <Details>
    <Packets>1</Packets>
    <Bytes>0</Bytes>
    </Details>
    </NETWORK.WRITE>
    - <NETWORK.READ>
    <EventID>8</EventID>
    <EventNum>133</EventNum>
    <Timestamp>688019034</Timestamp>
    <EndEvent>10</EndEvent>
    <Duration>0</Duration>
    - <Details>
    <Packets>16</Packets>
    <Bytes>0</Bytes>
    </Details>
    </NETWORK.READ>
    - <MENU_SELECT Name="DEFAULT.Help.display Error">
    <EventID>9</EventID>
    <EventNum>33</EventNum>
    <Timestamp>688019034</Timestamp>
    - <Details>
    <FormName>TPA_HEADER(1)</FormName>
    <Type>DEFAULT</Type>
    <Menu>Help</Menu>
    <Item>display Error</Item>
    </Details>
    </MENU_SELECT>
    - <NETWORK.WRITE>
    <EventID>10</EventID>
    <EventNum>133</EventNum>
    <Timestamp>688019034</Timestamp>
    <StartEvent>8</StartEvent>
    <Duration>0</Duration>
    - <Details>
    <Packets>1</Packets>
    <Bytes>0</Bytes>
    </Details>
    </NETWORK.WRITE>
    </FORMSTRACE>
    Message was edited by:
    arunm

  • Is there any difference in oracle database and forms database

    i want to know is there any difference in oracle database and forms 6i database
    ,if i import some file through oracle database then same data will exist in forms database or not
    thanks

    Oracle Forms is a Rapid Application Development (RAD) tool not a database. With Forms, you connect to an Oracle database to query and display data from the database as well as insert new or update existing data. Consequently, if exists in the database - you should be able to display it in a Form.
    Craig...

  • From Clause query with form variables

    forms 9.0.4 rdbms 9.2
    Is it possible to create a From Clause query with form variables generated from another block (but in the same form)? I am not having any success.
    I searched Metalink. It appears that according to DOC ID # 69884.1, in Forms 6i, this is not possible. Metalink suggest in DOC ID 104771.1 implementating a dynamic From Clause, but when I duplicate the example on my system, I receive an Oracle error. Further investigation from the web form (DISPLAY ERROR) indicates that the system does not see the dynamic value.
    Has anyone else run into this error? Has this been fixed in forms 9.0.4 and I am just missing something? Does a dynamic from clause query work? Can anyone point me to an example or post an example or offer any advise.
    thanks in advance

    As far as I know it is not possible to use block items in a from clause query in forms 9.0.4. Here is my solution for a From-Clause-Query via the 'Query-Data-Source-Name-Property':
    To use the values of the block items in my from clause query I implemented a database package with getter and setter routines for the block item values I needed for the query.
    In the Key-Exeqry-Trigger of the From-Clause-Query-Block I set the global package variables with values of the block-items I am interested in. In the From-Clause-Query I used the values in the where-clause via package functions which return the global package variables.
    Hope my solution will work for your problem.

  • Cannot query in forms when using headstart menu

    When we Generate forms from designer6i and run them without a menu, we can
    query in forms.
    When we generate a menu from desinger6i and attach it to the forms we cannot
    query in forms.
    We have set back the original objectlibrary and generated again. This does not
    help. May be it is some preference which is not correct.
    Please help.

    Daud,
    Could you give more details on your problem?
    - designer version
    - developer version
    - headstart version & additional patch numbers
    - did you get the headstart demo up and running, does the problem occur there also?
    - if not, can you generate the headstart demo components from designer to reproduce the error?
    Regards, Marc
    Oracle - Headstart Team

  • 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

  • Problems about deploying Oracle web application (Forms, Reports)

    I am going to deploy Oracle web applications (Forms and Reports) and plan to use the same server machine for both Application web server and Database server.
    1. How can I enable SSL (for data encryption) on Application web server for Oracle Forms ?
    2. Since both Application web server and Database server will use the same machine, do I still need Oracle Advanced Security for data transmission between Application web server and Database server if data encryption for transmission is required ?
    3. Can I user Oracle Forms to call Oracle Report on web as I did in Client/Server in the past ?
    Experts like you may have come across such problems. Would you please give me some opinions/ideas ?
    Regards,
    Richard

    1. check the paper about the Forms servlet architecture on otn forms section for SSL tips.
    3. Check the reports and forms integration paper on otn too.

  • How to configure Oracle SSO for forms and apex

    Hi All,
    I am trying to configure oracle SSO for forms and apex using third party external authentication. Please help me how to configure. I a have tried all possible things
    from web but I am not able to do it. Is there any doc or links are much appreciated.
    Info: Some reason my oiddas web link is not working it used to work fine before and also the from /pls/orasso/ link I am not able to login may be because of my oiddas issue
    Thanks

    Hi Andreas,
    Thanks you for your help. I am trying to implement third party external LDAP authentication for APEX and Forms.
    So I started with OID and SSO setup to create external Partner Applications. Some reason my oid and sso web login links are not working. I didn't find any errors. I need some help in finding the problem and direction, I already read docs on web but no proper direction. I appreciate your help.
    Thanks

  • I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me..

    I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me build the string .Below is the query and the out put. ( the string is building fine except the parameters are with out quotes)
    here is the procedure
    create or replace
    procedure temp(
        P_MTR_ID VARCHAR2,
        P_FROM_DATE    IN DATE ,
        P_THROUGH_DATE IN DATE ) AS
        L_XML CLOB;
        l_query VARCHAR2(2000);
    BEGIN
    l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
       ' AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ',''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
        ' AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ','' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
    SELECT DBMS_XMLQUERY.GETXML('L_QUERY') INTO L_XML   FROM DUAL;
    INSERT INTO NK VALUES (L_XML);
    DBMS_OUTPUT.PUT_LINE('L_QUERY IS :'||L_QUERY);
    END;
    OUTPUT parameters are in bold (the issue is they are coming without single quotes otherwise th equery is fine
    L_QUERY IS :SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),'9999999.000') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),'$9,999,999.00') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),'9999999.000') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,'mm/dd/yyyy') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,'hh24:mi'), '00:00','24:00', TO_CHAR(s_datetime+.000011574,'hh24:mi')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '1'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,'DD-MON-YY') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '2'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,' DD-MON-YY') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)

    The correct way to handle this is to use bind variables.
    And use DBMS_XMLGEN instead of DBMS_XMLQUERY :
    create or replace procedure temp (
      p_mtr_id       in varchar2
    , p_from_date    in date
    , p_through_date in date
    is
      l_xml   CLOB;
      l_query VARCHAR2(2000);
      l_ctx   dbms_xmlgen.ctxHandle;
    begin
      l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,'' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
      l_ctx := dbms_xmlgen.newContext(l_query);
      dbms_xmlgen.setBindValue(l_ctx, 'P_MTR_ID', p_mtr_id);
      dbms_xmlgen.setBindValue(l_ctx, 'P_FROM_DATE', to_char(p_from_date, 'DD-MON-YY'));
      dbms_xmlgen.setBindValue(l_ctx, 'P_THROUGH_DATE', to_char(p_through_date, 'DD-MON-YY'));
      l_xml := dbms_xmlgen.getXML(l_ctx);
      dbms_xmlgen.closeContext(l_ctx);
      insert into nk values (l_xml);
    end;

  • Connecting oracle dev 2000 forms to oracle 9i database on another server

    we have these oracle developer 2000 forms (in .fmx format) in a server and the data of these forms in another server.... the server with the data is very old and is very slow...so we decided to relocate the database(oracle 9i) to a new server..... also, we move the developer 2000 forms from the old server to another server which will serve as the front end to the new data server.
    The problem is we can't figure out how to make the developer 2000 forms on the new front end server to point to the new database on the new data server. I would really appreciate if u cud gimme some advice on this... so we need to know how the forms find the data, where this "connection string" is for developer 2000 forms.

    You have to create a Net Service from "Net Configuration Assistant". Or you can copy TNSNAMES.ora file from your old server to new server. You can find TNSNAMES.ora file in developer_suite_Home/Network/admin folder.

  • How to enforce index in oracle query

    Hi all
    how to enforce index in oracle query
    Regards

    Use INDEX hint to force Optimizer to use the specfied index.
    You really need to investigate why Optimizer doesn't choose the index. Remember, INDEX SCAN are not always GOOD.
    Jaffar

Maybe you are looking for

  • IMac 2013 and Windows 8.1 Connectivity

    Up until I installed Yosemite, I could connect my new Windows 8.1 computer to my iMac external hard drives. ( I have 5 of them hooked up to the iMac) and could access all of my files.) without a problem. Now I can't access not 1 one of them. I can ge

  • [SOLVED]change the font that displays pages in the browser Uzbl

    hi all there is some form in the browser Uzbl change the type of font displayed on web pages? thanks Last edited by jccl1706 (2010-03-16 01:32:53)

  • Message no. HUFUNCTIONS189

    The scenario is the stock transfer between two plants, the goods has been despatched in the issuing plant with no problems, but we are getting an error message during the receipt processing at the receiving plant. The idoc process has been stuck at 5

  • Sql login failed

    Hi everybody. I installed database 10g release 2 with enterprise manager on windows server 2003 machine. But when I tried to login to the database throughout internet explorer using the following command:- http://localhost:5560/isqlplus , but it is f

  • Nokia 5530 XM won't charge/turn on

    Hello everyone! I've been facing this problem with my phone for two weeks now and this is my last attempt to fix it before I buy a new phone (although I don't want a new one, I love my 5530 XM).  So, it won't charge. When I plug in the charger batter