ERROR when using getDate () in oracle to update rows

I have a table with a STREAM_TIME column of type DATE.
I am trying to update all rows for this column until today. The database used is oracle.

My request:

update bns_bess_messages SET stream_time=getDate();

Oracle returns with this error:

SQL Error: ORA-00904: "GETDATE": invalid identifier
00904. 00000 -  "%s: invalid identifier"

How to upgrade STREAM_TIME to this day?

thank

+5
source share
3 answers

You can do it as follows:

update bns_bess_messages set stream_time = trunc(sysdate);

Or, if you want to get the exact time:

update bns_bess_messages set stream_time = sysdate;

To check, you can use the following query:

select sysdate from dual;
+7
source

getDate () is part of the sql server function to use oracle one of the below

use

select current_date
from dual;

update bns_bess_messages SET stream_time=current_date

or

SYSDATE DATE, . ,

select to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Current Time"
from dual;

update bns_bess_messages SET stream_time=sysdate
+5

Oracle sysdate getDate()

update bns_bess_messages SET stream_time=sysdate;
+5

All Articles