Home > database >  To save the data in the database always prompt "the data conversion overflows"
To save the data in the database always prompt "the data conversion overflows"

Time:09-26

Datetime cur_date

Cur_date=datetime (today (), now ())

Insert lgdate (sj) values (: cur_date);


Database field "sj" data type to a datetime
To save the data in the database always prompt "the data conversion overflows
"
How is this to return a responsibility excuse me?
Please help to explain! thank you

CodePudding user response:

If only you to insert a date/time in the table, why not use directly (getdate () function - for SQL server,
The sysdate oralce.

CodePudding user response:

Lgdate table of sj field is what type?

CodePudding user response:

reference 1st floor fm20027 response:
if only you to insert a date/time in the table, why not use directly (getdate () function - for SQL server,
In oralce is sysdate.

Insert lgdate (sj) values (getdate ());

CodePudding user response:

Must be type wrong,,,

CodePudding user response:

Sj field is a datetime type

CodePudding user response:

String ls_date

Ls_date=string (datetime (today (), now ()), "yyyy - mm - dd hh: mm: ss")


Insert into lgdate (sj) values (: ls_date) using the sqlca.

If the sqlca. Sqlcode=0 then
Commit the using the sqlca;
The else
The rollback using sqlca;
End the if

  • Related