gpt4 book ai didi

delphi - 当文字很长时如何在delphi中插入

转载 作者:行者123 更新时间:2023-12-01 18:59:16 25 4
gpt4 key购买 nike

当我运行时,这条短信来了:字符串文字可能最多有 255 个元素

这是我的代码:

dm.qr_emp.SQl.Add('insert into emp_per(nom, prenom, date_naiss1, cle_ccp,nomf,prenomf,lieu_naiss,sex,adr,id_corps,id_fonction,id_categ,montant_resp,compte_ccp,etat,sal_base,id_grade,id_banque,id_degree,sal_unique,pfc,iep,num_social,sal_principale,ind,salaire,montant_irg,ss,nbr_enfant,nbr_enfant_sup) ');
dm.qr_emp.SQL.Add('values('+quotedstr(edit1.Text)+', '+quotedstr(edit2.Text)+','+quotedstr(formatdatetime('yyyy-dd-mm',datetimepicker1.DateTime))+', '+ edit4.Text+','+quotedstr(edit5.Text)+','+quotedstr(edit3.Text)+','+quotedstr(edit6.Text)+','+quotedstr(ComboBox3.Text)+','+quotedstr(edit8.Text)+','+ inttostr(id_corps)+','+ inttostr(id_fonction)+', '+quotedstr(edit10.Text)+','+floattostr(salair_responsabilite)+','+quotedstr(edit7.Text)+','+quotedstr(ComboBox5.Text)+','+floattostr(salaire_base)+','+ inttostr(id_grade)+','+ inttostr(id_banque)+','+ inttostr(id_degree)+','+quotedstr(ComboBox8.Text)+','+ floattostr(pfc)+','+quotedstr(edit15.Text)+','+quotedstr(edit13.Text)+','+ floattostr(sal_principale)+','+floattostr(ind)+','+quotedstr(edit20.text)+','+floattostr(montant_irg)+','+floattostr(ss)+', '+quotedstr(edit23.Text)+', '+quotedstr(edit26.Text)+' )');
dm.qr_emp.ExecSQL;

最佳答案

如果您的文字太长,那么您需要将其分成多个部分。例如:

dm.qr_emp.SQl.Add(
'insert into emp_per(nom, prenom, date_naiss1, cle_ccp,nomf,prenomf,' +
'lieu_naiss,sex,adr,id_corps,id_fonction,id_categ,montant_resp,' +
'compte_ccp,etat,sal_base,id_grade,id_banque,id_degree,sal_unique,' +
'pfc,iep,num_social,sal_principale,ind,salaire,montant_irg,' +
'ss,nbr_enfant,nbr_enfant_sup) '
);

关于delphi - 当文字很长时如何在delphi中插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50738111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com