Accessing PostgresSQL time interval data
3 ビュー (過去 30 日間)
古いコメントを表示
When I fetch a table that contains a column of time intervals using the database toolbox I get a cursor object and can view and manipulate most of the data using commands like those below.
a = fetch(curs);
plot(cell2mat(a.Data(:,45)))
But, the time intervals are in an object class "org.postgresql.util.PGInterval"
x = a.Data(1,12);
>> class(x{1,1})
ans =
org.postgresql.util.PGInterval
>> a.Data{1,12}
ans =
0 years 0 mons 1 days 13 hours 18 mins 53.00 secs
How to I access and work with the data in these?
0 件のコメント
回答 (1 件)
the cyclist
2013 年 7 月 31 日
編集済み: the cyclist
2013 年 7 月 31 日
The closest equivalent I have done is getting an object of type
org.postgresql.jdbc4.Jdbc4Array
For that, I was able to extract using
data{1}.getArray
I think the general idea is that you have a class that you need to apply the appropriate Java method to. For me, that was "getArray", but for you it is presumably different.
This page looks like it has methods that you may be able to implement: http://jdbc.postgresql.org/development/privateapi/org/postgresql/util/PGInterval.html
Maybe that will aim you in the right direction.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!