I have been trying to get the current value of a sequence without success. I have read that "currval" does the job but I do not know how to use it. This is what I have tried and I get an error saying that "currval of sequence 'name_of_sequence' is not defined for the session.