Time in APEX

I want to add two fields. "Start Time" and "Finish Time" and then have another field which displays the actual time by subtracting the finish time from the start time. I can't find a format for time, there is a date which includes the time but not time by itself. If you use a number then 5.30 is 5.3 not 5.5 in hours.
Any ideas?

Thankyou for the reply Varad.
How would I incorporate the code into the query below. I need to calculate the difference between 'DEPARTURE_TIME - 'ARRIVAL_TIME' and 'FINISH_TIME - START_TIME'
select "ID","ENGINEER","DATE_OF_CALL","ARRIVAL_TIME","START_TIME","FINISH_TIME","DEPARTURE_TIME","COMPLETE","FAULT_CODE","PARTS_ON_SITE","PARTS_VAN","FAULT_LOCATION_CODE","METER_101","METER_108","METER_122","METER_123","METER_112","METER_113",dbms_lob.substr("COMMENTS",4000,1) COMMENTS
from "DPSG_FVR"
where
instr(upper("COMPLETE"),upper(nvl(:P1_REPORT_SEARCH,"COMPLETE"))) > 0 or
instr(upper("ENGINEER"),upper(nvl(:P1_REPORT_SEARCH,"ENGINEER"))) > 0 or
instr(upper("FAULT_CODE"),upper(nvl(:P1_REPORT_SEARCH,"FAULT_CODE"))) > 0 or
instr(upper("PARTS_ON_SITE"),upper(nvl(:P1_REPORT_SEARCH,"PARTS_ON_SITE"))) > 0 or
instr(upper("PARTS_VAN"),upper(nvl(:P1_REPORT_SEARCH,"PARTS_VAN"))) > 0 or
instr(upper("FAULT_LOCATION_CODE"),upper(nvl(:P1_REPORT_SEARCH,"FAULT_LOCATION_CODE"))) > 0
)

