Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
Description
The below cod, querying an Hbase table, always returns an empty string so the length of the variable Page = 0. When executing the same SQL from SQLCI, it works OK the first time; if trying the second time, SQLCI core-dumps. I then start SQLCI again and it works, but only one time before a new core dump.
This is the snipped from my aps: So the ODBC driver in line 09 indicates that there are data returned and in line 10 it’s indicated that it’s not a NULL value, but after executing line 11, the variable Page is empty. I use the same method when talking to Trafodion tables and it works just fine.
Mind you, this is the html data of up-to 32K I’m retrieving so must have something to do with the length because if I retrieve the row_id, which is only 14 CHARS, it works ok.
01 With CMDtraf
02 .CommandTimeout = 60
03 .Connection.Open()
04 .Parameters.Add("@caseid", OdbcType.Char, 14)
05 .CommandText = "SELECT col_value from hbase.""CELL"".""bjcases"" WHERE row_id = ?"
06 .Prepare()
07 .Parameters("@caseid").Value = CaseID
08 Dim odbcreader As OdbcDataReader = .ExecuteReader()
09 If odbcreader.HasRows Then
10 If Not IsDBNull(odbcreader(0)) Then
11 Page = odbcreader(0)
12 Dim TheBrowser = CreateObject("InternetExplorer.Application")
13 TheBrowser.Visible = True
14 TheBrowser.Navigate(Page)
15 Else
16 labAlertMsg.Text = "Case page not found in Trafodion"
17 End If
18 End If
19 odbcreader.Close()
20 .Connection.Close()
21 End With
So these are the 3 statements I have tried in line 05 (with double “” removed. Only in the code for syntax reason.
SELECT col_value from hbase."CELL"."bjcases" WHERE row_id = ?
SELECT CAST(col_value AS VARCHAR(1000)) from hbase."CELL"."bjcases" WHERE row_id = ?
SELECT LEFT(col_value,1000) from hbase."CELL"."bjcases" WHERE row_id = ?