Hello all,

I'm new to PostgreSQL and need some help.
I have a function that works fine if i put the values for which i want to calculate the data.

Code:
FUNCTION "CALCULATE_ASP"("TID" bigint, "strPriority" character varying)
What I've done is to have some sub-queries in order to not have to manually run the function ( like SELECT "CALCULATE_ASP"('9236','P3') )
So here is my code:
Code:
SELECT "CALCULATE_TTA_PER_T_SSPO_ASP_Marius"((SELECT "A"."TID" from "KPI"."SERVICE_MAPPING" "A" LEFT JOIN "KPI"."OPERATIONAL_MODEL" "E" ON "A"."OPERATIONAL_MODEL_ID" = "E"."ID" LEFT JOIN "KPI"."NOMINAL_RESTORED_REPORTING_PERIODS" "D" ON "A"."NOMINAL_RESTORED_REPORTING_PERIOD_ID" = "D"."ID" WHERE "D"."ID" = 27 AND "A"."EXCLUDED" = false and "E"."STANDARD_NAME" like 'L1 + ASP'), (SELECT "J"."REPORTING_PRIORITY" from "KPI"."SERVICE_MAPPING" "A" LEFT JOIN "KPI"."OPERATIONAL_MODEL" "E" ON "A"."OPERATIONAL_MODEL_ID" = "E"."ID" LEFT JOIN "KPI"."NOMINAL_RESTORED_REPORTING_PERIODS" "D" ON "A"."NOMINAL_RESTORED_REPORTING_PERIOD_ID" = "D"."ID" LEFT JOIN "KPI"."VIEW_REPORTING_PRIORITY" "J" ON "A"."TID" = "J"."T_TID" WHERE "D"."ID" = 27 AND "A"."EXCLUDED" = false and "E"."STANDARD_NAME" like 'L1 + ASP'));
I get the following error after some time of running :
"ERROR: more than one row returned by a subquery used as an expression SQL state: 21000"
I assume that this happens because the multiple rows.
What i would like to obtain is to have the function running for each pair that woulf be obtaind form the subquery ( for ('9236','P3'),('something','else')..etc

Could you please help me fix my code or redo it in order to obtain this result? (the functyion to run for all my pairs )