正在看的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 &

[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 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 & ", "
        

上一页  [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] 

标签:
|用表|表单|单来|来提|提交|交s|sq|ql|l(|(转|转)|)3|3|

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
白云城资源网 Copyright www.dyhadc.com

评论“用表单来提交sql(转)3”

暂无“用表单来提交sql(转)3”评论...

稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!

昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。

这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。

而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?