Re: [gnome-db] INSERT statement with binary data



On Thu, 2009-01-22 at 13:34 +0100, Vivien Malerba wrote:
> 
> 
> 2009/1/22 Johannes Schmid <jhs jsschmid de>
>         Hi!
>         
>         OK, I finally got this working but I have a question on the
>         data types.
>         If I pass something like
>         
>         (##contact_id::int, ##first_name::string, ...)"
>         
>         
>         but contact_id has a value type GdaNumeric that libgda
>         complains that
>         the data types do not match. Same when I passt
>         first_name::varchar.
>         Shouldn't libgda handle such conversions itself?
> 
> Yes, right now Libgda is very conservative about data types matching,
> and automatic conversions should be implemented when possible. Anyway,
> this is post V4.

I disagree with Johannes on this, it seems. I don't think libgda should
do any automatic string<->number/date/time conversion. Any such
conversion would be locale-specific. I'd like libgda to force
application coders to write robust code.

At the best you'd have to document it as using ISO formatting for the
text representation. But then the application coder would have to
convert their user-visible locale-specific text representation to an ISO
text-represenation, so they might as just convert it to the correct type
instead.


 

-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]