Home > database >  To save the data in a SQL database always prompt when "the data conversion overflows"
To save the data in a SQL database always prompt when "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?

If you want to save your time into "of" the 2011-1-1 10:14:12 format should be how to do

Please help to explain! thank you

CodePudding user response:

String cur_date

Cur_date=the convert (datetime (today (), now ()), the char (12), 120)

Insert lgdate (sj) values (: cur_date);

CodePudding user response:

It always prompt "unkonw function name: convert."

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

CodePudding user response:

Positive solution!!!!!
The
reference 3 floor zb63668331 response:
C/C + + code


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=...

CodePudding user response:

Sorry, confused with SQL!
refer to the second floor sinoo74 response:
it always prompt "unkonw function name: convert"

CodePudding user response:

Upstairs seem no good oh,
Sj is of type datetime field you insert in the string

CodePudding user response:

The convert syntax is essentially a database, what database do you use?
To convert the variable date type first, and then insert,
  • Related