Hi Tharindu,

If a field allow empty string, which mean it is optional right? So we can
consider it as a null right? But when we try to save empty string on a DB,
if it is persist in a differently, it is better to have a default value
since it will be consistent on all the DBs. So can we set the default value
as NULL here? because even if we persist value as a empty string it is not
a valid value for us.
If so, i think it will help to compare values easily as well.

WDYT?

Thanks and Regards

On Sun, Jan 8, 2017 at 5:06 PM, Ishara Cooray <[email protected]> wrote:

> Hi Tharindu,
>
> How about storing space character instead of empty string. i have not
> tried it in Oracle db but if that works IMO there will not be an effect on
> user experience.
>
> Thanks & Regards,
> Ishara Cooray
> Senior Software Engineer
> Mobile : +9477 262 9512 <+94%2077%20262%209512>
> WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> On Fri, Jan 6, 2017 at 5:19 PM, Uvindra Dias Jayasinha <[email protected]>
> wrote:
>
>> Setting a default value for empty fields being sent seems to be best.
>>
>> Furthermore we can have default values set in our DTO objects in case a
>> given field is omitted altogether.
>>
>> So handling both the above scenarios can overcome the limitation in
>> Oracle.
>>
>> But I dont know if this is good for the REST API user experience, when
>> retrieving data that contains these default values.
>>
>> On 6 January 2017 at 15:28, Tharindu Dharmarathna <[email protected]>
>> wrote:
>>
>>>
>>>
>>> On Fri, Jan 6, 2017 at 3:26 PM, Tharindu Dharmarathna <
>>> [email protected]> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I faced $Subject in Oracle database while running integration test on
>>>> C5 on top.
>>>>
>>>> *Observation*
>>>>
>>>> when insert empty string ("") it was save as null in database.
>>>>
>>>> While going through SO I had found [1] , which did happen in oracle
>>>> database.
>>>>
>>>>
>>>> We have come up with several ways to handle empty strings which user
>>>> sends through the rest api.
>>>>
>>>> 1.  Validate the request and send error when giving empty strings
>>>> 2.  Set default value like "N/A" into the fields which send as empty.
>>>>
>>>> Is there any other way to handle this problem ?.
>>>>
>>>> [1] - http://stackoverflow.com/questions/13278773/null-vs-empty-
>>>> string-in-oracle
>>>>
>>>> Thanks
>>>>
>>>>
>>>> *Tharindu Dharmarathna*Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>> mobile: *+94779109091 <+94%2077%20910%209091>*
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Tharindu Dharmarathna*Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: *+94779109091 <+94%2077%20910%209091>*
>>>
>>
>>
>>
>> --
>> Regards,
>> Uvindra
>>
>> Mobile: 777733962
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to