I know that it is impossible to put data in the head of a writers document. But I need a method for doing that

I use a sql-database for all my project-datas in my templates. Therfore I need the database-entry on every page in a writers document.
One solution can be to get text by makro to the frame object. But I dont know how?
Can somebody help me to get the text in the frame from the database?