I have procedure in PostgreSQL defined as:
CREATE OR REPLACE FUNCTION CreateCursorC(text, text)
RETURNS text
LANGUAGE c
AS '$libdir/mylibs', $function$createcursorc$function$
Execute example:
SELECT CreateCursorC('cursor_name', 'SELECT a FROM x WHERE a=''text''');
Of course I would like to use parameters (DbCommand.Parameters). Like this:
SELECT CreateCursorC($1, 'SELECT a FROM x WHERE a=$2');
Unfortunately it's not working because parameter $2 is in quotes. Is there a way to accomplished this task using parameters and not by writing custom SQL escaping function?
I tried to get an answer at Devart Forum, but no luck: Parameterized Query as Procedure Parameter? | Devart Forums