0

I have a custom spatial function and its working with this parameters (coordinates):

SELECT get_nearest_station (-80.364565, 26.070670);

Now, I want to update column "SOURCE" for all rows in a table 'employees_wgs' with this function. Coordinates are in columns X and Y for each record so I have to replace real coordinates with value from those columns.

How to write this query ? Is this need to be dynamic sql or else ?

Thanks

1
  • 1
    I would consider not to store the functionally dependent value redundantly. Create a VIEW instead. If you need to optimize performance, consider a MATERIALIZED VIEW. Commented Nov 27, 2014 at 18:48

1 Answer 1

2
update employees_wgs
  set source = get_nearest_station(x,y);
commit;
Sign up to request clarification or add additional context in comments.

1 Comment

that was fast! Thanks. I will try immidiately

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.