Hay un error: ERROR: column "define" does not exist LINE 25: WHERE n.idnota =define ^