WellsCarrie
Well-known member
FIXED!!!!!
the problem was that the reader was executing the wrong sqlstring.
Ok if this question has been answered somewhere just tell me.
I have a SQL statement that returns a container number as a string when run in SQLPlus but when run through the OracleDataReader it comes out as a decimal.
The field is defined as VARCHAR2(30) in the database table. It holds values like "00000415544119783174" and "00000415544119783174" these are used to identify the Pallets that go on a specified truck. However when the reader gets to the point of giving me the data it has turned it into a decimal. I have to have the string. Any suggestions?
the problem was that the reader was executing the wrong sqlstring.
Ok if this question has been answered somewhere just tell me.
I have a SQL statement that returns a container number as a string when run in SQLPlus but when run through the OracleDataReader it comes out as a decimal.
VB.NET:
'// Open the detail dataset
sb.Remove(0, sb.Length)
sb.Append("SELECT DECODE(pld.cont_num, '', DECODE(pld.mast_cont_num, '', ")
sb.Append("'NO CONTAINER NUMBER', pld.mast_cont_num), pld.cont_num) AS cont_num, ")
sb.Append("pld.line_num, pld.itm_num, pld.itm_desc, ")
sb.Append("pld.lot_shipped, pld.qty_ord, pld.qty_shipped, ")
sb.Append("pld.itm_wgt, pld.pro_num ")
sb.Append("FROM unisearchpacklistdtl pld ")
sb.Append("WHERE pld.hdr_id = ")
sb.Append(lHeaderID)
sb.Append(" ORDER BY pld.cont_num, pld.line_num ")
ohiocmd5.Connection = ohioConn5
ohiocmd5.CommandText = sb.ToString()
rsDetailData = ohiocmd.ExecuteReader()
If rsDetailData.HasRows() Then
Do While rsDetailData.Read()
'// Get the current container number "cont_num"
If IsDBNull(rsDetailData("cont_num")) Then
sFieldValue = ""
Else
sFieldValue = rsDetailData("cont_num")
End If
....
much more processing
....
End While
End If
The field is defined as VARCHAR2(30) in the database table. It holds values like "00000415544119783174" and "00000415544119783174" these are used to identify the Pallets that go on a specified truck. However when the reader gets to the point of giving me the data it has turned it into a decimal. I have to have the string. Any suggestions?
Last edited: