我有以下代码可从中访问两列。第一列为varchar
类型,第二列为Long
类型。
我无法从记录集变量中获取完整的字符串。 Long
类型变量中的数据是JSON字符串。代码如下。
For i = 2 To lastrow
sQuery = "select TCSCOMPANY_ID, TCS3TVGRID from (select TCSCOMPANY_ID,TCDMODIFIED_DATE, TCS3TVGRID from MAR_TRN_3TV_CHART where TCSCOMPANY_ID='" & Sheets("LIST").Cells(i, 1) & "' order by TCDMODIFIED_DATE desc) where ROWNUM=1"
'MsgBox sQuery
cmd.ActiveConnection = con
cmd.CommandText = sQuery
Set rs = cmd.Execute()
If i = 2 Then
Workbooks("" & wkbkname).Worksheets("TEMP").Cells(1, 1).CopyFromRecordset rs
Else
lastrowtemp = Workbooks("" & wkbkname).Worksheets("TEMP").Cells(rows.Count, "A").End(xlUp).Row
Workbooks("" & wkbkname).Worksheets("TEMP").Cells(lastrowtemp + 1, 1).CopyFromRecordset rs
End If
rs.Close
Set rs = Nothing
Next
con.Close
For
循环用于获取具有多个ID的记录。当我对Oracle收费执行相同的查询时,它工作正常,并给出如下结果。
我应该得到的是那条大绳子,但我得到的却是另一根。请同样提供帮助。