Accessing PostgresSQL time interval data
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
the cyclist
el 31 de Jul. de 2013
Editada: the cyclist
el 31 de Jul. de 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 comentarios
Ver también
Categorías
Más información sobre Database Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!