Foros del Web » Programación para mayores de 30 ;) » .NET »

Problema con Procedimiento Almacenado.

Estas en el tema de Problema con Procedimiento Almacenado. en el foro de .NET en Foros del Web. Desarrolo un aplicacion con visual basic 2005 express que accede a un servidor de datos Oracle Database 10g Express, USO PROCEDIMIENTOS ALMACENADOS PARA RECUPERAR registros, ...
  #1 (permalink)  
Antiguo 29/04/2008, 20:35
 
Fecha de Ingreso: abril-2008
Mensajes: 6
Antigüedad: 16 años, 1 mes
Puntos: 0
Problema con Procedimiento Almacenado.

Desarrolo un aplicacion con visual basic 2005 express que accede a un servidor de datos Oracle Database 10g Express, USO PROCEDIMIENTOS ALMACENADOS PARA RECUPERAR registros, hasta aqui todo bien, pero al llamar a un procedimiento que agrega un registro me despliega el mensaje:

System.Data.OracleClient.OracleException was unhandled
ErrorCode=-2146232008
Message="ORA-06550: línea 1, columna 7:
PLS-00306: número o tipos de argumentos erróneos al llamar a 'SP_ADD_CLIENTES'
ORA-06550: línea 1, columna 7:
PL/SQL: Statement ignored
"


PL/SQL

create or replace
PROCEDURE "SP_ADD_CLIENTES" (
p_nombre_razon_social VARCHAR2,
P_NUM_IDENTIDAD VARCHAR2,
p_clase_codumento VARCHAR2,
p_nacionalidad VARCHAR2,
p_pais_residencia VARCHAR2,
p_provincia_residencia VARCHAR2,
p_canton_residencia VARCHAR2,
P_LOCALIDAD VARCHAR2,
p_referencia VARCHAR2,
p_stado_civil VARCHAR2,
p_nacido_el VARCHAR2,
p_ocupacion VARCHAR2
)as

BEGIN
insert into notariademo1.CLIENTES
values(
clientes_seq.NEXTVAL,
p_nombre_razon_social,
P_NUM_IDENTIDAD ,
p_clase_codumento,
p_nacionalidad,
p_pais_residencia ,
p_provincia_residencia ,
p_canton_residencia ,
P_LOCALIDAD ,
p_referencia,
p_stado_civil,
p_nacido_el
,p_ocupacion);
commit;
END SP_ADD_CLIENTES;

visual basic 2005

OracleCmd.Connection = AtlasDocsProcesos.OracleConexion
OracleCmd.CommandText = P_Procedimiento
OracleCmd.CommandType = CommandType.StoredProcedure

OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_NOMBRE_RAZON_SOCIA L", OracleClient.OracleType.VarChar, 120)).Value = "PRADERA MARCIA" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_NUM_IDENTIDAD", OracleClient.OracleType.VarChar, 15)).Value = "13069581777"
OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_CLASE_CODUMENTO", OracleClient.OracleType.VarChar, 30)).Value = "CEDULA" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_NACIONALIDAD", OracleClient.OracleType.VarChar, 30)).Value = "ECUATORIANA" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_PAIS_RESIDENCIA", OracleClient.OracleType.VarChar, 30)).Value = "ECUADOR"
OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_PROV_RESIDENCIA", OracleClient.OracleType.VarChar, 30)).Value = "MANABI" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_CANTON_RESIDENCIA" , OracleClient.OracleType.VarChar, 30)).Value = "BOLIVAR" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_LOCALIDAD", OracleClient.OracleType.VarChar, 30)).Value = "CALCETA"
OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_REFERENCIA", OracleClient.OracleType.VarChar, 120)).Value = "SN" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_STADO_CIVIL", OracleClient.OracleType.VarChar, 2)).Value = "S" OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_NACIDO_EL", OracleClient.OracleType.VarChar, 10)).Value = "12/05/2004"
OracleCmd.Parameters.Add(New OracleClient.OracleParameter("P_OCUPACION", OracleClient.OracleType.VarChar, 30)).Value = "OCUPACION"



Error completo:
System.Data.OracleClient.OracleException was unhandled
ErrorCode=-2146232008
Message="ORA-06550: línea 1, columna 7:
PLS-00306: número o tipos de argumentos erróneos al llamar a 'SP_ADD_CLIENTES'
ORA-06550: línea 1, columna 7:
PL/SQL: Statement ignored
"
Source="System.Data.OracleClient"
StackTrace:
at System.Data.OracleClient.OracleConnection.CheckErr or(OciErrorHandle errorHandle, Int32 rc)
at System.Data.OracleClient.OracleCommand.Execute(Oci StatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
at System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQ uery()
at AppDocAtlas.FrmChild.AddClientes(String P_Procedimiento, OracleCommand OracleCmd, String NOMBRE_RAZON_SOCIAL, String NUM_IDENTIDAD, String CLASE_DOCUMENTO, String NACIONALIDAD, String PAIS_RESIDENCIA, String PROV_RESIDENCIA, String CANTON_RESIDENCIA, String LOCALIDAD, String REFERENCIA, String STADO_CIVIL, String NACIDO_EL, String OCUPACION) in C:\Documents and Settings\Administrador\Mis documentos\Roberto\Atlas\Desarrollo de Aplicaciones\Atlas Doc 1_0\AppDocAtlas\AppDocAtlas\FrmChild.vb:line 54
at AppDocAtlas.FrmChild.BtnGrabar_Click(Object sender, EventArgs e) in C:\Documents and Settings\Administrador\Mis documentos\Roberto\Atlas\Desarrollo de Aplicaciones\Atlas Doc 1_0\AppDocAtlas\AppDocAtlas\FrmChild.vb:line 61
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationCo ntext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
at AppDocAtlas.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()




















Última edición por robert_prime; 29/04/2008 a las 20:37 Razón: Correccion.
  #2 (permalink)  
Antiguo 29/04/2008, 21:57
Avatar de royrojas  
Fecha de Ingreso: diciembre-2004
Mensajes: 458
Antigüedad: 19 años, 5 meses
Puntos: 3
Re: Problema con Procedimiento Almacenado.

prueba poniendo el nombre de las variables igual a como se llaman en el procedimiento, si las tienes en mayuscula que esten igual en el encabezado del procedimiento.
__________________
roy rojas
Programación en Español: DotNetcr.com
  #3 (permalink)  
Antiguo 30/04/2008, 13:07
 
Fecha de Ingreso: abril-2008
Mensajes: 6
Antigüedad: 16 años, 1 mes
Puntos: 0
Re: Problema con Procedimiento Almacenado.

Cita:
Iniciado por royrojas Ver Mensaje
prueba poniendo el nombre de las variables igual a como se llaman en el procedimiento, si las tienes en mayuscula que esten igual en el encabezado del procedimiento.
Hice lo que indicaste, pero ahora me d el error:

ORA-01036:número/variable no válido.

,COn los procedimientos que recuperan conjuntos resulatdos, funciona bien, así estén los nombres de los paraámetros iguales o diferentes a los del Procedimiento Almacenado.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:45.