Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null params dates #12

Closed
solinad21 opened this issue Aug 17, 2013 · 4 comments
Closed

null params dates #12

solinad21 opened this issue Aug 17, 2013 · 4 comments

Comments

@solinad21
Copy link

Could you help me to send null params for dates ?

@timmolter
Copy link
Member

I'd love to help. Can you be more specific?

@solinad21
Copy link
Author

i get this error:

java.sql.SQLException: Data truncation: Incorrect date value: '' for column 'fechacad' at row 1 Query: INSERT INTO inventarios (Cod_Mov, Cod_Almacen, Cod_Proveedor, Cod_Articulo, tipodesc, Cod_IVA, cod_sesion, claveEmpleado,Stock_Mov, descuento_Mov, Costo_Mov, prov_garantia, IVA,Fecha_Mov,Hora_Mov, Cod_Caja,Doc_Fuente, paquete,Tipo_Mov,desc_mov,num_serie,lote,fechacad) VALUES (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?) Parameters: [[5, 1, 581, 1, 1, 13747, 12, 1, 0.0, 36.00, 0, 4.97, 2013-08-17, 12:43:00, 1050000099611, 99611, 0, S, V, , , ]]

i want set null to "fechacad" column.

i try with '', 'null', etc.

@timmolter
Copy link
Member

it looks like you're passing in 22 parameters but your SQL statement is expecting 23. Is that the problem?

@solinad21
Copy link
Author

not, in my code the params match ok.
i have double checked it.

I think the problem arises because the quotes are added automatically to the parameter.
and then the parameter is never passed as null (without quotes).
when I put directly the parameter to null the query runs perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants