I have 6 textboxes where user can input data (or can leave it blank). I need to insert all the data (if not blank) into the database. How should be SQL query be like?
Code:
insEntrydate = pd(DAY(date()),2) & "." & pd(MONTH(date()),2) & "." & pd(YEAR(date()),2)
insOwner = Request.Form("txtselOwner")
insDepartment = Request.Form("txtselDepartment")
insTechnology = Request.Form("txtselTechnology")
insProductname = Request.Form("txtselProductname")
insContents = Request.Form("txtselContents")
insTransferdest = Request.Form("txtselTransferdest")
insExportrelevant = Request.Form("txtselExportrelevant")
insfilename1 = Request.Form("txtselfilename1")
insfilesize1 = Request.Form("txtselfilesize1")
insfilename2 = Request.Form("txtselfilename2")
insfilesize2 = Request.Form("txtselfilesize2")
insfilename3 = Request.Form("txtselfilename3")
insfilesize3 = Request.Form("txtselfilesize3")
insfilename4 = Request.Form("txtselfilename4")
insfilesize4 = Request.Form("txtselfilesize4")
insfilename5 = Request.Form("txtselfilename5")
insfilesize5 = Request.Form("txtselfilesize5")
insfilename6 = Request.Form("txtselfilename6")
insfilesize6 = Request.Form("txtselfilesize6")
sql="INSERT into mask_info(TRANSFER_NO, ENTRY_DATE, OWNER, DEPARTMENT, TECHNOLOGY, PRODUCT_NAME, CONTENTS, TRANSFER_DEST, EXPORT_RELEVANT) values ('"&fcount&"',to_date('"&insEntrydate&"','dd/mm/yyyy'),'"&insOwner&"','"&insDepartment&"','"&insTechnology&"','"&insProductname&"','"&insContents&"','"&insTransferdest&"','"&insExportrelevant&"')"
Set objRS1 = OraDatabase.Execute(sql)
sql2="INSERT into mask_info(TRANSFER_NO, FILENAME, FILESIZE) values ('"&fcount&"','"&insfilename&"','"&insfilesize&"')"
Set objRS2 = OraDatabase.Execute(sql2)