Hello, I created a function "coalescec" which behaves the same as coalesce, but uses an integer and a string. Now I'm getting an error in the folowing statements : query := 'select "UID" from S_Users_To_Connection where ConnID = ' || coalescec(conn_id,'null'); execute query into nUID; ERROR: syntax error at or near "$2" at character 20 QUERY: SELECT $1 into $2 I have put UID in quotes because it seems to be a keyword. Here is the table script: create TEMP table S_Users_To_Connection( UID integer NOT NULL ,ConnID integer NOT NULL ,LoginID integer NOT NULL ); Any suggestions ? __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com