Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Any substitutes for MSSQL TimeStamp and GUID types in Oracle?

Re: Any substitutes for MSSQL TimeStamp and GUID types in Oracle?

From: Klaus Sonnenleiter <klaus_at_m-machine.com>
Date: Mon, 14 Aug 2000 13:27:16 -0400
Message-ID: <39982BF4.EC8E007B@m-machine.com>

Byron,

Oracle has a built-in function called sysdate which returns the current time stamp. You can specify the formatting to make it look just like the SQL Server timestamp. I would definitely not recommend creating unique IDs in the app since you will run into concurrency issues - always let the database do it. The recommended equivalent to the SQL Server identity column in Oracle is to use a combination of a sequence and a BEFORE INSERT trigger that sets the unique ID to the value returned by the sequence.

Klaus Sonnenleiter
The Media Machine, LLC

Byron wrote:

> We are devloping a new database application using MSSQL 7.0 as the
> back end and we'd like to design the database to allow us to run
> against an Oracle database with no changes to the VB code and as few
> changes as possible to the SQL code. I've become quite fond of the
> MSSQL datatype TimeStamp for concurrency control and the GUID
> (Globally Unique IDentifier) type for keys so I don't have worry about
> duplicating values across servers.
>
> As I've discovered there are no corresponding types in Oracle. I
> think I can get around the GUID problem by creating it in VB code
> instead of SQL, and storing it as a string in Oracle, but the
> TimeStamp is another issue. I suppose I could use a Date type column
> and assume the one second granularity will be enough, but I'd rather
> have a mechanism I could use in a single column with no holes in it at
> all.
>
> I'd love to hear from anyone that has tackled either or both issues,
> or a referal to a source on information.
Received on Mon Aug 14 2000 - 12:27:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US