constant/current timestamp 
Author Message
 constant/current timestamp

hi,

i'm moving an app from mssql to adaptive server/nt. i'm having
problem trying to use the special constants. the following
statement worka in mssql

    create table xxx(id int, now datetime default current_timestamp)

but not in sybase (in the doc, the constant does not have "_" in
between "current" and "timestamp")

    create table xxx(id int, now datetime default current timestamp)

what am i doing wrong here?

thanks in advance for pointers.

--jerry



Sun, 27 Aug 2000 03:00:00 GMT
 constant/current timestamp

Quote:

> hi,

> i'm moving an app from mssql to adaptive server/nt. i'm having
> problem trying to use the special constants. the following
> statement worka in mssql

>     create table xxx(id int, now datetime default current_timestamp)

> but not in sybase (in the doc, the constant does not have "_" in
> between "current" and "timestamp")

>     create table xxx(id int, now datetime default current timestamp)

> what am i doing wrong here?

> thanks in advance for pointers.

> --jerry

What document are you looking at?  I'm not familiar with any
Sybase document that specifies a "current_timestamp" or "current
timestamp" literal.

I would create this table as:

     create table xxx(id int, now datetime default getdate())
--
Bret Halford                    Imagine my disappointment
Sybase Technical Support        in learning the true nature            
3665 Discovery Drive            of rec.humor.oracle...
Boulder, CO 80303



Mon, 28 Aug 2000 03:00:00 GMT
 constant/current timestamp

Quote:


>> hi,

>> i'm moving an app from mssql to adaptive server/nt. i'm having
>> problem trying to use the special constants. the following
>> statement worka in mssql

>>     create table xxx(id int, now datetime default current_timestamp)

>> but not in sybase (in the doc, the constant does not have "_" in
>> between "current" and "timestamp")

>>     create table xxx(id int, now datetime default current timestamp)

>> what am i doing wrong here?

>> thanks in advance for pointers.

>> --jerry

Are you using SQL Anywhere?

If so, use "columnname timestamp default current timestamp"  in your table
definition.  Without the qoutes of course.

If you are using other Sybase products then I don't know the answer.

Jim



Mon, 28 Aug 2000 03:00:00 GMT
 constant/current timestamp

Try

create table xxx(id int, now datetime default getdate())

Quote:

>hi,

>i'm moving an app from mssql to adaptive server/nt. i'm having
>problem trying to use the special constants. the following
>statement worka in mssql

>    create table xxx(id int, now datetime default current_timestamp)



Sat, 02 Sep 2000 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. create a table with default timestamp as current timestamp + 100 days

2. DOES INFORMIX SUPPORT TIMESTAMP CONSTANT

3. date literals (constants) and timestamp data type

4. Getting the Current Timestamp

5. Inserting Current Timestamp into SQL Server

6. Setting the current timestamp value for a db

7. Is Timestamp data type really the current date

8. Retrieving most 3 current dates from timestamp

9. how to insert current timestamp upon each record update

10. HELP !! Current Timestamp in a global (DTS)

11. 'current' timestamp bug

12. timestamp-to-date broken in current sources


 
Powered by phpBB® Forum Software