0
INSERT INTO PHOENIX_AUDITTRAIL SET
audit_module = 'Location Master',
audit_message = 'Delete location',
datecreated = NOW(),
author = '".$_SESSION['username']."',
status = '".ADT_NOTICE."';
4

1 回答 1

1

不,标准的表达方式是:

INSERT INTO PHOENIX_AUDITTRAIL(audit_module, audit_message, datecreated, author, status)
    select 'Location Master', 'Delete location', NOW(), '".$_SESSION['username']."', '".ADT_NOTICE."'
    from dual

但是,在 Oracle 中,我认为您会使用sysdate而不是now()

INSERT INTO PHOENIX_AUDITTRAIL(audit_module, audit_message, datecreated, author, status)
    select 'Location Master', 'Delete location', sysdate, '".$_SESSION['username']."', '".ADT_NOTICE."'
    from dual

除了日期变量和 之外from dual,这是标准 SQL 语法。

于 2013-02-15T01:08:00.407 回答