Praneeth30
New Member
Hey guys,
I was trying to extract data from Mainframe Db2 using VB and have some issue in the way it is pulling data.
This is the query im using:
SQLSelectStatement = "SELECT" & " " & strColumnD & " " & " " & "FROM" & " " & strdb & strtable & " " & "WHERE " & "INVN_CTL_NBR= " & "'" & strICNval & "'" & " " & " WITH UR"
adoDB2RecordSet.Open SQLSelectStatement, db2con
Set adoDB2RecordSet = db2con.Execute(SQLSelectStatement)
k = 0
Do While adoDB2RecordSet.EOF = False
arrayval = varcol(k)
Cells(index1, arrayval).Value = adoDB2RecordSet(0).Value
But when it is returning the data for columns which are defined as CHAR(X) in Db2 - Trailing spaces are returned as shown below:
(Spaces are represeneted in double quotes " "")
For example:
Corresponding DB2 Table Corresponding DB2 Column Db2 Value 1 Db2 Value 2
ABCD2 EE_NM
ELLIS" "
SAADIA" "
I was trying to extract data from Mainframe Db2 using VB and have some issue in the way it is pulling data.
This is the query im using:
SQLSelectStatement = "SELECT" & " " & strColumnD & " " & " " & "FROM" & " " & strdb & strtable & " " & "WHERE " & "INVN_CTL_NBR= " & "'" & strICNval & "'" & " " & " WITH UR"
adoDB2RecordSet.Open SQLSelectStatement, db2con
Set adoDB2RecordSet = db2con.Execute(SQLSelectStatement)
k = 0
Do While adoDB2RecordSet.EOF = False
arrayval = varcol(k)
Cells(index1, arrayval).Value = adoDB2RecordSet(0).Value
But when it is returning the data for columns which are defined as CHAR(X) in Db2 - Trailing spaces are returned as shown below:
(Spaces are represeneted in double quotes " "")
For example:
Corresponding DB2 Table Corresponding DB2 Column Db2 Value 1 Db2 Value 2
ABCD2 EE_NM
ELLIS" "
SAADIA" "