how to insert time in oracle database????
3 2534
I'm not much on proper use of databases... but doesn't that depend on the database you've created? Maybe you are storing the date as a string to be parsed later... maybe as three ints for day, month, year.
Any experts with more experience that can educate the both of us?
Hi
Well in the most basic form you will execute an INSERT INTO statement, but as tlhintoq pointed out you have to use the correct formatting.
You will most probably build the datetime value in C# and pass it to Oracle via a database adapter or if you simply want to log when something happened you could create a trigger and not use C# at all.
You need to be more specific and let us know what you have done so far and what you would ultimately like to achieve.
You have also decide if you mean the time on the client or the server. If you are using the time in the client, you should use DateTime in C#, something like
string time = DateTime.Now.TimeSpan.ToString();
But if you mean server time, you should use
TO_CHAR(current_date, 'HH:MM:SS')
So what is the difference? If the database and client are on the same computer, no much. But if there are several PCs as client, their clock differ somewhat, so it is better to use common clock, and server's clock seems to be suitable (or NTP).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John Keeling |
last post by:
Dear all,
I tried the test program below. My interest is to examine timing
differences between insert vs. append & reverse for a list. My results
on my XP Python 2.3.4 are as follows:...
|
by: James Goodman |
last post by:
I have an asp page which the user enters a time(e.g. 12:21). I need to
insert this time into a SQL Server DB, which has a smalldatetime column.
I have tried everything I can think of (such as...
|
by: george |
last post by:
This is like the bug from hell. It is kind of hard to explain, so
please bear with me.
Background Info: SQL Server 7.0, on an NT box, Active Server pages
with Javascript, using ADO objects.
...
|
by: Robin Lawrie |
last post by:
Hi again, another problem!
I've moved from an Access database to SQL server and am now having trouble
inserting dates and times into seperate fields. I'm using ASP and the code
below to get the...
|
by: Mark P |
last post by:
Some time ago I posted here about inserting into a set with a hint:
...
|
by: Mark Harrison |
last post by:
So I have some data that I want to put into a table. If the
row already exists (as defined by the primary key), I would
like to update the row. Otherwise, I would like to insert
the row.
I've...
|
by: David Eades |
last post by:
Hi all
Complete newbie here, so apologies if this is the wrong forum.
I've been asked to use mysql and asp to make a simple bidding system (rather
like a simple ebay), whereby users can use a...
|
by: rn5a |
last post by:
During registration, users are supposed to enter the following
details: First Name, Last Name, EMail, UserName, Password, Confirm
Password, Address, City, State, Country, Zip & Phone Number. I am...
|
by: assgar |
last post by:
Hi
I am having problem with my loping.
I don't know if I have chosen the correct approach.
GOAL:
I need to insert into a table event types for a specific date range.
The calendar the event...
|
by: mdboldin |
last post by:
I hav read on this forum that SQL coding (A) below is preferred over
(B), but I find (B) is much faster (20-40% faster)
(A)
sqla= 'INSERT INTO DTABLE1 VALUES (%d, %d, %d, %f)' % values...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |