I try to use TUniStoredProc this way :
Code: Select all
sql_StoredProc : TUniStoredProc;
sql_StoredProc.StoredProcName := 'is_leg_in_database';
sql_StoredProc.ParamByName('given_Arp_dep').AsString := 'AAL'; // hier that dosen't work
sql_StoredProc.Execute;
I have an error message, so that the parameter : given_Arp_dep was not found
Hier is the stored procedure from my mariaDB database, it does what I need actually
Code: Select all
DROP PROCEDURE IF EXISTS is_leg_in_database;
DELIMITER $$
CREATE PROCEDURE is_leg_in_database(IN given_Arp_dep VARCHAR(3), IN given_Arp_arr VARCHAR(3), IN given_time_dep INT, OUT nof_leg INT)
LANGUAGE SQL
BEGIN
SELECT ( SELECT COUNT(*)
FROM TW_LEG where DEP_ARP_CD = given_Arp_dep
and ARR_ARP_CD = 'CPH' // for test only
and S_TIME_DEP = 620
and S_TIME_ARR = 705
and DAY_OF_WEEK = 4) INTO nof_leg;
END;
$$
DELIMITER ;