On Sun, Jun 17, 2001 at 10:40:32PM +0200, M.W. Koskamp wrote:
>
> > use DBD::Oracle qw(:ora_types);
> > $sth->bind_param(1,'foo',{ ora_type => ORA_CHAR });
> >
> > But I don't really like this work around that much because it
> > made my code not portable for such basic data types.
>
> It's not a workaround it makes perfect sense here.
> No way to know if interfaces of other databases add padding chars themselves
> (or need them).
I would think most other databases will do the same. Otherwise,
who would like to to count manually the blanks needed at the end
of the text literal in a where condition?
> I use varchars for database fields instead. Solves the issue too.
>
This is true. However, this may not be your choice. In my case,
I encountered this when I tried to do 'make test' while installing
Template Toolkit CPAN package. The tests creates precisely such
columns in the testing tables which make some tests fail.
So my question is not about how best to design the tables. It is
about what do you do in a portable way when you are faced
with a given situation.
Thanks for your help, though.
Richard