473,505 Members | 16,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time function - Oracle

4 New Member
Dear Friends,

I need to know the following:

I will provide a numeric value say 610, and this value has to be converted into respective hours, minutes and second format ie 10 hr 10 min 00 sec.

How can I achieve this. Please provide a query or some guidelines to do it.

Regards

Praveen
Aug 29 '07 #1
2 4043
amitpatel66
2,367 Recognized Expert Top Contributor
Check out below code:

DECLARE
a NUMBER := &1;
hours NUMBER;
minu NUMBER;
BEGIN
SELECT TRUNC(a/60) INTO hours FROM dual;
SELECT MOD(a,60) INTO minu FROM dual;
DBMS_OUTPUT.PUT_LINE (hours||' HRS '||minu||' MINS'||' 00 SECS');
END;
/

The above code will work on multiples of 60. If the MOD(number,60) is lesser than 60, then that value will be considered as MINUTES. Here the seconds will always be ZERO. I hope this is what u require.

It would be good if u can be more specific on your requirement.
R u gonna paas only 3 digit number always or more than that?
The above code accepts any digit numbers.
Aug 29 '07 #2
debasisdas
8,127 Recognized Expert Expert
Since u need to return multiple values ,its better to write a procedure with one IN mode parameter and 3 OUT mode parameter.
Aug 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
25870
by: Ric | last post by:
I am using crystal reports to attempt to extract information from this database but I need to know which records were last updated. I have managed to find a field in Oracle and its value is based...
2
16654
by: KULJEET | last post by:
control file not created at time of installtion of oracle database now how we can create it see alert file Dump file e:\ORacle\admin\new\bdump\newALRT.LOG Tue Sep 09 10:45:53 2003 ORACLE...
1
9207
by: Roger Leigh | last post by:
I'd like to use standard C++ to process dates, converting to and from std::string and std::tm representations. The dates are going to/from a database, as ISO-8601 or SQL date-formatted strings. ...
2
14750
by: John | last post by:
My application needs to call Oracle function using oracle client 9.2. The oracle function returns boolean value from its returned parameter. The name space that I used is system.data.oracleclient....
0
3631
by: truthbajaj | last post by:
Hi, I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C. I created a shared lib (libextproc.so) for the following function. ...
8
11240
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to...
1
3415
by: holdingbe | last post by:
Hi all, Normally, the stored function return one values per time.In oracle9i pipelined functions return the amount of data at a time, the first step create a type object. CREATE OR...
0
3222
by: jobs | last post by:
re: Oracle Exceeded maximum idle time I have asp.net web gridview that is populated by a function that calls an Oracle procedure that returns a dataset. At most, it might take 2 or 4 seconds to...
7
2146
by: Amirallia | last post by:
Hi, I consume my webservice with the IE browser and all is ok when I call it with one browser. But when I call it a the same time with two browsers, the IE page tells me that the apllication...
0
19529
amitpatel66
by: amitpatel66 | last post by:
Hi All, Find below some useful information about Time Zone Conversion in oracle. Hope this would be helpful for many of them since all the real time projects that we work in follow different time...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.