So, i am having a problem to update a PI point based on a resultset of a table link accessing a PostGreSQL.
Basically, I have two situations where the first one, I have success and the second one, the values are just updated with the same value. Both are using the same architecture/idea (it means, same odbc connection, same Template, etc...). The "big" difference between cases is that:
The first one is running the following SQL into PostGre:
The second one is running:
As a "test" (which is returning a simple dataset), the function "CalcVazaoVertida" inside PostGreSQL is listed below:
CREATE OR REPLACE FUNCTION CalcVazaoVertida(pIdReservoir int, pNaguaValue numeric)
RETURNS TABLE(reservoirid bigint, valueoverflow numeric) AS
DROP TABLE IF EXISTS T_RETURN;
CREATE TEMP TABLE T_RETURN(reservoirid bigint, valueoverflow numeric);
INSERT INTO T_RETURN VALUES (pIdReservoir, date_part('second', current_time)); --just for test purposes...
RETURN QUERY SELECT * FROM T_RETURN;
The result set are two fields and just one row: The reservoirid and the seconds of 'current_time' in double value as shown below:
Please, if someone have any idea WHY i am running into this problem and have wonderful tips to solve it, I'll be very happy ;-)
If needed, I can provide more details...
Thanks in advance,