Hi Scott:
It depends, mainly on your datatype definitions, Oracle has a very
solid Time/Date type definition, if you want to update or insert into a
table where all datatypes are of the same kind ( varchar2) for instance it
will be pretty easy to do insertions.
But if you are very concerned about making queries where the time is very
important to analyze your results (which happens in most cases), then you
have to define your time column as date datatype, and then is when you have
to be carefull.
Whenever you have to write to a date field you have to use the date time
conversion function in order that the information is stored in the way you
really wanted.
The sintaxis for this functions is normally not very friendly depending upon
how you write your data, but a way to overcome this very easily is to use
the SYSDATE keyword.
SYSDATE will store the current time in the appropriate format in your
database, you must realize it is the date at the time of the insert
statement and not at the time when you Acquired your data, but for most
systems (like mine here) this is good enough.
It used to be an excellent reference page in the internet for Oracle, it was
on Princeton University website, but it has been lock out since like 5
months ago, so you have to rely on Oracle's help system for you sintaxis
definition.
--
Second, please read the SQL tutorial at w3schools, whenever you generate a
record for the first time using INSERT, the second time you want to add
data you have to use an UPDATE statement
Based on the information you have below, you may have to generate the new
row using an INSERT command
INSERT INTO TableName(testime) values('12:00');
Then add the remaining data with UPDATE statements
Like :
UPDATE TableName SET testdate='01-13-2004' where ID=whatever your ID is;.
And so on.
, OR
you may want to do all at once
INSERT INTO TableName(testime,serialnum,productline)
values('12:00','0010001','widget');
This is the same regardless you are using MySQL or Oracle.
Thanks
Diego
-----Original Message-----
From: Scott Serlin [mailto:[EMAIL PROTECTED]
Sent: Friday, January 09, 2004 2:51 PM
To: [EMAIL PROTECTED]
Subject: FW: Oracle database question
Can anyone tell me if it is possible to treat an Oracle database like a
giant array? More to the point, do I have to always write a complete record
(or row) of data into a table or is there way to place a piece of data into
one single column within the row and come back later and place a different
piece of data in the same row but different column?
Example:
I wrote the first piece of data like this:
Table
testtime testdate dut serialnum productline
12:00
Later on I wanted to add another data point in the same row but different
column while still maintaining the data previously entered:
Table
testtime testdate dut serialnum productline Can I do this? Is it
allowed in Oracle?
12:00 100100
Once the row is complete, I would move onto the next row.
Table
testtime testdate dut serialnum productline
12:00 010603 1 100100 widget
1:00 010603 2 100101 widget