필터 지우기
필터 지우기

Fetch(conn,statement) returning int64 instead of float or double

조회 수: 2 (최근 30일)
Frank Schiro
Frank Schiro 2018년 12월 25일
댓글: James Maniscalco 2020년 5월 19일
I am trying to import data from SQLite with fetch. It is importing the data as int64. I would like it to import with the data type of double because with int 64 I am either getting 1 or 0, but the values I am looking at are 0.63, ect.
How can I make fetch(conn,statement) import as datetype double instead of int64? I can't find it in the documentation.
These are the commands I am running :
statement=strcat("select val from historical where sym like '",SYM,"' and Tag like 'EPS'");
y=fetch(conn,statement);
Data I am getting back looks like this :
Columns 1 through 36
1 0 0 0 0 0 0 0 0 2 6 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 0 0 0
But the data in my SQLite database looks like this:
1
0.63
0.71
-0.13
0.45
0.48
0.49
0.46
0.24
2.19
6.12
0.38
0
0.6
0.78

답변 (1개)

Hitesh Kumar Dasika
Hitesh Kumar Dasika 2018년 12월 27일
This is a known issue in MATLAB R2018b. This issue is fixed in the latest update of R2018b. Please check for the product updates of your installation.
  댓글 수: 3
Frank Schiro
Frank Schiro 2020년 5월 18일
I switched to R hahaha
James Maniscalco
James Maniscalco 2020년 5월 19일
In the end I managed to rewrite my app to use a JDBC driver connection instead of SQLite for MATLAB. The JDBC version returns the correct values from the database.
As for making the switch, the two methods aren't totally interchangeable vis-a-vis function names and data types (e.g. cell vs table) but they are decently close. I would have preferred to use SQLite for MATLAB to avoid external dependencies, but oh well.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by