Search code examples
iosobjective-cdbaccess

DBAccess: long long value supprted or not?


I'm using dbaccess for my project. I want to know, Is dbaccess supported long long value or not?

 If I stored date timestamp 745665352687 than if I retrieved it, it returns -1572180756. 

I know sqlite supports long long value, but don't know about dbaccess. Can anyone help me? Thanx in adv.


Solution

  • Yes, long long is one of the supported types. I've looked into the problem, and all versions should work fine for your example above.

    I've created a class and assigned your example value.

    @interface Test : DBObject
    
    @property long long value;
    
    @end
    

    Output:

    -------------------------------------------------------------------------------------------
    | Entity : Test                          Primary Key : Id       Value: 1.000000           |
    -------------------------------------------------------------------------------------------
    | Field Name         |  Type        |                  Value                              |
    -------------------------------------------------------------------------------------------
    | Id                 | NUMBER       | 1.000000                                            |
    | value              | NUMBER       | 745665352687.000000                                 |
    -------------------------------------------------------------------------------------------
    | Relationships                                                                           |
    -------------------------------------------------------------------------------------------
    | Entity Name         |  Target Table     |                  Status                       |
    -------------------------------------------------------------------------------------------
    | NONE                |                   |                                               |
    -------------------------------------------------------------------------------------------
    

    I've then tested the output and it is correct. I suspect your problem may lay elsewhere in the implementation.

    For information, these are the data types supported by DBAccess:

    NSNumber
    NSString
    UIImage / NSImage
    NSArray
    NSDictionary
    NSDate
    int
    BOOL
    long
    float
    char
    short
    long long
    unsigned char
    unsigned int
    unsigned short
    unsigned long
    unsigned long long
    double
    char*
    NSURL
    NSData
    NSMutableData
    NSMutableArray
    NSMutableDictionary
    NSObject // (provided it implements an NSKeyedArchiver)
    int64
    unsigned int64