Hi Cezar,
As some others have noted, SYSDATE is Oracle specific ( or at least
non-standard ) and as you can see from Chris' DDL, gets date AND time.
Something you can use is CURRENT_DATE, CURRENT_TIME and
CURRENT_TIMESTAMP, garnered by looking through LAN Times Guide to
SQL and sneaking a look at some ANSI/ISO working drafts ( anybody else
wonder about a standard that costs ~$300 to see? )
These are SQL 2 standards at the Intermediate level and above ( not at
the entry level, ) so, it still depends on the DB engine, but you can find
out via JDBC, and just trying it at the administration level if creating
tables there.
Note that things like SYSDATE and the way triggers/stored procedures are
handled bring up portability issues at both the java and general levels.
Joe Sam Shirah
Autumn Software
-----Original Message-----
From: Cezar Totth <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, July 23, 1999 9:22 PM
Subject: Re: How do I set the current date thru JDBC.
>Hi,
>
>I need to know, is this example standard SQL or is it Oracle specific.
>(e.g. "SYSDATE" function ?)
>
>Thanks,
>Cezar.
>
>On Mon, 12 Jul 1999, Chris Pratt wrote:
>
>> When you create or alter the table, use DEFAULT SYSDATE something like
this:
>>
>> CREATE TABLE EMPLOYEES
>> (
>> ID CHARACTER VARYING(21) NOT NULL,
>> NAME CHARACTER VARYING NOT NULL,
>> CREATIONTIME DATE DEFAULT SYSDATE
>> );
>>
>> Then you don't have to do anything in the java program, simply use a
>> statement like
>>
>> INSERT INTO EMPLOYEES (ID, NAME) VALUES ('E15','Wilson P');
>> (*Chris*)
>>
From: Chris Pratt <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, July 23, 1999 10:27 PM
Subject: Re: How do I set the current date thru JDBC.
>I have no idea, I know it works on Oracle.
> (*Chris*)
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html