Minutes to dates defined by the user

Hello

I have a 750 minutes the minutes of the employee worked.

I want to convert in days and hours.

A day is the duration of the trip that the employee must work in.

So if a day is considered to be 480 minutes

the days and times would be

trunc(750/480) which is a day

and

MOD (750 480) / 60 which is 4.5

But

I need the output only 1.5 days et.5 hours

I need fulldays or half days as days and everything in hours

How can it be done in oracle?

I use oracle 10g.

I need fulldays or half days as days and everything in hours

Then divide by half a day dedicated to the square:

SQL> select trunc(750/240)/2  as days
  2      , mod(750,240)/60 as hours
  3  from dual;

      DAYS      HOURS
---------- ----------
      1,5        0,5

Tags: Database

Similar Questions

  • Fail to create the web service with the type of data defined by the user using the jwsc Ant task!

    Hello everyone!

    I used JAXWS to create WSDL from a file of Jehovah's witnesses.

    It's my TJ:
    -----------------------------------------------------------------------------------
    package ws;

    Import javax.jws.WebService;
    Import javax.jws.WebMethod;
    ws import. MyDataType;

    *@WebService*
    * public class MyWebService {*}
    public MyWebService()
    *{*
    *}*
    *@WebMethod*
    public MyDataType MyWebMethod (MyDataType mdt)
    *{*
    * / / mdt.setS ("I got it!"); *
    return mdt;
    *}*
    *}*
    -----------------------------------------------------------------------------------


    and this is my type of data:
    -----------------------------------------------------------------------------------
    package ws;

    * public class MyDataType {*}


    String ^ s;
    public MyDataType()
    *{*

    *}*
    * public String getS() {*}
    return s;
    *}*

    * Sets public Sub (String s) {*}
    This.s = s;
    *}*
    *}*
    -----------------------------------------------------------------------------------



    and that's my Ant build.xml
    -----------------------------------------------------------------------------------
    * < by default of the project = "all" > *.
    * < property name = "weblogic.jar.classpath" value="D:/Projects/bea103/wlserver_10.3/server/lib"/ > * "
    * < taskdef name = "jwsc" classname = "weblogic.wsee.tools.anttasks.JwscTask" > *.
    * < classpath > *.
    * < path id = "weblogic.classpath" > * "
    * < pathelement path = "WEBLOGIC_HOME" / >. *
    * < fileset dir = "${weblogic.jar.classpath}" > *.
    * < include name = "weblogic.jar" / > *.
    * < / fileset > *.
    * < / path > *.
    * < / classpath > *.
    * < / taskdef > *.
    * < target name = "all" depends = "clean, build-service" / > *.
    * < name target 'clean' = > *.
    * < delete dir = "output" / > *.
    * < / target > *.
    * < name target = 'build-service' > *.
    * <!-add jwsc and related tasks here - > *.
    * < jwsc srcdir = "" destdir = "wsoutput" > * "
    * < jws file = "MyWebService.java" type = "JAXWS" / > * "
    * < / jwsc > *.
    * < / target > *.
    * <!-< target name = "deploy" > - > <! - add wldeploy task here - > <!-< / target >-> *.
    * < / project > *.
    -----------------------------------------------------------------------------------

    I have run the Ant task, but I get this error:
    -----------------------------------------------------------------------------------
    BuildFile: build.xml

    clean:

    build service:
    [jwsc] TJ: processing module /MyWebService
    [jwsc] The analysis of source files
    [jwsc] The analysis of source files
    [jwsc] 1 TJS files processing for the module /MyWebService
    * [jwsc] [JAM] WARNING: could not resolve class MyDataType *.
    [jwsc] TJ: C:\Documents and Settings\samimi\IdeaProjects\SampleWebService\src\ws\MyWebService.java valid.
    [jwsc] Treatment of the web services JAX - WS 1...
    * [jwsc] error: couldn't get TypeDeclaration for: MyDataType apt tour: 1 *...
    ...................
    BUILD FAILED
    C:\Documents and Settings\samimi\IdeaProjects\SampleWebService\src\ws\build.xml:
    19: weblogic.wsee.tools.WsBuildException: JAX - WS web services processing error
    -----------------------------------------------------------------------------------

    Please help me solve this problem.
    Thank you
    Mojir

    I tried to compile your source code and received the same exception.
    However after compiling the MyDataType.java before running the jwsc task, I was successfully able to build the service.

    Please try the ant script below and let me know the result:

    **
    *     *
    *
    *



    <>
    srcdir = "${source.dir}" "

    DESTDIR = "${Build.dir} '"
    keepGenerated = 'true '.
    classpath = "${Class.Path} '"
    Debug = 'true '.
    verbose = "false" >

         


              

    Thank you
    Sandeep

  • Display multiple lines of data collection defined by the user in an e-mail message

    I created a collection defined by the user that displays several lines of data. I created a custom rule and have linked this collection set by the user to this rule and configure an e-mail action. Variable Seveity, I have defined it in the rule to contain the column values. But it will only contain the first line of data. How can I display multiple lines of data in the alarm itself as well as the e-mail? Any help is appreciated.

    The example query in the collection defined by the user is less;

    Select the type, status, queuename, count (*) from PSAPMSGPUBHDR

    Union

    Select the type, status, queuename, count (*) from PSAPMSGPUBCON

    Union

    Select the type, status, queuename, count (*) from PSAPMSGSUBCON

    Result:

    Number of status type Queuename

    -------                 ----------------------                        ----------                           -------------

    HDR profil_utilisateur error 1

    PUB                  PERSON_BASIC                    New                                 4

    PUB WORKFORCE_SYNC error 1

    -3 rows

    I have defined the variables of gravity and the alarm message is something like this; (It is fetching only the first row of data) how do I loop through to get all the rows of data and display it in the message of alarm/email (alert) action must be written of the groovy script code to achieve this goal? If Yes can you please provide me examples?

    Alarm message:

    "Request message queue is:

    Type: @UDC_type

    QueueName: @UDC_queuename

    Status: @UDC_status

    County: @UDC_count

    Thanks in advance

    JAI

    Hi Jay,.

    fine I could help you. Please mark the thread as "Answered" when the issue has been resolved and do not hesitate to open a new thread for questions.

    Concerning

    Jochen

  • PCM - data import and fields defined by the user - model import or the XML API?

    Hello

    I am currently partially by an implementation of the PCM with my business and have created a few user-defined fields in the application companies. I have data from a form on the internet into a CSV file that I want then to eye-ball before loading of PCM.

    I created a copy of the "export contracts report template ' to include these fields defined by the user, but when I try to re - import the data, the user-defined fields are not populated.

    No one knows if the user-defined fields can be updated in PCM, and if so does to do through the functionality of the XML API?

    Kind regards.

    Published by: 914327 on February 14, 2012 03:39

    The simple answer is that the built-in import utility is designed to import a preset list of fields only and will not import your custom fields even if they are added in the import file, and you will need to use the API to import these fields.

    However, there are unsupported methods to import this data directly to the database, or to add custom fields as options available for import. I can tell you more about these methods on the forum offline if you are interested.

  • I can save is no longer shades defined by the user.

    It's something I've done many times:

    -create objects with the fill color > select > add the color group to illustration selected in the swatches Panel > click the menu library swatch in the swatches Panel and select "Save the nuances" in the drop-

    This would normally take me to the exact location where I need to record a sample, defined by the user - something like: (user defined) / Library/Application Support/Adobe/Adobe Illustrator (version) /(defined language)/samples. I can see this site for a fraction of a second, before the file browser window switches back me on the directory of the user. The library is open is no longer in this dialog box.

    I run two versions of Illustrator - CC and CS5 and oddly, it is the case in both, so I think the problem is Adobe - of - rights of library. I use a Mac, running OS X Yosemite 10.10.5.

    To be clear, I did several times in the past and it worked. And I tried to restart the computer.

    Any help/advice are welcome

    OK, I solved the problem by chance, and I'll leave the solution here if someone has the same problem.

    Namely, my Finder browser "save the file" has been on "Sort by date", and this mode will not access library. I went to "sort by name", and the library with user-defined shades reappeared. (Do not know what is the logic of this, but there you go).

    -Ana

  • Defined by the user exception handling

    Hello

    version Oracle 11.1.0.7

    Question 1:
    I just want to know what is the difference between the methods for using user-defined exceptions.

    Method 1: don't need initialization exception
    create or replace procedure p1
    as
    exc_p1 exception;
    begin
     do something .... 
     -- fails
     Raise exc_p1;
     exception when exc_p1 then
     raise;
     end;
     
    Method 2: use initialization exception
     create or replace procedure p2
     as
    exc_p2 exception;
    prgma exception_init(exc_p2,-20999);
    begin 
    p1;
    exception
    when exc_p2 then 
    raise;
    end;
    Question2

    Please let me know when and where to use these user-defined functions and I read the comments of Tom kyte on the use then than others, then raise or raise_application_error
    exception management. Rather than use the raise or raise_application_error can I use "dbms_output.put_line (dbms_utility.format_error_backtrace); dbms_output.put_line (dbms_utility.format_error_stack)) 'or can I do the exceptions as handler below.
    " when others then 
    raise_application_error(-20001,'error in p1  '||dbms_utility.format_error_backtrace ||dbms_utility.format_error_stack); " 
    Thank you
    Mike

    Mike wrote:
    Hello

    version Oracle 11.1.0.7

    Question 1:
    I just want to know what is the difference between the methods for using user-defined exceptions.

    Method 1: don't need initialization exception

    create or replace procedure p1
    as
    exc_p1 exception;
    begin
    do something ....
    -- fails
    Raise exc_p1;
    exception when exc_p1 then
    raise;
    end;
    

    Method 2: use initialization exception

    create or replace procedure p2
    as
    exc_p2 exception;
    prgma exception_init(exc_p2,-20999);
    begin
    p1;
    exception
    when exc_p2 then
    raise;
    end;
    

    The first method is used when you plan to raise user-defined errors by using the name, and user-defined errors are raised in the procedure you capture them.

    The second method is used when you want to capture a specific error number, it's an error specific oracle (one that has not already been appointed) or a user defined error. In your example procedures, if we show what exceptions occur by putting in the debugging...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure p1 as
      2    exc_p1 exception;
      3  begin
      4    Raise exc_p1;
      5  exception when exc_p1 then
      6    dbms_output.put_line('P1:exc_p1');
      7    raise;
      8* end;
    SQL> /
    
    Procedure created.
    
    SQL>
    SQL> create or replace procedure p2 as
      2    exc_p2 exception;
      3    pragma exception_init(exc_p2,-20999);
      4  begin
      5    p1;
      6  exception
      7    when exc_p2 then
      8      dbms_output.put_line('P2:exc_p2');
      9      raise;
     10    when others then
     11      dbms_output.put_line('Other exception');
     12      raise;
     13  end;
     14  /
    
    Procedure created.
    
    SQL> set serverout on
    SQL> exec p2;
    P1:exc_p1
    Other exception
    BEGIN p2; END;
    
    *
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SCOTT.P2", line 12
    ORA-06512: at line 1
    

    ... we can see that the captured P1 procedure an exception defined by the user by his name, but procedure P2 could only recognize as being a mistake 'OTHERS '.

    But if P1 were to raise a specific error number...

    SQL> create or replace procedure p1 as
      2    exc_p1 exception;
      3  begin
      4    Raise exc_p1;
      5  exception when exc_p1 then
      6    dbms_output.put_line('P1:exc_p1');
      7    raise_application_error(-20999,'Procudure 1 error raised',true);
      8  end;
      9  /
    
    Procedure created.
    
    SQL> exec p2;
    P1:exc_p1
    P2:exc_p2
    BEGIN p2; END;
    
    *
    ERROR at line 1:
    ORA-20999: Procudure 1 error raised
    ORA-06512: at "SCOTT.P1", line 7
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SCOTT.P2", line 9
    ORA-06512: at line 1
    
    SQL>
    

    ... then because P2 is looking for this under his own name of exp_p2 error number, he seized the exception thrown by P1 as is exp_p2 exception.

    Now, just to complete the example...

    SQL> create or replace procedure p1 as
      2    exc_p1 exception;
      3    pragma exception_init(exc_p1,-20999);
      4  begin
      5    Raise exc_p1;
      6  exception when exc_p1 then
      7    dbms_output.put_line('P1:exc_p1');
      8    raise;
      9  end;
     10  /
    
    Procedure created.
    
    SQL> exec p2;
    P1:exc_p1
    P2:exc_p2
    BEGIN p2; END;
    
    *
    ERROR at line 1:
    ORA-20999:
    ORA-06512: at "SCOTT.P2", line 9
    ORA-06512: at line 1
    

    ... P1 has now associated with error number 20999 is exc_p1 exception, when he simply raises this exception is triggered 20999 error number. P2 is unable to capture under the name of exc_p1 because this exception name does exist in the process of P1, but because P2 seeks 20999 under his own name of exc_p2 exception, it manages to capture him.

    So, to summarize, the name of the exception without the pragma is allowed to handle exceptions as part of the same name, but if you need capture outside the scope, you use the pragma to assign a number to it-specific exception.

    Question2

    Please let me know when and where to use these user-defined functions and I read the comments of Tom kyte on the use then than others, then raise or raise_application_error

    User-defined exceptions are used mainly to treat logic errors. The key is the word "handful." If you can handle an exception (i.e. to do something) you should capture it and do what needs doing. If you can't handle it then, you have to trigger it.
    Using a then "than others' exception should be a last resort. In general, you only manage exceptions that you plan to arrive. One then "than others' captures all exceptions that have not already been dealt with. If you have an exception "while others" and you do not throw the exception upward once again, then effectively hide you any errors to get noticed (errors are still happening, but you are not aware of them except for the fact that your "code does not work" or "data is not correct"). The only time you would really use one then "than others' exception would be if you need to connect all the errors in a table, but then after the cut, which should continue to be the exception to the calling code.

    exception management. Rather than use the raise or raise_application_error can I use "dbms_output.put_line (dbms_utility.format_error_backtrace); dbms_output.put_line (dbms_utility.format_error_stack)) 'or can I do the exceptions as handler below.

    " when others then
    raise_application_error(-20001,'error in p1  '||dbms_utility.format_error_backtrace ||dbms_utility.format_error_stack); " 
    

    You should not use dbms_output.put_line, except for the purpose of debugging. To use that assumes that the output of the server is catches or displayed, which, if it is a backend process, it won't. The correct way to error log is a table, or at worst a file on the server.

    If you need generate an application error and you want to keep the stack error, you just need the third parameter set to TRUE.

    raise_application_error({errornumber},{message},true);
    
  • Defined by the user function in query...

    I have included a function defined by the user in the SQL query that gave rise to the query takes a long time.

    Select col1, col2 (col1, col2) fn_userfunction from table where col1 in (values);

    The function calculate some values based on col1 and col2.

    How this improved query performance?

    Concerning
    Jean-Louis

    Hello

    If it was before including quickly, then you must look at the function for the performance. Maybe you can include the function in the SQL code, which makes it faster. Something else may be to put the function in a subquery:

      select col1, col2, (select fn_userfunction(col1, col2) from dual) xxx from table where col1 in (values);
    

    But you should always try to put at least as possible function in SQL. He created above.

    If the query is too slow without the function, then an index on col1 can help, but depends on the data and distribution.

    If you need help with the feature, you must provide the code for the forum. Then, perhaps we can help.

    Herald tiomela
    http://htendam.WordPress.com

  • You can use functions defined by the user in orardf: statement?

    Hello, reading Chapter 5: refined for RDF data access control
    I found this example:

    OPTIONAL
    {
    ? control pred: hasContractValue? Val.
    ? control pred: hasManager * ' sys_context ("his $ appctx ', 'app_user_uri') ' ^^ orardf: instruction *.
    }

    See the orardf type: statement, I got the question if you can use functions defined by the user in the place where he has used the sys_context?

    Thank you.

    PD: The translation was made from Spanish to English by using Google Translator

    Hello Alberto,.

    Only the sys_context function is supported. The user-defined functions are not supported.

    Thank you
    Matt

  • Change the frequency of Notification metric defined by the user

    Hello
    I'm trying to define a metric defined by the user in the enterprise grid control manager to warn me of the failure in the execution of scheduled tasks.
    My script to check the execution of scheduled tasks returns something like this and it runs every two hours:

    em_result = 2
    em_message = 2 tasks by mistake ("Task1" "Task3")

    So the first time the triggered alert, he sent me an email in critical condition with my em_message.

    But two hours later the next audit is not sending me any warning because the result is always critical, as this is my first problem!
    And if the message has been changed for example:

    em_result = 2
    em_message = 1 task (s) on error ("Task1")

    I don't see anywhere the new updated message, the alert history is not updated, it's my second problem.

    Kind regards
    PierreL

    The settings do not work properly. If the metric terms, the alert is triggered. When the condition is no longer fulfilled, the metric fades.

    You are the first problem can be solved by repeating notifications, available from 10.2.0.4 but attention is a global setting so it will affect all of the metric.

    The second issue is probably related to the first, the error is not compensation.

    If it is a measure for the work failed for the oracle Scheduler, you can adjust your request to check only the work done in the last 15 minutes and run the metric every 15 minutes... that means if you get a job at 09:00 but failure is working okay at 10:00, your metrics will draw 9ish, but be deleted by 9.15ish.

    If the task failed then at 11:00, you will get a new alert.

  • Functions defined by the user with several parameters

    I set features three following user using "Define."

    UF1 takes a single patameter;

    UF2 takes two parameters;

    and UFX takes two parameters - with the second is 'X' in the definition.

    Œuvres F1.  F2 is the EVAL of F1 version and it works too.  User functions only seem to work fine.

    F3, a function of two user settings, produces a graph of NaN.

    F4 is the EVAL of F3 version.  Note that 'B 'is not replaced by 1'.  Also produces a NaN chart.

    F5 produces a graph of NaN.

    F6 is EVAL of F5.  The 'X' is not replaced (even with the ' B' above), and even if it looks like 'X * X', it also produces a graph of NaN.

    Is it possible to get defined by the user, with several parameters, features work by tracing the curve?

    Hi!, Fortin:

    If you download and install the ultimate Firmware with the version of the software: 2015 6 17 (8151), with the number of Version: 1.1.2 - 11, you can trace your examples of definition of the function, with curves and values, without NaN.

  • Variables, FPGA, defined by the user and SoftMotion 2012 + NOR 9505

    Hello

    To http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/Softmotion-and-NI-950X-Module-Compatibility/... Nathan says:

    NathanK wrote:

    The glue code that connects Softmotion on FPGA LV code RT is called 'the axis interface. The version of the interface of the 2011 Softmotion axis necessary creation screw RT that exposes certain capabilities to Softmotion.

    ....

    Improvements have been made in 2012 Softmotion who has removed the requirement to write RT live. Disclosure for the FPGA happens rather on the Variables (UDVs) user-defined. It is also possible to create a kind of axis 9501 for configuration of the module as well as an axis UDV generic for other completely custom 950 x modules or axes. It is not a specific example for the 9505 yet.

    This caught my attention, as I'm trying to develop a system using LabVIEW SoftMotion 2012 and the NI 9505. I'm curious to see if there are alternative methods to write my application.

    Where can I find more information on this 'generic UDV axis' and how to implement a? Nathan says "is not a specific example for the 9505 yet", but there are examples for the other modules - how similar/different are these modules from the 9505, and it involves a lot of effort to bring examples of the 9505?

    Thank you!

    Hi JKSH,

    I have some relevant information that it is request that may be useful:

    Working with Axes Variable defined by the user (NI SoftMotion Module)

    Resource binding dialog box (NI SoftMotion)

    Configuration OR SoftMotion Axes (OR SoftMotion Module)

    Example that mentions of Nathan is the drive Stepper (9501) .lvproj (material Input and Output"Motion Control" NI SoftMotion"Device Specific" NI 950 x"OR 9501), I would take a peek at this on use of the UDVs.

  • Alarming - alarms defined by the user not appearing is not in history

    Hello

    I use the DSC module to create alarms.  I can successfully configure an alarm for a shared variable.  I use the alarms.vi of reading to read the current alarms.   I am able to recognize and to disappear which removes them from the list.  I also see a history of them when using the "alarm and event Query.vi.  Now, I do the same with user-defined alarms.  I have created alarm using the "user defined Alarm.vi value.  The alarm are displayed in the list (read alarms.vi).  I can acknowledge the alarm and it disappears from the list.  Now when I use the 'alarm & Query.vi' the user defined alarm does not appear in the list.  Only shared variable alarms are displayed.  Is this correct?  Is there a good example of what I'm doing?  The example of "User defined DSC alarms Demo.vi" does not give an example of reading historical alarms defined by the user of the database.

    Thank you

    Matt

    I removed the DSC module and re-installed which includes SQL Server.  That did the trick.

    Thanks for your help Caleb

  • How can I score points defined by the user in amplitude / frequency diagram?

    I have a table of frequencies and amplitudes. I need these values to display frequency values on the x axis and axis is amplitude. a default fixed parcel must be constantly visible in the graph, and then I want to score a few points defined by the user in the same graph, save these two plots in the same graph and then make a mark on the chart.

    Help kindly it's about my master of engineering project where I am trying to biuld an audiometer (to test hearing sensitivity) and I'll interface with microcontroller ardiuno labview and my hardware devices.

    so kindly help.

    Thank you.

    rich

    The points defined by the user might just be another plot.  You can add annotations to a conspiracy, but it's a lot of work.

  • Possible to automatically calculate date 2 weeks after date entered by the user in the form?

    Hello! I am trying to create a form that auto fills a few dates based on a value entered by the user. For example, if a user enters a date 07/01/16 deadline, I would another field to automatically fill the area with the 15/07/16 (2 weeks from the previously entered date). Is this possible? I've searched for scripts but no luck so far.

    Thank you!

    Melissa

    Of course, it is possible. Say the name of the field date entered by the user is Date1. You can use this script as script custom calculation of the other field.

    var dateString = this.getField("Date1").valueAsString;
    if (dateString=="") event.value = "";
    else {
        var d = util.scand("m/dd/yy", dateString);
        d.setDate(d.getDate()+14);
        event.value = util.printd("m/dd/yy", d);
    }
    

    For a tool that allows you to easily install these calculations, see: Scripts custom Adobe: Acrobat - automatic Date calculation applies

  • Com.oracle.httpclient.HttpRequestBuilder and http header defined by the user

    Hello

    In Java ME embedded 8, I would like to send an HTTP request containing an identifier defined by the user in the (X-header type) http header, using the com.oracle.httpclient package.

    HttpClient client = clientBuilder.build ();

    RequestBuilder (http://my_uri) client.build = HttpRequestBuilder;
    requestBuilder.setHeader (HttpHeader.ACCEPT, "text/plain");

    Here, I would like to add a header as user-defined value:
    requestBuilder.setHeader ("MyHeader", "myHeaderValue");

    It seems there only predefined values for the headers in the com.oracle.httpclient.HttpHeader class.

    Is it possible to add a header defined by the user in the application?

    Thanks in advance.

    Bruno

    Hi Bruno.

    have you tried myHeader = new HttpHeader ("MyHeader") Httpentete;?

    / Sergey

Maybe you are looking for