Hello all, I am trying to create a ParaView reader (or source) that uses vtkODBCDatabase to connect and read data from an Oracle Database.
I compiled ParaView with : VTK_USE_ODBC ON ODBC_INCLUDE_DIRECTORIES C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Include ODBC_LIBRARY C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/odbc32.lib The connection is working correctly: vtkODBCDatabase* db = vtkODBCDatabase::New(); vtkStdString dataSourceName ="DRIVER={Microsoft ODBC for Oracle};SERVER=localhost:1521/xe/;"; db->SetDataSourceName(dataSourceName.c_str()); db->SetUserName("user"); bool status = db->Open("password"); To get a specific table from the database and information about the columns I do: vtkSQLQuery* sqlQuery = db->GetQueryInstance(); vtkStdString query = "select * from " + vtkStdString(tableName); sqlQuery->SetQuery(query.c_str()); sqlQuery->Execute(); for(int j=0; j<sqlQuery->GetNumberOfFields(); ++j) { vtkStdString fieldName = sqlQuery->GetFieldName(j); int fieldType = sqlQuery->GetFieldType(j); } All that is working very well. The problem happens when I try to read values of "Number" data type: while(sqlQuery->NextRow()) { // the first column is a "string" so it works -> ok = true bool ok = sqlQuery->DataValue(0).IsValid(); // the second value is a Number-> ok = false this time. bool ok = sqlQuery->DataValue(1).IsValid(); } Reading a Number value from a row is returning an invalid vtkVariant. Any ideas ? I also tried "float" columns and it works. It seems that the problem happens only with "Number". I created the table with a query like: CREATE TABLE Table1 (Name VARCHAR2 (40), Value NUMBER (38,8)); Thanks, Nehme _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview