Dear all,
I have the following SP (Oracle)
PROCEDURE Obtener_Agente(
p_nIdePol Poliza.IdePol%TYPE,
p_rAgente OUT rCursor) IS
BEGIN
OPEN p_rAgente FOR
SELECT /* <013013-1> Costo = 9 */ p.IdePol IdePol, p.NumPol NumPol, pi.CodInter CodInter,
t.NomCorTer NomCorTer
FROM Poliza p, Part_Inter_pol pi, Intermediario i, Tercero t
WHERE p.IdePol = p_nIdePol
AND p.IdePol = pi.IdePol
AND pi.CodInter = i.CodInter
AND i.TipoId = t.TipoId
AND i.NumId = t.NumId
AND i.DvId = t.DvId;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20100,SQLERRM);
END Obtener_Agente;
What I want to do is execute this sp using LS. So I do this:
Sub Initialize
Dim input_fieldlist As New LCFieldList
Dim output_parms As New LCFieldlist
Dim in_field_int As New LCField (1, LCTYPE_INT)
Dim out1 As New LCField (1, LCTYPE_INT)
Dim out2 As New LCField (1, LCTYPE_TEXT)
Dim out3 As New LCField (1, LCTYPE_TEXT)
Dim out4 As New LCField (1, LCTYPE_TEXT)
Dim out As Double
Call SetupLSX
If Not comunicadoLSX Then
Print "Error en la conexión al Oracle"
Exit Sub
End If
ConnLSX.Procedure = "PR_WEBSIN_CONS.Obtener_Agente"
ConnLSX.Fieldnames = "IdePol, NumPol, CodInter, NomCorTer"
'set the input parameters of the stored procedure...
Set in_field_int = input_fieldlist.Append ("p_nIdePol", LCTYPE_INT)
in_field_int.Value = 402071
'with the input parameters set, call the stored procedure...
'the declared output_parms fieldlist will hold the output parameters of the stored procedure...
out = ConnLSX.Call (input_fieldlist, 1, output_parms)
'fetch parameter(s) into the output_parms fieldlist...
out = ConnLSX.Fetch (output_parms)
'retrieve the parameter(s) from the output_parms fieldlist...
Set out1 = output_parms.GetField (1)
Set out2 = output_parms.GetField (2)
'use the output parameter value(s) in your script...
Print "Output parameter 1 is " & out1.Value(0)
Print "Output parameter 2 is " & out2.Text(0)
Errores:
Print "Error" & Str(Err) & ": " & Error$ & " on line " & Cstr(Erl)
Exit Sub
End Sub
But in the statement:
ConnLSX.Fieldnames = “IdePol, NumPol, CodInter, NomCorTer”
I get an error:
Error 12809: Error: Invalid field ‘IdePol’, Connector ‘oracle’, Mehtod -Call
→ IdePol IS one of the names of the Select instruction in the SP…So what is wrong?
My question is :
Is it a problem of the statement?
How do I retrieve what the SP returns, a cursor in my case?
I would really appreciate any suggestion.
kind of desperate
regards
Olga