Add new comment

hi,

the code below is used to insert a single record.can you please tell me how to insert multiple records in the same code using a "for" loop...i have not worked in VB before.so,can u please give me the required code...please help...

Set connect = CreateObject ("ADODB.Connection")
connect.open "DSN=OPTUMETL;Driver= Oracle in OraHome92;Server=urnts1.uhc.com;UID=OPTUMETL;PWD=OPTUMETL"
Reporter.ReportEvent 0, "Database connection", "Successfully connected to URNTS1"
Set objRecordset = CreateObject("ADODB.Recordset")
' Stmt to execute the code
query="INSERT INTO STG_CARE.ASSESSMENTANSWER(ANSWERID, ANSWERGROUPID, ANSWERTEXT, DISPLAYSEQUENCE, ISEXCLUSIVENO, ISEXCLUSIVEYES,
CREATEBY, CREATEDATE, UPDATEBY, UPDATEDATE, RECORDSTATUS, RECORDVERSION, RECORDSOURCE, SYNCDATE, RECORDUNIQUEID,
PARENTRECORDUNIQUEID, AUDIT_CREAT_DT, AUDIT_UPDATE_DT, SRC_SYSTEM_ID)VALUES(95149, 95052, 'Yes (Red Flag)', 10, 0, 0, 1, TO_DATE('11/10/2005
01:05:29 PM','DD/MM/YYYY HH12:MI:SS PM'), 1, TO_DATE('11/10/2005 01:05:29 PM','DD/MM/YYYY HH12:MI:SS PM'), 0, 1, 0, TO_DATE('01/01/1900 12:00:00
AM','DD/MM/YYYY HH12:MI:SS PM'), 0, NULL, TO_DATE('18/08/2008 06:06:16 AM','DD/MM/YYYY HH12:MI:SS PM'), TO_DATE('18/08/2008 06:09:13 AM','DD/MM/YYYY
HH12:MI:SS PM'), 'CARE')"
msgbox query
Set objResults = connect.Execute(query) ' Cmd used to execute the sql
'
Reporter.ReportEvent 0, "Query execution", "Executed query successfully"
'
'objResults.Close

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3>
  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.