Home > database >  Pb how to realize the insert a column automatically when a data plus one
Pb how to realize the insert a column automatically when a data plus one

Time:10-18

Is this code
String id, name, major, qq, uid, uname, phone, a tiny
Int sex
Id=trim (sle_id. Text)
Name=trim (sle_name. Text)
Major=trim (sle_major. Text)
Qq=trim (sle_qq. Text)
Uid=trim (sle_uid. Text)
Uname=trim (sle_uname. Text)
Phone=trim (sle_phone. Text)
A tiny=trim (sle_reason. Text)
Sex=rb

Insert into join_union values (: id, name, sex, : major, : qq, : phone, : "reason, 0, : uid, : id) using the sqlca.
If the sqlca. Sqlcode & lt;> 0 then
The rollback using sqlca;
Messagebox (' hint! ', 'apply for failure! ', stopsign!)
The else
Commit the using the sqlca;
Messagebox (', 'sent successfully! ')
End the if
Close (w_applyunion1)
How to make the ID value, each time point "for" control, automatically add a

CodePudding user response:

1. Declare an integer variable
The integer li_id_auto_inc

2. After this line add
Id=trim (sle_id. Text)

Li_id_auto_inc=integer (id)//the id into integer
Li_id_auto_inc + + +//integer 1
Id=string (li_id_auto_inc)//to a string back to id
  • Related