2017-10-28 1 views
0

passieren versucht, habe ich diese Abfrage:Postgresql - „Fehler: Syntaxfehler bei oder in der Nähe von‚-‘wenn eine Anzahl Parameter auf eine gespeicherte Prozedur

CREATE TRIGGER notify_user_1 
AFTER INSERT OR UPDATE OR DELETE 
ON users 
FOR EACH ROW 
EXECUTE PROCEDURE notify_on_user_location_update(notify_user_1, 1, 43.4765965, -80.5391294, 500); 

Und ich bekomme diese Fehlermeldung:

ERROR: syntax error at or near "-" 
LINE 5: ...ser_location_update(notify_user_1, 1, 43.4765965, -80.539129... 

Wenn ich das entfernen ‚-‘. die Abfrage erfolgreich ist Wie gehe ich erfolgreich eine negative Zahl

Antwort

3

From the manual

?

The arguments are literal string constants. Simple names and numeric constants can be written here, too, but they will all be converted to strings

Vielleicht ist die automatische Umwandlung in Strings nicht mit einem negativen Wert, so sollten Sie verwenden:

... notify_on_user_location_update('notify_user_1', '1', '43.4765965', '-80.5391294', '500'); 
Verwandte Themen