Comment only on one portion:
<yours>
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?
</yours>
Not necessarily true. in the area of what other DBMS's do with trailing
blanks in where clauses, so far as MS SQL is concerned (for example) the
matching stops with the last non-blank character in the where condition in
CHAR and NCHAR datatypes. So for the purpose of the where clause:
WHERE Column1 = 'This Char'
will return all rows where Column1 is 'This Char' no matter how many
trailing blanks it has to fill out the CHAR or NCHAR data column.
Your design is of course up to you, but as for all DBMS's behaving as you
say, they don't.
Steve Howard
-----Original Message-----
From: Richard Chen [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 17, 2001 3:43 PM
To: M.W. Koskamp
Cc: [EMAIL PROTECTED]
Subject: Re: handling where condition for char(nnn) data types
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