Having issue with inserting a entry into a Table using VB.net/Django/PostgreSQL -
i trying insert entry table server says this
column "date" of type date expression of type integer @ character 131
this sql statement can show vb.net horrid mess.
insert "inventory_chemicalrecord"("barcode","action","name_id","building","qty","date") values ('ien0001','add',1,'marcus',1,2013-07-10);
here string passing
mysqlstring = "insert "&chr(34)&"inventory_chemicalrecord"&chr(34)&"("&chr(34)&"barcode"&chr(34)& ","&chr(34)&"action"&chr(34)& ","&chr(34)&"name_id"&chr(34)& ","&chr(34)&"building"&chr(34)& "," &chr(34)&"qty"&chr(34)& ","&chr(34)&"date"&chr(34)& ") values ("& code & "," &chr(39)& action &chr(39) & "," & name_id & "," & building & ","& originalqty & "," & curdate & ");"
sorry way have found if wrong way please inform me.
i have tried
chr(39)&curdate&chr(39) "'"&curdate&"'"
and set
curdate = chr(39)&curdate&curdate(39)
i keep getting eof expected , type & not match string there better way this?
the error message clear.
the date needs wrapped in quotes : '2013-07-10'
insert "inventory_chemicalrecord"("barcode","action","name_id","building","qty","date") values ('ien0001','add',1,'marcus',1,2013-07-10);
should be
insert "inventory_chemicalrecord"("barcode","action","name_id","building","qty","date") values ('ien0001','add',1,'marcus',1,'2013-07-10');
Comments
Post a Comment