
AYUUDDAAAAAA con oracle ORA-00917: falta la coma
Publicado por Daniel (10 intervenciones) el 28/07/2009 01:17:46
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,SUB_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.
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,SUB_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.
Valora esta pregunta


0