Código SQL:
[/CODE]Ver original
WITH resultadoUpdate AS ( UPDATE work_order SET invoice_pid = pinvoice_pid WHERE work_order_id = wo_id RETURNING work_order_pid ) SELECT COUNT(*) FROM resultadoUpdate AS filasAfectadas;
me lanza el siguiente error:
ERROR: syntax error at or near "WITH resultadoUpdate"
LINE 1: WITH resultadoUpdate AS ( UPDATE work_order SET invoice_pid ...
^
QUERY: WITH resultadoUpdate AS ( UPDATE work_order SET invoice_pid = $1 WHERE work_order_id = $2 RETURNING work_order_pid ) SELECT COUNT(*) FROM resultadoUpdate AS $3
Agradeceria cualquier ayuda