Home > Back-end >  The Insert Into statement variables in how to write?
The Insert Into statement variables in how to write?

Time:02-27

ADOQuery1. SQL. The Add (' Insert Into XusSheng (XueHao, XingMing, JiGuan) ');//JiGuan native this field, I want to use Edit2. Text
ADOQuery1. SQL. The Add (' Select XueHao, XingMing, Edit2. The text From XSDA ')//Edit2. The text is the variable,

CodePudding user response:

ADOQuery1. SQL. The Add (' Insert Into XusSheng (XueHao, XingMing, JiGuan) values (: XueHao, XingMing, : JiGuan) ');
ADOQuery1. The Parameters. ParamByName (' XueHao). Value:=Edit1. Text;
The parameter//other

CodePudding user response:

reference 1/f, play big shoot early nuclear response:
ADOQuery1. SQL. The Add (' Insert Into XusSheng (XueHao, XingMing, JiGuan) values (: XueHao, XingMing, : JiGuan) ');
ADOQuery1. The Parameters. ParamByName (' XueHao). Value:=Edit1. Text;
The parameter//other


Isn't this meaning,

I like to clarify some:

There are two tables,
Table A: fields are respectively: XueHao, XingMing, JiGuan//student id, name, domicile of origin
Table B: fields are: XueHao, XingMing//he has no native this field

But now I'm going to put the table data is inserted into A table. A, B

VAR
JG: String;

ADOQuery1. SQL. The Add (' Insert Into table (XueHao, XingMing, JiGuan) A ');//JiGuan native this field, I want to use Edit2. Text
ADOQuery1. SQL. The Add (' Select XueHao, XingMing, (JG here I think is a variable) From table B ')//(JG) is a variable,

CodePudding user response:

refer to the second floor of NEEZA which zha reply:
Quote: refer to 1st floor play big shoot early nuclear response:
ADOQuery1. SQL. The Add (' Insert Into XusSheng (XueHao, XingMing, JiGuan) values (: XueHao, XingMing, : JiGuan) ');
ADOQuery1. The Parameters. ParamByName (' XueHao). Value:=Edit1. Text;
The parameter//other


Isn't this meaning,

I like to clarify some:

There are two tables,
Table A: fields are respectively: XueHao, XingMing, JiGuan//student id, name, domicile of origin
Table B: fields are: XueHao, XingMing//he has no native this field

But now I'm going to put the table data is inserted into A table. A, B

VAR
JG: String;

ADOQuery1. SQL. The Add (' Insert Into table (XueHao, XingMing, JiGuan) A ');//JiGuan native this field, I want to use Edit2. Text
ADOQuery1. SQL. The Add (' Select XueHao, XingMing, (JG here I think is a variable) From table B ')//(JG) is a variable,



Still didn't understand what you want

CodePudding user response:

Use the format function can solve such problems,
  • Related