Eugene,

Thanks for your quick and brief reply. 
I wanted to get timestamp from database and you gave me the perfect
guidance.
I tried GETDATE() and it's working.

Thanks a lot.

Smita Modi


-----Original Message-----
From: Eugene Haimov [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 31, 2000 9:28 AM
To: MODI,SMITA (HP-NewJersey,ex1); '[EMAIL PROTECTED]'
Subject: Re: Problem with Timestamp


There is more than one way to do it......
(A) You want to get the timestamp in Perl, then store it
       in the database some way. You don't care whether database
       understands that it is in fact a "timestamp".
       - Use time() in Perl and store this integer value in database.
(B) You want your database to provide you with the timestamp
       value. This is always database-specific. In MS SQL Server
       it happens to be the built-in function called "GETDATE()".
       The field must be of type "datetime" to be able to store this
       value. Note that you DO NOT call this function in Perl:
       You call it right in your SQL-statement: e.g.
        $SQL = " INSERT INTO X ( A, B, C ) VALUES ( 1, 'xyz',  GETDATE() )
";
        Also, do not confuse the "timestamp" datatype with "datetime".
        "Timestamp" has nothing to do with time at all -- it is just an
        incremental binary value that SQL Server guarantees to be
        unique every time you use it.

Good luck,
Eugene Haimov

----- Original Message -----
From: "MODI,SMITA (HP-NewJersey,ex1)" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
Sent: Monday, October 30, 2000 6:47 PM
Subject: Problem with Timestamp


> Hi All,
>
> I want to put timestamp when I Update record or Insert record into a
Table.
> In the table I kept a column for that. I used functions like
CURRENT_TIME(),
> NOW(), CURRENT_DATE(), CURRENT_TIMESTAMP() but when I run my program it
> gives follwing error message
>
> Undefined subroutine &main::CURRENT_TIME() OR NOW() OR CURRENT_DATE()...
>
> I have installed TimeDate.zip,Time-HiRep.Zip,Date-Manip.zip, Date-Calc.zip
> files but still it doesn't work.
>
> Other Details
> Operating System -Windows NT 4.0
> driver -ODBC
> Database -SQL server
>
> If any one know the reason please guide me..
>
> Thanks in advance.
>
> Smita Modi
>
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
>
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to