我正在使用 Sybase Unwired Platform 2.1.3 开发 iOS 应用程序 在将date
参数发送到数据库时出现错误。
这是我的代码,
@try
{
SUP105Sales_order *insertRow =[[SUP105Sales_order alloc]init];
int32_t idValue =2671;
int32_t custID =103;
int32_t sales =506;
insertRow.id_=idValue;
insertRow.cust_id=custID;
insertRow.order_date=[NSDate date];
insertRow.fin_code_id=@"r1";
insertRow.region=@"Hyd";
insertRow.sales_rep=sales;
[insertRow save];
[insertRow submitPending];
[SUP105SUP105DB synchronize];
}
@catch (NSException *exception) {
NSLog(@"Exception---%@",exception.description);
}
服务器日志,
2014-02-28 16:39:41.833 WARN Other Thread-182 [SUP105.server.SUP105DB]{"_op":"C","level":5,"code":412,"eisCode":"257","message":"com.sybase.jdbc3.jdbc.SybSQLException:SQL Anywhere Error -157: Cannot convert '' to a timestamp","component":"Sales_order","entityKey":"3210004","operation":"create","requestId":"3210005","timestamp":"2014-02-28 11:09:41.646","messageId":0,"_rc":0}
我认为上面的错误是由于日期格式。我尝试了几种其他方法将日期发送到 Sup 服务器,但没有奏效。
如何从iOS本机应用程序将DATE
格式发送到sales_order
表格到列?order_date
感谢你的帮助。