Hello Martijn,
please clarify your question. Saving data to database is not related to the REXLANG programmable block at all. Describe in more detail the functionality you are trying to achieve so that I or anybody else can help.
Kind regards
Jaroslav