正在看的db2教程是:用表单来提交sql(转)3。 列表 D: buildSQLInsert函数的最终版。
<%
function buildSQLInsert( targetTable, omitFields)
iStr = "insert into " & targetTable & " "
vStr = "values ("
nStr = "("
在表单集合中循环,并建立起SQL语句的组成部分
for each x in request.form
fieldName = uCase(x)
判断字段是否被省略?
if inStr(uCase(omitFields),x) = 0 then
fieldData = replace(request.form(fieldName), _
"", "")
如果没有数据,就插入 NULL
if trim(fieldData) = "" then
fieldData = "NULL"
vStr = vStr & fieldData & ", "
nStr = nStr & fieldName & ", "
else
typeDelimPos = inStr(fieldName, "_")
if typeDelimPos = 0 then
是文本字段
建立字段名列表
nStr = nStr & fieldName & ", "
vStr = vStr &
else
字段是其它类型
fieldType = left(fieldName, typeDelimPos - 1)
fieldName = mid(fieldName, typeDelimPos + 1)
把字段名加入名称列表
nStr = nStr & fieldName & ", "
把字段类型变成大写以确保匹配
select case uCase(fieldType)
case "NUM"
vStr = vStr & fieldData & ", "
把不明类型按文本型处理
case else
vStr = vStr & "" & fieldData & ", "
end select
end if
&
end if
next
把结尾的", " 从我们建立的字符串中去掉
vStr = left(vStr, len(vStr) - 2) & ")"
nStr = left(nStr, len(nStr) - 2) & ") "
把SQL语句整合起来
buildSQLInsert = iStr & nStr & vStr
end function
if trim(request("fName")&request("lname")&request("age")) <> "" then
response.write( buildSQLInsert("") & "
response.write( buildSQLInsert("NUM_AGE") & "
")
response.write( buildSQLInsert("lname,fname") & "
")
response.write( buildSQLInsert("mycheckbox,fname") &
=<"
else
%>
<%
end if
%>
列表 D: buildSQLInsert函数的最终版。
<%
function buildSQLInsert( targetTable, omitFields)
iStr = "insert into " & targetTable & " "
vStr = "values ("
nStr = "("
在表单集合中循环,并建立起SQL语句的组成部分
for each x in request.form
fieldName = uCase(x)
判断字段是否被省略?
if inStr(uCase(omitFields),x) = 0 then
fieldData = replace(request.form(fieldName), _
"", "")
如果没有数据,就插入 NULL
if trim(fieldData) = "" then
fieldData = "NULL"
vStr = vStr & fieldData & ", "
else
typeDelimPos = inStr(fieldName, "_")
if typeDelimPos = 0 then
是文本字段
建立字段名列表
nStr = nStr & fieldName & ", "
vStr = vStr & "" & fieldData & ", "
else
字段是其它类型
fieldType = left(fieldName, typeDelimPos - 1)
fieldName = mid(fieldName, typeDelimPos + 1)
把字段名加入名称列表
nStr = nStr & fieldName & ", "
把字段类型变成大写以确保匹配
select case uCase(fieldType)
&n
vStr = vStr & fieldData & ", "
把不明类型按文本型处理
case else
vStr = vStr & "" & fieldData & ", "
end select
end if
end if
end if
next
把结尾的", " 从我们建立的字符串中去掉
vStr = left(vStr, len(vStr) - 2) & ")"
nStr = left(nStr, len(nStr) - 2) & ") "
把SQL语句整合起来
buildSQLInsert = iStr & nStr & vStr
end function
if trim(request("fName")&request("lname")&request("age")) <> "" then
response.write( buildSQLInsert("") & "
response.write( buildSQLInsert("NUM_AGE") & "
")
response.write( buildSQLInsert("lname,fname") & "
")
response.write( buildSQLInsert("mycheckbox,fname") &
=<"
else
%>
<%
end if
%>
<%
function buildSQLInsert( targetTable, omitFields)
iStr = "insert into " & targetTable & " "
vStr = "values ("
nStr = "("
在表单集合中循环,并建立起SQL语句的组成部分
for each x in request.form
fieldName = uCase(x)
判断字段是否被省略?
if inStr(uCase(omitFields),x) = 0 then
fieldData = replace(request.form(fieldName), _
"", "")
如果没有数据,就插入 NULL
if trim(fieldData) = "" then
fieldData = "NULL"
vStr = vStr & fieldData & ", "
nStr = nStr & fieldName & ", "
else
typeDelimPos = inStr(fieldName, "_")
if typeDelimPos = 0 then
是文本字段
建立字段名列表
nStr = nStr & fieldName & ", "
vStr = vStr &
[1] [2] [3] [4] [5] 下一页
正在看的db2教程是:用表单来提交sql(转)3。"" & fieldData & ", "else
字段是其它类型
fieldType = left(fieldName, typeDelimPos - 1)
fieldName = mid(fieldName, typeDelimPos + 1)
把字段名加入名称列表
nStr = nStr & fieldName & ", "
把字段类型变成大写以确保匹配
select case uCase(fieldType)
case "NUM"
vStr = vStr & fieldData & ", "
把不明类型按文本型处理
case else
vStr = vStr & "" & fieldData & ", "
end select
end if
&
上一页 [1] [2] [3] [4] [5] 下一页
正在看的db2教程是:用表单来提交sql(转)3。nbsp; end ifend if
next
把结尾的", " 从我们建立的字符串中去掉
vStr = left(vStr, len(vStr) - 2) & ")"
nStr = left(nStr, len(nStr) - 2) & ") "
把SQL语句整合起来
buildSQLInsert = iStr & nStr & vStr
end function
if trim(request("fName")&request("lname")&request("age")) <> "" then
response.write( buildSQLInsert("") & "
response.write( buildSQLInsert("NUM_AGE") & "
")
response.write( buildSQLInsert("lname,fname") & "
")
response.write( buildSQLInsert("mycheckbox,fname") &
=<"
else
%>
<%
end if
%>
列表 D: buildSQLInsert函数的最终版。
<%
function buildSQLInsert( targetTable, omitFields)
iStr = "insert into " & targetTable & " "
vStr = "values ("
nStr = "("
在表单集合中循环,并建立起SQL语句的组成部分
for each x in request.form
fieldName = uCase(x)
判断字段是否被省略?
if inStr(uCase(omitFields),x) = 0 then
fieldData = replace(request.form(fieldName), _
"", "")
如果没有数据,就插入 NULL
if trim(fieldData) = "" then
fieldData = "NULL"
vStr = vStr & fieldData & ", "
上一页 [1] [2] [3] [4] [5] 下一页
正在看的db2教程是:用表单来提交sql(转)3。 nStr = nStr & fieldName & ", "else
typeDelimPos = inStr(fieldName, "_")
if typeDelimPos = 0 then
是文本字段
建立字段名列表
nStr = nStr & fieldName & ", "
vStr = vStr & "" & fieldData & ", "
else
字段是其它类型
fieldType = left(fieldName, typeDelimPos - 1)
fieldName = mid(fieldName, typeDelimPos + 1)
把字段名加入名称列表
nStr = nStr & fieldName & ", "
把字段类型变成大写以确保匹配
select case uCase(fieldType)
&n
上一页 [1] [2] [3] [4] [5] 下一页
正在看的db2教程是:用表单来提交sql(转)3。bsp; case "NUM"vStr = vStr & fieldData & ", "
把不明类型按文本型处理
case else
vStr = vStr & "" & fieldData & ", "
end select
end if
end if
end if
next
把结尾的", " 从我们建立的字符串中去掉
vStr = left(vStr, len(vStr) - 2) & ")"
nStr = left(nStr, len(nStr) - 2) & ") "
把SQL语句整合起来
buildSQLInsert = iStr & nStr & vStr
end function
if trim(request("fName")&request("lname")&request("age")) <> "" then
response.write( buildSQLInsert("") & "
response.write( buildSQLInsert("NUM_AGE") & "
")
response.write( buildSQLInsert("lname,fname") & "
")
response.write( buildSQLInsert("mycheckbox,fname") &
=<"
else
%>
<%
end if
%>
上一页 [1] [2] [3] [4] [5]
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
白云城资源网 Copyright www.dyhadc.com
暂无“用表单来提交sql(转)3”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年06月29日
2024年06月29日
- 瑞鸣音乐《中国音乐地图之听见河南豫剧经典唱段》2020[WAV分轨]
- 【伊比萨沙发】VA-2024-IbizaSpring2024(LoungeCocktailsfromtheHeart)[FLAC]
- 群星《世界顶级汽车音响试音王》4K金碟16CD[WAV+CUE]
- 群星-音效环绕天碟《极致环绕人声天碟天品》7CD[WAV]
- 泰拉克SACD古典试音碟7SACD-ISO
- 群星《红歌宝典》20CD[WAV/分轨]
- 《101系列:好歌101首 细听年代精选》[WAV+CUE][3.6GB]
- 《101系列 6CD 国语经典101首歌曲 张学友 王菲代表作》[APE+CUE][2.8GB]
- 《101系列:国语经典101 VOL2 6CD 精选最经典101首》[WAV+CUE][2.3GB]
- 群星《十年网络红歌》15CD[WAV分轨]
- 宝丽金-环球10周年至50周年经典金曲15CD[低速原抓WAV+CUE]
- FIM唱片《十大男伶》[低速原抓WAV+CUE]
- 《101系列:情歌101 6CD》[WAV+CUE][3.1GB]
- 庄心妍《降调版合集》[320K/MP3][52.96MB]
- 庄心妍《降调版合集》[FLAC/分轨][118.78MB]