sql的问题 怎么用SQL语句在表名为TABLE1的表内增加一名为NAME的新列,类型为VARCHAR 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 alter table tablename add yourfieldname yourfielddatatype <null> [constraint] ALTER TABLE BIL_OtherBill add password char(20) not NULL default ('') //在指定的表中新填字段function AddField(LpFieldName: string; LpDataType: TFieldType; LpSize: Word): string; //建立新表var Sentence, SQLsentence: string;begin Sentence := ''; SQLsentence := ''; if LpFieldName = '' then raise EDBUpdateErr.Create('字段名不能为空'); if Pos(' ', LpFieldName) <> 0 then raise EDBUpdateErr.Create('字段名中不能含有空格字符'); if LpDataType = ftString then sentence := 'ADD ' + LpFieldName + ' Char(' + IntToStr(LpSize) + ')'; if LpDataType = ftInteger then sentence := 'ADD ' + LpFieldName + ' Integer'; if LpDataType = ftSmallInt then sentence := 'ADD ' + LpFieldName + ' SmallInt'; if LpDataType = ftFloat then sentence := 'ADD ' + LpFieldName + ' Float(' + IntToStr(LpSize) + ',0)'; if LpDataType = ftDate then sentence := 'ADD ' + LpFieldName + ' Date'; if LpDataType = ftTime then sentence := 'ADD ' + LpFieldName + ' Time'; if LpDataType = ftDateTime then sentence := 'ADD ' + LpFieldName + ' TimeStamp'; if sentence = '' then raise EDBUpdateErr.Create('无效的字段类型'); if SQLSentence = '' then SQLSentence := sentence else SQLSentence := SQLSentence + ', ' + sentence; Result := SQLSentence; //返回SQL句体end; alter table tablename add name varChar(100) 怎么用SQL语句在表名为TABLE1的表内增加一名为NAME的新列,类型为VARCHARalter table table1 add name varchar(10) null 如何定制自己的Panel,让它上面有按钮,输入框等。 如何屏蔽edit组件内容为空时运算出错? 两个小问题:应该与Application对象有关 我想做个矢量绘图系统,该用什么组件,比较头疼。 TDBChart无法显示Access数据表中的文本字段 其实是这样,见代码 怎样自己定义消息窗口?有没有这种模板? 请教windows,delphi消息处理机制。 关于idhttp操作cookie的问题. 求个 RzPageControl 标签页上面的关闭按钮 如何获取窗体中PageControl控件中包含的控件类型呀? 同名函数参数相同,返回值类型不同,如何做?
var
Sentence, SQLsentence: string;
begin
Sentence := '';
SQLsentence := '';
if LpFieldName = '' then
raise EDBUpdateErr.Create('字段名不能为空');
if Pos(' ', LpFieldName) <> 0 then
raise EDBUpdateErr.Create('字段名中不能含有空格字符');
if LpDataType = ftString then
sentence := 'ADD ' + LpFieldName + ' Char(' + IntToStr(LpSize) + ')';
if LpDataType = ftInteger then
sentence := 'ADD ' + LpFieldName + ' Integer';
if LpDataType = ftSmallInt then
sentence := 'ADD ' + LpFieldName + ' SmallInt';
if LpDataType = ftFloat then
sentence := 'ADD ' + LpFieldName + ' Float(' + IntToStr(LpSize) + ',0)';
if LpDataType = ftDate then
sentence := 'ADD ' + LpFieldName + ' Date';
if LpDataType = ftTime then
sentence := 'ADD ' + LpFieldName + ' Time';
if LpDataType = ftDateTime then
sentence := 'ADD ' + LpFieldName + ' TimeStamp';
if sentence = '' then
raise EDBUpdateErr.Create('无效的字段类型');
if SQLSentence = '' then
SQLSentence := sentence
else
SQLSentence := SQLSentence + ', ' + sentence;
Result := SQLSentence; //返回SQL句体
end;