2017-10-28 4 views
0

に番号パラメータを渡そうとしたとき、私はこのクエリがありますPostgresqlの - 「ERROR:またはその近く構文エラー " - " ストアドプロシージャ

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); 

をそして、私はこのエラーを取得する:

ERROR: syntax error at or near "-" 
LINE 5: ...ser_location_update(notify_user_1, 1, 43.4765965, -80.539129... 
「 - 」私が削除した場合

は。クエリが成功するにはどうすれば成功した負の数を渡すん

答えて

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

たぶん文字列への自動変換が負の値で失敗するので、あなたが使用する必要があります。

... notify_on_user_location_update('notify_user_1', '1', '43.4765965', '-80.5391294', '500'); 
関連する問題