This short piece of SQL code shows how to use the taGetNextJournalEntry stored procedure to get the next GL Journal number.
taGetNextJournalEntry is a stored procedure that is part of eConnect, and is used internally when you call the 'GetNextJournalNumber' endpoint in eConnect.
But if you know how, it can be called manually as well.