I am developing an iOS app using Sybase Unwired Platform 2.1.3 I am getting error while sending date
parameter to database.
Here is my code,
@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);
}
Server log,
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}
I think the error above is due to date format. I have tried few other ways to send date to the Sup server, but it did not work.
How to send DATE
format to the sales_order
table to the order_date
column from iOS native app?
Appreciate your help.