cancel
Showing results for 
Search instead for 
Did you mean: 

Insert / Update of a TIME field using Native SQL

Former Member
0 Kudos

Hi Oracle gurus,

We are trying to perform inserts and updates within an ORACLE table where a TIME field exists without suscess. We are trying to code it using Native SQL.

EXEC SQL.

INSERT INTO table (field1[name], field2[age], field3[birthday], field4[hour])

VALUES (:name, :age, TO_DATE(:date_birth), ¿:hour?)

ENDEXEC.

EXEC SQL.

UPDATE table SET field3[birthday] = TO_DATE(:date_birth), field4[hour] = ¿:hour?

WHERE field1[name] = :name AND field2[age] = :age

ENDEXEC.

Which is the right coding sentence in order to achieve our goal?

Many thanks in advance. Best regards,

Imanol

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The below works for me...pls try

insert into sap_text

(mandt, sap_id , origin , tdfdate)

values ('250' , '0000040123' , 'R3D' , to_date('2003/05/03', 'yyyy/mm/dd'));

BR,

Krishna.

Former Member
0 Kudos

Hi

There is no TIME datatype in oracle. There is only a TIMESTAMP or DATE type or the field is VARCHAR2 as most date fields in a SAP database are. To help you we would need the real field type. If possible you please do a desc <owner>.<table> in a sqlplus session and give us the field type.

If possible also supply the error you get.

Regards, Michael