Ayuda con parametros procd oracle con VB6
Publicado por Yaneth (1 intervención) el 04/02/2010 23:38:21
Hola a todos, necesito ayuda para pasarle los parametros a un procedimiento en oracle 10g, desde una aplicación en visual basic 6.
El código que tengo es:
Dim rs As ADODB.Recordset
Dim cm As ADODB.Command
Private Sub Command1_Click()
Dim pkg As String
pkg = "Egr_pacientes.DATOSPRU"
Set cm = New Command
With cm
.ActiveConnection = db
.CommandText = pkg
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("In_est", adChar, adParamInput, 1, "1")
1, "1")
Set rs = .Execute
End With
End Sub
Pero cuando llega a la linea "Set rs = .Execute", saca el mensaje:
"Error '-2147217900(80040e14)' en tiempo de ejecución
ORA-06550: Line 1, columna 7;
PLS-00306:wrong number or types of arguments in call to "DATOSPRU"
Y el procedure es el siguiente:
CREATE OR REPLACE PACKAGE RAMICAMM.Egr_pacientes
IS
TYPE ref_cursor IS REF CURSOR;
FUNCTION DATOSPRU (In_est in char)
RETURN Egr_pacientes.ref_cursor;
END;
/
FUNCTION DATOSPRU(In_est in char)
RETURN Egr_pacientes.ref_cursor
Is
cur_consulta Egr_pacientes.ref_cursor;
Begin
open cur_consulta for
Select RAF_VAL_TIPOVALOR, RAF_VAL_DESCRIPCION, RAF_VAL_PANTALLA, RAF_VAL_LISTADO, RAF_VAL_SUMARESTA
from raf_tipovalor;
return cur_consulta;
End;
END;
/
He probado de todos los tipos y formas para enviarle los parametros, pero nada funciona. Alguien tiene una idea de qué puede estar mal?... Les agradezco de antemado por tomarse el tiempo en ayudarme.
El código que tengo es:
Dim rs As ADODB.Recordset
Dim cm As ADODB.Command
Private Sub Command1_Click()
Dim pkg As String
pkg = "Egr_pacientes.DATOSPRU"
Set cm = New Command
With cm
.ActiveConnection = db
.CommandText = pkg
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("In_est", adChar, adParamInput, 1, "1")
1, "1")
Set rs = .Execute
End With
End Sub
Pero cuando llega a la linea "Set rs = .Execute", saca el mensaje:
"Error '-2147217900(80040e14)' en tiempo de ejecución
ORA-06550: Line 1, columna 7;
PLS-00306:wrong number or types of arguments in call to "DATOSPRU"
Y el procedure es el siguiente:
CREATE OR REPLACE PACKAGE RAMICAMM.Egr_pacientes
IS
TYPE ref_cursor IS REF CURSOR;
FUNCTION DATOSPRU (In_est in char)
RETURN Egr_pacientes.ref_cursor;
END;
/
FUNCTION DATOSPRU(In_est in char)
RETURN Egr_pacientes.ref_cursor
Is
cur_consulta Egr_pacientes.ref_cursor;
Begin
open cur_consulta for
Select RAF_VAL_TIPOVALOR, RAF_VAL_DESCRIPCION, RAF_VAL_PANTALLA, RAF_VAL_LISTADO, RAF_VAL_SUMARESTA
from raf_tipovalor;
return cur_consulta;
End;
END;
/
He probado de todos los tipos y formas para enviarle los parametros, pero nada funciona. Alguien tiene una idea de qué puede estar mal?... Les agradezco de antemado por tomarse el tiempo en ayudarme.
Valora esta pregunta


0