Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to add days, hours, minutes and seconds to a date?

user639304Jun 29 2011 — edited Jul 8 2011
Hi,

I have the following problem.
Given 4 integers D,H,M and S (each of them can be negative) and a date Da, I want to add D days, H hours, M minutes and S seconds to the date Da.
For example, if
Da= to_date('28/06/2011 14:50:35','dd/mm/yyyy HH24:mi:ss'), and D = 3, H = -2, M = 20 and S = -12, 
it means I want to add 3 days, -2 hours, 20 minutes and -12 seconds to the date Da, and the new date must be the following date:
to_date('01/07/2011 13:10:23','dd/mm/yyyy HH24:mi:ss') 
Is it possible to write a query to solve this problem or should I use PL/SQL?

Thanks.
This post has been answered by 6363 on Jun 29 2011
Jump to Answer

Comments

586120
Hi casey, I had a similar error, and it was because I had this line in the context.properties with oc4j_soa, instead of home:
java.naming.provider.url=opmn:ormi://xpone:6003:home/orabpel

If you have basic installation your instance name is home, oc4j_soa is the default instance name for an advance installation.

So check this parameters your error must be related with them.

Regards
Jorge Alvarado
586206
hi,

i am not able to resolve the same issue (to invoke a bpel process from a jsp page).

i have used the tutorial that comes with the oracle soa suite installation .

created the invokeHelloWorldJsp to invoke the HelloWorld web service which is already deployed.

i got the following exception:

java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found at com.evermind.server.rmi.RMIServerContext.lookup(RMIServerContext.java:207)
at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:255)
at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:195)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
at _InvokeJSP._jspService(_InvokeJSP.java:78)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:598)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:522)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:712)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)

when i saw the ejb modules in the oracle application server (oracle soa suite), i found that the Delivery bean (Stateless session bean ) was unavailable.(including all other beans)

could any one help me out to resolve this.

Regards,
Akila

Message was edited by:
user583203
232663
See: http://clemensblog.blogspot.com/
Specifically: http://clemensblog.blogspot.com/2006/02/infamous-javaxnamingnamenotfound.html

When you deploy and run your JSP:

java.lang.Exception: Failed to create "ejb/collaxa/system/DomainManagerBean" bean;
exception reported is: "javax.naming.NameNotFoundException:
ejb/collaxa/system/DomainManagerBean not found
...

Clemens blog addresses this error. You need to modify the server.xml file each time you do a deployment. The error requires your process to reference the orabpel application as its parent. The orapbel application, defined in the server.xml file, contains the needed DomainManagerBean. Assume you have deployed your
application as webapp1. Therefore you must modify the servel.xml file after you deploy your application as per the following. The server.xml file you must change is located in:
<OraBPELPM_1>\integration\orabpel\system\appserver\oc4j\j2ee\home\config
Where <OraBPELPM_1> is the directory wherein you installed OraBPELPM_1.

...
<application name="orabpel" path="../applications/orabpel_ear" auto-start="true" />
...
<application name="webapp1" path="../applications/webapp1.ear" parent="orabpel" auto-start="true" />
...

The first line is already in the server.xml file and you must add parent="orabpel" to your deployment line. Each time you do a deployment this line is overwritten and therefore you must make the same change each time you do a deployment. ALSO - after the deployment and the editing change you
must bounce the server for the server to reread your change.

Casey
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 5 2011
Added on Jun 29 2011
3 comments
11,226 views