Similar Messages

  • Header Images not all the time in APEX 3.1.1.06

    Hi
    I'm running APEX on a Oracle 11gR1 server and a Oracle 10gR2 XE Server.
    Both these servers don't load the images in my application all the time, refreshing the page either loads the images or not and its random which ones load or not.
    The images always load when using APEX application builder and SQL workshop, it only happens to my own applications.
    This happened after upgrading to APEX 3.1 I think, cant recall the exact build it occurred on.
    Details of the two different APEX installs shown below.
    Oracle 11gR1 APEX Details:
    Product Build:     3.1.1.00.09
    Language Preference:     en-gb
    NLS_CHARACTERSET:     WE8MSWIN1252
    DAD CHARACTERSET:     UTF-8
    Oracle 10gR2 XE APEX Details:
    Product Build:     3.1.1.00.09
    Language Preference:     en-gb
    NLS_CHARACTERSET:     AL32UTF8
    DAD CHARACTERSET:     UTF-8
    What can I do to fix this or is it just a case of waiting for the next patch?
    Regards
    Adam

    I reproduced this yesterday, but I won't get a chance to look at this more until next week. What I found:
    1) I reproduced this on 11.1.0.6 using the XDB HTTP Protocol server and embedded PL/SQL gateway
    2) I believe the "50% of the time%" is really a function of the browser and its internal computation of "Expires" for a resource for which no Expires date was specified.
    3) I turned maximum tracing on with dbms_epg.set_global_attribute('log-level', 7). It showed that this is raising an error of "HTTP headers not closed", but a) the code explicitly closes the headers, and b) a trace using Firebug and/or Live HTTP headers also showed this was closed. It would be useful to know if you are encountering this same error (it will generate a database trace file which you will need to examine).
    It would also be useful if you changed the globalization settings for your application to derive application language from browser, and then attempt to reproduce this with both en-us and en-gb.
    So far, though, this issue is not the same one discussed in the other thread. That was a function of an exception being raised due to a bug in the XDB HTTP protocol server, and it was also a function of the database NLS settings. The workaround for that is in place in 3.1.1.
    Joel

  • How to implement countdown timer in apex

    Hi all,
    I want to implement timer in my application.i am working on apex 4.0 version.I am developing online test application,so for this i want to display timer for test.
    can anyone suggest me how can i implement countdown timer in my application.
    thanks
    jitu

    Hi,
    You can refer "Martin Giffy D'Souza's" Enhanced APEX Session Timeouts example
    http://www.talkapex.com/2009/09/enhanced-apex-session-timeouts.html
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Timer in Apex !

    Is there timer or scheduler in Apex?
    Can I make DBMS.JOB fire a report or message in Apex.
    Is there a solution which hasn't a high cost on the server?
    Regards
    Saad

    Hello Saad,
    Why not create a report in APEX that shows all the dates that are due or expired?
    I don't quiet understand what you want to do with APEX in this case... you can't really fire-up the users browser and show him an alert.
    What I would think of doing is sending him a mail with a link to the APEX app?
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://apex-evangelists.com/

  • How do i change Session Expire Time in APEX?

    Greetings,
    I am developing in APEX 3.2.
    Every few minutes while i am developing i have to log in again, it gets tiresome every day having to login 100 times.
    So i would like to know where i can change the time it takes for the session to expire so i can change it tom some big value, let's say like 8 or 12 hours.
    I would also like to change the time a regular user can stay logged in cause it also has a small time for the session expire and since i have to test everything i develop it would also be great not having to logging every few minutes when i am testing something.
    I check the places i remembered in administration and user preferences but apart from acount validity i didn t find anything.
    Thanks everyone,
    Best regards
    My Homepage
    Edited by: Igor Carrasco on Apr 24, 2009 1:18 PM

    Hi
    in Apex 3.2: go to > Application #### > Shared Component > Security > Session Time Out... and set max session lenght and Idle and out URL.
    Regards
    Rolando

  • Too msuch wait time for APEX page rendering

    Oracle XE 11gR2 64-bit
    RHEL 64-bit
    Using EPG
    Logged in as sys/sysdba
    ==================
    This is based on the thread at Too much time on network wait!
    Referring back to the thread above which seems to have gone 'cold' and for some strange reason the second page of that thread no longer appears/exists.
    But on that second page someone mentioned the solution below (with the idea that the EPG was causing the issue of pages rendering slow. Page render fine using Glassfish in another environment).
    exec dbms_xdb.cfg_update( updatexml( dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/call-timeout/text()', '300', 'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'));
    I'd like to try this solution out. However, it fails to even run for me so I was hoping for some clarification.
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
    SQL> exec dbms_xdb.cfg_update( updatexml( dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/call-timeout/text()', '300', 'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'));
    BEGIN dbms_xdb.cfg_update( updatexml( dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/call-timeout/text()', '300', 'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')); END;
    ERROR at line 1:
    ORA-06550: line 1, column 28:
    PLS-00201: identifier 'UPDATEXML' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL>
    Thank you.

    the idea that the EPG was causing the issue of pages rendering slow. Page render fine using Glassfish in another environment). Probably the value of the SHARED_SERVERS parameter needs to be increased.
    See this article for more info:
    http://ora-00001.blogspot.no/2008/04/adventures-with-apex-part-one-boosting.html
    - Morten
    http://ora-00001.blogspot.com

  • Delay login for sometime if users fails for three times in apex

    i have a requirement in apex 4.1,
    suppose a user login to it and if he fails for three times consequetively than he will not able to login for next 30 minutes.this is the function i am using for doing authentication.
    i want to show timer at the top of the login page as user fails to login for three times continously..same functionality which is present in Apex 4.2.
    create or replace
    FUNCTION LWM_CHECK_CREDENTIALS(P_USERNAME IN VARCHAR2,P_PASSWORD IN VARCHAR2)
    RETURN boolean
    IS
    LC_USERNAME_1 LWN_LOGIN.USERNAME%TYPE;
    LC_PASSWORD_1 LWN_LOGIN.PASSWORD%TYPE;
    LN_COUNT NUMBER:=0;
    LN_COUNT1 NUMBER;
    LC_SQLERRM VARCHAR2(500);
    LN_COUNT2 NUMBER;
    BEGIN
    SELECT USERNAME,PASSWORD INTO LC_USERNAME_1, LC_PASSWORD_1
    FROM LWN_LOGIN
    WHERE UPPER( USERNAME) = UPPER(P_USERNAME)
    AND PASSWORD = (P_PASSWORD);
    UPDATE LWN_LOGIN SET COUNT= LN_COUNT
    WHERE UPPER(USERNAME)=UPPER(P_USERNAME);
    -- apex_util.set_authentication_result(0);
    RETURN true;
    EXCEPTION
    WHEN OTHERS THEN
    SELECT COUNT INTO LN_COUNT1
    FROM LWN_LOGIN
    WHERE UPPER(USERNAME)=UPPER(P_USERNAME);
    if ln_count1 <=2 then
    UPDATE LWN_LOGIN SET COUNT = LN_COUNT1 +1 ,
    TIMESTAMP = SYSTIMESTAMP --to_char(SYSdate,' HH24:MI:SS')
    WHERE UPPER(USERNAME)=UPPER(P_USERNAME);
    end if;
    LC_SQLERRM:=SQLERRM;
    SELECT COUNT INTO LN_COUNT2 FROM LWN_LOGIN
    WHERE UPPER(USERNAME)=UPPER(P_USERNAME);
    IF LN_COUNT2=3 THEN
    --APEX_UTIL.SET_AUTHENTICATION_RESULT(6);
    DBMS_LOCK.SLEEP(6);
    -- null;
    --INSERT INTO XXSAQUIB_TEST(A,B,C) VALUES(LC_SQLERRM,LN_COUNT2,'max attempt');
    end if;
    return false;
    END;
    Can any one provide me any link related to this which is helpful for me.
    Thanks in advance.
    Edited by: 969314 on 05-Nov-2012 03:17
    Edited by: 969314 on 05-Nov-2012 04:02

    Hi,
    When your authentication fails, stamp a "last failure" time on the record. Then check in your authorization that if the number of attempts is > X then the last failure timestamp must be less than sysdate - 30 mins.
    Then set the message text to be something like "you cannot log in for (x) minutes" where (x) is calculated based on sysdate and the last failure date.

  • Data upload takes long time in Apex 4.1

    Hi ,
    We are using data upload wizard in APEX 4.1. It is taking too long while going from Mapping to validation page. We tried with a file which has 34000 records and 5 columns. It takes more than an hour to load.
    Please help.
    Regards,
    Andy

    You're going to need to provide more information before people can help.
    eg:
    What's your table structure?
    Does it have any indexes or constraints?
    What sort of mapping are you doing?
    Do these tables have indexes?
    Scott

  • How to accesss dba objects (dba views) to find all  last ddl times in Apex

    Hi,
    I want to access all the dba_objects.. all dba_views to find out last ddl's. I installated oracle application express and had created users ADMIN, DEV, both are under XXAPPS schema. How can I find out last ddl's on all db objects. I was not able to pull out objects list from alll schemas's. All schemas are not accesable

    I'm not sure why you are trying to do this unless you are intending to build some sort of database monitoring tool, but if you grant the SELECT_CATALOG_ROLE role to the parsing schema, you should be able to see all the DBA_ catalogue views.
    Regards
    Andre

  • Time in APEX - More

    I have the query below that I would like to calculate the difference between 'Work_Time' and Total_Time' in an additional column in a report. The query is below. Any help would be appreciated.
    select "ID","ORACLE_ID","ENGINEER","DATE_OF_CALL","ARRIVAL_TIME","START_TIME","FINISH_TIME","DEPARTURE_TIME","COMPLETE",
    "FAULT_CODE","PARTS_ON_SITE","PARTS_VAN","FAULT_LOCATION_CODE","METER_101","METER_108","METER_122","METER_123","METER_112","METER_113",
    dbms_lob.substr ("COMMENTS",4000,1) COMMENTS,
    trunc ( 24* (departure_time - arrival_time) ) || 'Hrs '|| round(60* mod(departure_time - arrival_time,24 ) ) || ' mins' Total_Time,
    trunc ( 24* (finish_time - start_time) ) || 'Hrs '|| round(60* mod(finish_time - start_time,24 ) ) || ' mins' Work_Time
    from "DPSG_FVR"
    where
    instr(upper("COMPLETE"),upper(nvl(:P1_REPORT_SEARCH,"COMPLETE"))) > 0 or
    instr(upper("ENGINEER"),upper(nvl(:P1_REPORT_SEARCH,"ENGINEER"))) > 0 or
    instr(upper("FAULT_CODE"),upper(nvl(:P1_REPORT_SEARCH,"FAULT_CODE"))) > 0 or
    instr(upper("PARTS_ON_SITE"),upper(nvl(:P1_REPORT_SEARCH,"PARTS_ON_SITE"))) > 0 or
    instr(upper("PARTS_VAN"),upper(nvl(:P1_REPORT_SEARCH,"PARTS_VAN"))) > 0 or
    instr(upper("FAULT_LOCATION_CODE"),upper(nvl(:P1_REPORT_SEARCH,"FAULT_LOCATION_CODE"))) > 0
    Kind Regards,
    Steve Welch

    Varad,
    Thankyou, brilliant.
    The query actually returned data in this format (1.5Hrs 30minutes) but that was fine because it enabled me to see how the query worked. I deleted the minutes component and ended up with a number representing hours. I could then compute totals across all work, total and difference columns. I have also deleted the 'Date of Call' field and added the (round (arrival_time) date) to my query.
    round ( 24* (departure_time - arrival_time),2 ) Total_Time,
    round ( 24* (finish_time - start_time),2 ) Work_Time,
    round ( 24* ( (departure_time - arrival_time) - (finish_time - start_time) ),2 ) Diff_Time,
    round (arrival_time) date
    I will still use the hours and minutes elsewhere but this solution has been great.
    Kind Regards,
    Steve Welch
    Edited by: Steve Welch on Nov 9, 2008 8:31 AM

  • Apex 4: How to send email when form is submitted?

    Hi,
    Using Apex 4.0.2 on DB 11g, I've a form with around 80 fields and 4 check boxes.
    When the user clicks on submit button, besides saving the values in the database I also have to send emails. Selection of the 4 check boxes decides whom the email has to go to, i.e if 2 check boxes are checked, send 2 emails.
    In the emails, some contents will be based on the data the user has filled and some from the database; also data in different emails will be different.
    From what I've read, to send email I've to use APEX_MAIL API and make a conditional process depending on the check boxes selected. Also that I have configure mail server in database and that mail sever has to accept autonomous user (i.e. sending email without password)
    Is this the right approach?
    How can I do this?
    Is there any example/tutorial that will guide me in doing this?
    Thank you for your time.

    The Apex email package is very simple.
    v_id := apex_mail.send(
              p_to        => v_to,
              p_from      => v_from,
              p_subj      => v_subject,
              p_body      => v_body,
              p_body_html => v_html);It's up to you how you get the values of the variables.
    Also that I have configure mail server in database and that mail sever has to accept autonomous userThe mail server is not in the database, but you do have to inform Apex which server to use (smtp.yourcompany.com).
    Most smtp servers require user and password. In that case you have to write your own procedure. Search the pl/sql forum for email authentication and you will find many examples.
    It is probably also possible to configure the smtp server in such a way that requests coming from the database do not need authentication. That is how we have it configured (but I don't know how the administrator did it, though).

  • Converting forms to APEX

    Hi,
    Has anyone converted client/server oracle forms,reports to APEX?
    If so, was it any good after conversion and if possible can you send me steps on how this was achieved?
    Thanks
    Munish

    For me I found that it was easier and better to my mind to write jquery javascript for validation than to try to get the callback thing to work. Also I was running into bugs about displaying validation error messages in 4.01. They just went in the bit bucket and never displayed.
    In jquery you could just write event-triggered code in a "ready function" that acted on specified events on specified items. You can declare it in one piece: the event and the code to process the event, all together. Which is like a forms trigger, you see the trigger name and the trigger code together. Whereas the apex callbacks were in multiple pieces that had to be defined in a certain order; a lot of distractions. In some respects jquery was more
    flexible than forms triggers because you could create a ready function that acted on one or more items whereas in forms you have item level,block level
    and form level triggers, you can be a bit more exact with jquery (modulo how things were named).
    What was a lot harder to do (for me anyway) was communicate with the database. Whereas in forms it is very easy: you can just stick
    database calls wherever you want with little concern. Not in apex. If the page was displayed on the client then talking to the database at that point was ajax and that was not easy to use IMHO. So you end up dividing things up into separate pages that could've been on one in order to have the submit (and talk to the database step). Apex was fun to use but it's worth it to use in order to then appreciate how much easier it is to develop in forms and it doesn't have that ridiculous 100 item limit. (I once created a forms form to display the data in one of our tables that has 586 columns and it didn't burp on it. No problem.) You can not change multiple item properties at one time in apex!
    So much more clicking to do there. I never appreciated fully the ability in forms to select a huge amount of things and change them
    at one time, how artful that was, as was the ability to copy and paste things and duplicate things until I used apex for a few months,
    where you can't do that.
    This is the part where someone will announce that where they work they never had a table with more than 30 columns and therefore we
    shouldn't have one either. Sorry but wide data is the norm. It's getting wider. Maybe someone expects and gets all their data to fit on your phone
    but not everyone does:
    http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010342495.aspx?CTT=5&origin=HP005199291

  • Too much time on network wait!

    At peak time my apex pages are very very slow. I open Home>Utilities>Database Monitor>Sessions>Waits, and see all wait classes are network. I have already changed shared_servers to 100. But all waiting sessions are still waiting for network. How to improve it? Thank you!

    John,
    it was in the context of a cross-platform 9.2 to 11.1 migration that
    we decided to opt for EPG using the APEX bundle integral to the db
    packages (thus, we are still running 3.0.1). I think some documents
    mentioned certain advantages of this architecture, but meanwhile I
    have my doubts ...
    To install APEX, we simply followed Note:457621.1 (How to Configure
    Oracle Application Express (APEX) & the Embedded PL/SQL Gateway (EPG)
    in an 11G DB).
    We currently have a SR open for weeks, were it is tried to track down
    the reason for those numerous virtual circuit waits, and found that
    all sessions emenate from APEX sessions (with various users and
    various apps). Thus, it is quite difficult to track down the reason
    for those waits.
    Is there an easy procedure to switch to Apache instead of EPG?
    Regards, Thomas

  • Help on the "latest" content for APEX presentation

    Tyler Muth here. It's been way too long since I've been on this forum. Unfortunately my current role doesn't allow much time for APEX projects (all Exadata, all the time). I have to give an apex talk in two days and would love some pointers to the latest "best solution" for a few key topics. The apex community has always been one of it's greatest strengths and I'm hoping for some pointers to community content or just built-in functionality that I may not be aware of. The audience are experienced apex developers (and really sound like they know what they're doing) so their questions are beyond the "spreadsheet to app" demo.
    Here it goes:
    <li>Deployment in general. Specifically moving the full app vs 1 page. (not sure much has changed here)
    <li>Efficient use of Page Zero such as dynamic actions or dynamic tabs
    <li>Source code control best practices. I'm pretty comfortable wit this one but happy to see new and creative solutions.
    <li>AJAX: They did a lot of their own AJAX code before apex included jQuery. I think they're looking for more use of the built-in APIs
    <li>More details on the "Shuttle". Examples or modifications perhaps?
    <li>Customized success messages, such as "Record for Melissa updated".
    <li>Not interested in mobile at this time.
    <li>Charting and any custom examples.
    <li>Calendar examples beyond what's in the doc. Possibly updating entries inline.
    <li>Recent improvements in built-in tabular forms
    What I'm looking for are just links to blog posts or other content on these topics if possible. Yes, I can (and will) google them, but the active people in the apex community probably have a good idea where solutions to some of these topics are. Thanks in advance for any help you can provide and I hope to rejoin this community in the near future as I have a few projects where APEX would be a good fit.
    Regards,
    Tyler
    http://tylermuth.wordpress.com

    Hi Tyler,
    I’m apologizing in advanced for the short response but I have to go out soon.
    Two days seems like a short time to really learn new stuff, but as your audience are experience APEX developers, they might find some of the followings interesting:
    *) Deployment – APEX 4.0 introduced the APEX_APPLICATION_INSTALL API (http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_app_inst.htm#CHDIEDJH), which allows you to deploy new applications usinging a command line utility, but still enjoy all the options that were only available in the GUI mechanism (e.g. changing the deployed application ID, default schema, etc.).
    *) Error handling – APEX 4.1 introduced some new ways of intercepting and dealing with APEX errors. Patrick wrote two Blog entries on it.
    *) Tabular Forms – this feature has considerably changed in 4.x. Adding the option of built-in tabular forms validations (without losing changes in case of validation error) and the option to process the tabular form data per row without resorting to the G_Fxx arrays. Also the Add Row functionality has become a client side operation (important for those who upgrade from pre-4.1 versions). You should search the forum for the combination of marc && tabular && form. He has several threads on the subject.
    *) Globalization – if this is an issue with your audience, there were some major enhancement of the translation mechanism. Search Joel’s blog.
    That’s all for now. Good luck with the presentation.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Apex running with Oracle Retail Applications

    Hi,
    Has anyone had experiance of building Apex screens to run with the Oracle Retail Applications (ORMS, ORPM, ReIM etc) and if so the do you do authentication using mod_sql (as with EBS 11i) rather than using the Apex Listener as you would with EBS R12.1
    I am assuming its possible to access the Apex screens from the Retail menu's but I have not looked into it in any dertail and just wanted to know that I am not waiting my time suggesting Apex as an extension technology around the Retail Applications.
    Mark

    Toon:
    Check the setting of the database init parameter - 'shared_server'
    From sqlplus connected as sys
    show parameter shared_server
    To change the value of this parameter enter the following
    alter system set shared_server=5 scope=both;
    Varad

Maybe you are looking for

  • Problems with EXIT_SAPMM06E_013

    Hallo, i have Problems by using the ebove EXIT. I use it like this, test is with ME21N( 4.6C!!).   INCLUDE ZXM06U44                   * TABLES: MARA. loop at xekpo where not matnr is initial.   SELECT SINGLE * FROM MARA WHERE MATNR = XEKPO-MATNR.   X

  • XML Payload does not have namespace and prefix.

    Hello I have created a consumer business service which will be called from JDEdwards EOne, pulls data from database and send it to Fusion Middleware. SO, I have created proxy using JAX-WS option. And suggested in oracle doc, I created proxy outside O

  • My gamecenter isn't linking to my clash of clans game. What do I do?

    CLASH OF CLANS LINKING TO GAMECENTER NOT WORKING HELP!!

  • Transfer assets between accounting center

    HI, IS ABLE TO TRANSFER ASSET FROM ONE COST CENTER TO ANOTHER Ramakrishna

  • Sharing in Element 11

    I use to share photos from Element 11 vie email, now suddenly it is not sending any thing, window pups up saying (Error trying to save message to Outbox). any one can help me? Thank you AK