Accessing PostgresSQL time interval data
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
the cyclist
il 31 Lug 2013
Modificato: the cyclist
il 31 Lug 2013
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 Commenti
Vedere anche
Categorie
Scopri di più su Database Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!