Hallo Andy, > I do not think you can evaluate a declared vairable as a table name in the > SELECT statement. where can I find some docu about declare a table by variable. > I don't think you really need to do this though. If you have the table name > already. > why go: > SELECT next_id(logs); > SELECT MAX(id) + 1 FROM logs; it's only a example, I got everytime the error: PostgreSQL meldet: ERROR: parser: parse error at or near "$1" PS.: Excuse me, for my bad english :) MfG Bernd