dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35097
Re: Last hibernate sequence value
Hi Greg,
I would tend to agree with Lars that this should really not ever be
required, but it would be good to know what the use case actually is.
The easiest way to do this would be to create an SQL view in DHIS2 as
SELECT currval('hibernate_sequence')
In a multi-user database environment, this value is of course volatile, so
you can never be sure what the actual current value is.
If you really need to inject SQL into your database, then using something
like 'nextval('hibernate_sequence'::regclass)'in your SQL, which will
provide the next value of the sequence.
Regards,
Jason
On Fri, Jan 16, 2015 at 9:49 AM, Lars Helge Øverland <larshelge@xxxxxxxxx>
wrote:
> Hi Greg,
>
> that would be easy to implement, but the idea is that it should never be
> necessary to expose database details and instead work with the API. Do you
> think you could elaborate a bit on the use-case?
>
> Lars
>
>
> On Fri, Jan 16, 2015 at 8:35 AM, Greg Rowles <greg.rowles@xxxxxxxxx>
> wrote:
>
>> Hi Devs
>>
>> Is there an easy way to expose the last hibernate sequence value through
>> the web API?
>>
>> Greg
>>
>> --
>> *Health Information Systems Program - South Africa*
>> *- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - -
>> - *
>> Mobile : 073 246 2992
>> Landline: 021 554 3130
>> Fax: 086 733 8432
>> Skype: gregory_rowles
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help : https://help.launchpad.net/ListHelp
>>
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
>
--
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049
Follow ups
References