I used to select records from a Sybase database with Mercator 6.7.1. via a stored procedure in an output card :
PUT("FILE","%PATH_DATA%", Package(
DBQUERY("spu_my_sybase_stored_proc 'param1'", "%DB_SYBASE%
)
)
But we have now an Oracle database and I try to do as simple. It doesn't work : nothing is returned by the procedure despite the map ends "successfully".
Moreover if I execute the procedure in the PL/SQL the procedure returns my records well.
Can anyone explain me where's the mistake ?
regards
Here is the Oracle procedure script :
CREATE OR REPLACE PROCEDURE "OPEUSR"."SPU_OAIM_GETSERVPARAM" (
P$service IN oai_demande_service.oserivc_code_service%TYPE
)
is
begin
DECLARE
CURSOR C_GSP ( LC$service IN oai_demande_service.oserivc_code_service%TYPE ) IS
SELECT odes.odesii_ref AS iref, odes.oserivc_code_service AS serv, opar.opar_vc_code_param AS code_param, opar.opar_vc_valeur_param AS param
FROM oai_demande_service odes, oai_parametre opar
WHERE opar.odesii_ref = odes.odesii_ref
AND odes.odes_i_status = 2
AND odes.oserivc_code_service = LC$service ;
BEGIN
dbms_output.enable(1000000);
UPDATE oai_demande_service
SET odes_i_status = 2
WHERE oserivc_code_service = P$service;
FOR cur IN C_GSP ( P$service ) LOOP
dbms_output.put_line ( To_char( cur.iref ) || ' ' || cur.serv || ' ' || cur.code_param || ' ' || cur.param );
END LOOP;
END;
end;
PUT("FILE","%PATH_DATA%", Package(
DBQUERY("spu_my_sybase_stored_proc 'param1'", "%DB_SYBASE%
)
)
But we have now an Oracle database and I try to do as simple. It doesn't work : nothing is returned by the procedure despite the map ends "successfully".
Moreover if I execute the procedure in the PL/SQL the procedure returns my records well.
Can anyone explain me where's the mistake ?
regards
Here is the Oracle procedure script :
CREATE OR REPLACE PROCEDURE "OPEUSR"."SPU_OAIM_GETSERVPARAM" (
P$service IN oai_demande_service.oserivc_code_service%TYPE
)
is
begin
DECLARE
CURSOR C_GSP ( LC$service IN oai_demande_service.oserivc_code_service%TYPE ) IS
SELECT odes.odesii_ref AS iref, odes.oserivc_code_service AS serv, opar.opar_vc_code_param AS code_param, opar.opar_vc_valeur_param AS param
FROM oai_demande_service odes, oai_parametre opar
WHERE opar.odesii_ref = odes.odesii_ref
AND odes.odes_i_status = 2
AND odes.oserivc_code_service = LC$service ;
BEGIN
dbms_output.enable(1000000);
UPDATE oai_demande_service
SET odes_i_status = 2
WHERE oserivc_code_service = P$service;
FOR cur IN C_GSP ( P$service ) LOOP
dbms_output.put_line ( To_char( cur.iref ) || ' ' || cur.serv || ' ' || cur.code_param || ' ' || cur.param );
END LOOP;
END;
end;