Ø
Øyvind Isaksen
Hello!
I need to dynamic generate a SQL statement based on how many images a user
select to upload.
Here you see an example with 2 images. It can be up to 50 images and I dont
want to write this lines 50 times since they are almost identical (Example,
first line has "varImage_1" , the second has "varImage_2"... and It shall go
up to varImage_50...).
How can I "generate" these lines so I only need to write it once, by using a
loop?
<%
if varImage_1 <> "" then SQL = SQL & "insert into tblImage
(path,sort,artID,custID,text) values
('"&varImage_1&"','1','"&dbArtID&"','"&varCustID&"','"&varTextImage1&"'); "
if varImage_2 <> "" then SQL = SQL & "insert into tblImage
(path,sort,artID,custID,text) values
('"&varImage_2&"','2','"&dbArtID&"','"&varCustID&"','"&varTextImage2&"'); "
%>
I need to dynamic generate a SQL statement based on how many images a user
select to upload.
Here you see an example with 2 images. It can be up to 50 images and I dont
want to write this lines 50 times since they are almost identical (Example,
first line has "varImage_1" , the second has "varImage_2"... and It shall go
up to varImage_50...).
How can I "generate" these lines so I only need to write it once, by using a
loop?
<%
if varImage_1 <> "" then SQL = SQL & "insert into tblImage
(path,sort,artID,custID,text) values
('"&varImage_1&"','1','"&dbArtID&"','"&varCustID&"','"&varTextImage1&"'); "
if varImage_2 <> "" then SQL = SQL & "insert into tblImage
(path,sort,artID,custID,text) values
('"&varImage_2&"','2','"&dbArtID&"','"&varCustID&"','"&varTextImage2&"'); "
%>