Question : Cannot get objConn.execute sql to insert into database

Here's my problem... I have an insert statement within a LOOP... it works in other code I have but this peice of code (INSERT INTO ONLY) doesn't work....

everything before the INSERT INTO statement and AFTER works PERFECTLY!!!!

I just can't get the sqlXfer(i) to INSERT. I've uncommented out the Response.Write and viewed the SQL Statement for validity and it's formed correctly and even works in Enterprise Manager ISQL window.

Any thoughts please???

-------------------------------
for i = 1 to intRecCnt
                  
      'Get the records to be transferred FIRST ISSUES
      sqlA(i) = "SELECT ir_name, ir_desc, ir_due_date FROM meetings_issues_risks WHERE meeting_id = '" & intMtgID & "' AND exported_flg = '0' AND ir_type = '1'"
                                                'Response.Write(sqlA(i)) & "<br />"
      Set      objRS = objConn.Execute(sqlA(i))

      iNm(i) = objRS.Fields.Item("ir_name").Value
      iDs(i) = objRS.Fields.Item("ir_desc").Value
      iDd(i) = objRS.Fields.Item("ir_due_date").Value
            
      sqlXfer(i) = "INSERT INTO issues (issue_id,pid,issue_name,issue_description,date_due,date_assigned) " & _
      "VALUES ('" & intMaxVal + i & "','" & Session("SV_PID") & "','" & iNm(i) & "','" & iDs(i) & "','" & iDd(i) & "','" & Date & "')"
            
      'Response.Write(sqlXfer(i)) & "<br />"
      objConn.Execute sqlXfer(i)
                  
      'set the exported date and flag to 1
      sqlRS(i) = "UPDATE meetings_issues_risks SET date_exported = '" & Date & "', exported_flg = '1' WHERE meeting_id = '" & intMtgID & "' AND ir_type = '1' and exported_flg = '0'"
            
      'Response.Write(sqlRS(i)) & "<br />"
      objConn.Execute sqlRS(i)
                                          
next

Thanks, Peter

Answer : Cannot get objConn.execute sql to insert into database

Thank you for the clarification.  I get you now.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
select sess.EXCHANGE,
       sess.REGION,
       '('||trim(sd.DATA_CENTER)||')',
       max(li.latency_micro_sec) AS max_latency ,
       min(li.latency_micro_sec) AS min_latency,
       round(avg(li.latency_micro_sec),2) AS avg_latency,
       round(median(li.latency_micro_sec),2) AS med_latency,
       round(stddev(li.latency_micro_sec),2) AS stddev_latency
from latency_info li,
     threshold_lookup tl,
     xl_sessions sess,
     server_master sm,
     server_details sd, owner o
where li.trade_date BETWEEN add_months(TRUNC(SYSDATE),-1) AND SYSDATE
and   tl.instance = li.INSTANCE
and   sess.INSTANCE = li.INSTANCE
and   o.OWNER_ID = sm.OWNER_ID
and sm.OWNER_ID = sd.OWNER_ID(+)
and sm.SERVER_NAME = sd.SERVER_NAME(+)
and sm.SERVER_NAME = li.HOSTNAME
and sess.INSTANCE not in('BRK%')
and li.LATENCY_MICRO_SEC < 100000
and o.owner_name not in('Chan,Cindy')
and o.OWNER_TYPE = 'T'
group by sess.EXCHANGE,sess.REGION,trim(sd.DATA_CENTER)
Random Solutions  
 
programming4us programming4us