> I created a simple function that i want to use another function > (in the same schema) that will be used to create a sql statement. > I get the following error when i try this: > > *ERROR: syntax error at or near "EXEC" at character 1 > QUERY: EXEC SQL EXECUTE $1 INTO $2 > CONTEXT: SQL statement in PL/PgSQL function "fcn_population" near > line 10
> EXEC SQL EXECUTE v_stmt INTO v_total_pop;
Could it be you're mixing MS SQL (Oracle?) syntax with pgplsql syntax