Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General » Oracle »

AYUDA CON ERROR ORA-00917: falta coma

Estas en el tema de AYUDA CON ERROR ORA-00917: falta coma en el foro de Oracle en Foros del Web. Hola, por favro necesito ayuda urgente . Resulta que estoy haciendo una insercion en una tabla de oracle mediante vb.net. Pero al ejecutarlo me da ...
  #1 (permalink)  
Antiguo 27/07/2009, 17:20
 
Fecha de Ingreso: mayo-2009
Mensajes: 12
Antigüedad: 14 años, 11 meses
Puntos: 0
AYUDA CON ERROR ORA-00917: falta coma

Hola, por favro necesito ayuda urgente .
Resulta que estoy haciendo una insercion en una tabla de oracle mediante vb.net.
Pero al ejecutarlo me da un error ORA-00917: falta la coma , ya revise bien y todas la comas estan.

Por favor necesito ayuda. Como puedo solucionar este problema.

adjunto codigo que estoy utilizando.


Dim cnn As New OracleConnection(Principal.stringconexion)
Dim intRowsAffected As Integer
'Try


If LCUENTA.Text = "CREDITO" Then
If cbDias.Text = "" Then
MessageBox.Show("SELECCIONE LOS DIAS DE CREDITO", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return
End If


Dim inserta As String = "INSERT INTO FACTURAS VALUES"
Dim Factura As Integer = lFactura.Text
Dim FechaFactura As Date = lFecha.Text
Dim Empleado As Integer = txtCodVendedor.Text
Dim Cliente As Integer = txtCodCliente.Text
Dim SubTotal As Double = LSubtotal.Text
Dim Total As Double = LTOTAL.Text
Dim Vencimiento As Date = LFechaVencimiento.Text
Dim Pago As String = LFormaPago.Text
Dim IV As Double = LImp.Text

inserta = inserta & "('" & Factura & "','" & FechaFactura & "','" & Empleado & "','" & Cliente & "','" & SubTotal & "','" & Total & "','" & Vencimiento & "','" & Pago & "','" & IV & "' "
Dim cmd As New OracleCommand(inserta, cnn)
MsgBox(cmd.CommandText)
cnn.Open()
intRowsAffected = cmd.ExecuteNonQuery()

If intRowsAffected = 0 Then
MsgBox("FALLO AL GUARDAR INFORMACION.", MsgBoxStyle.Critical, "INFORMACION")
Else
MsgBox("INFORMACION GUARDADA.", MsgBoxStyle.Information, "INFORMACION")
End If
cnn.Close()

ElseIf LCUENTA.Text = "CONTADO" Then
If cbxEfectivo.Checked = True Then
LFormaPago.Text = "EFECTIVO"
ElseIf cbxTCredito.Checked = True Then
LFormaPago.Text = "TARJETA DE CREDITO"
ElseIf cbxCheque.Checked = True Then
LFormaPago.Text = "CHEQUE"
End If
Dim inserta As String = "INSERT INTO FACTURAS (FACTURA,FECHA_FACTURA,COD_EMPLEADO,COD_CLIENTE,SU B_TOTAL,TOTAL,FORMADEPAGO,IV) VALUES"
Dim Factura As Integer = lFactura.Text
Dim FechaFactura As Date = lFecha.Text
Dim Empleado As Integer = txtCodVendedor.Text
Dim Cliente As Integer = txtCodCliente.Text
Dim SubTotal As Double = LSubtotal.Text
Dim Total As Double = LTOTAL.Text
Dim Pago As String = LFormaPago.Text
Dim IV As Double = LImp.Text

inserta = inserta & "('" & Factura & "','" & FechaFactura & "','" & Empleado & "','" & Cliente & "','" & SubTotal & "','" & Total & "','" & Pago & "','" & IV & "'"
Dim cmd As New OracleCommand(inserta, cnn)
MsgBox(cmd.CommandText)
cnn.Open()

intRowsAffected = cmd.ExecuteNonQuery() ' AQUI ES DONDE ME DA EL ERROR
'cnn.Close()
If intRowsAffected = 0 Then
MsgBox("FALLO AL GUARDAR INFORMACION.", MsgBoxStyle.Critical, "INFORMACION")
Else
MsgBox("INFORMACION GUARDADA.", MsgBoxStyle.Information, "INFORMACION")
End If
cnn.Close()

End If
'Catch ex As OracleException
' MsgBox(ex.Message, MsgBoxStyle.Critical, "ORACLE ERROR")
'Catch ex As Exception
' MsgBox(ex.Message, MsgBoxStyle.Critical, "GENERAL ERROR")
'End Try




End Sub



agradesco la ayuda por favor.
  #2 (permalink)  
Antiguo 27/07/2009, 18:20
Avatar de huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 2 meses
Puntos: 360
Respuesta: AYUDA CON ERROR ORA-00917: falta coma

Cita:
inserta = inserta & "('" & Factura & "','" & FechaFactura & "','" & Empleado & "','" & Cliente & "','" & SubTotal & "','" & Total & "','" & Pago & "','" & IV & "'"
Donde se cierra el parentesis?

Una excelente forma de probar código, es realizar una impresión de la variable inserta y tratar de insertar el resultado directamente en la base de datos.

Un saludo
__________________
Without data, You are another person with an opinion.
W. Edwads Deming
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 22:40.