Link Variables out of string
Explicit type cast syntax conform to SQL

http://www.postgresql.org/docs/9.3/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS
Change varchar for text