Re: search on Oracle CHAR primary key column
[prev]
[thread]
[next]
[Date index for 2004/08/26]
Thanks for the feedback so far. It's definitely a padding/empty space
issue with the CHARs in the database. And yes, it's a vendor DB, so I
can't modify the type. The DB is a complete mess, no PKs, all CHARs,
but don't get me started... :)
I put together a small sample script using just DBI, and the select
statements worked correctly only if I explicitly used bind_param to set
the type to SQL_CHAR. So it seems DBD::Oracle can do the right thing if
it knows the type.
So I'm wondering if there is a way to get Class::DBI to bind a column
to a CHAR rather than a VARCHAR.
Otherwise, I'll look into the suggestions provided so far (explicit
padding, etc.) Another thought we had was to create a view with
VARCHARs mapped to the CHARs, but I'm not exactly sure how we could do
that.
Thanks,
Jim
On Aug 25, 2004, at 10:19 AM, Jim Brandt wrote:
> I need to interface with an Oracle table that has CHARs as primary key
> columns (there are two), but I've been unable to get any
> selects/searches to match anything unless I use search_like. I finally
> figured out it was probably because the datatype is being set to
> VARCHAR by default.
>
> Is there any way I can tell CDBI to treat these as CHARs and bind the
> parameters correctly?
>
> I found a reference to the data_type method on the kwiki:
>
> http://www.class-dbi.com/cgi-bin/wiki/index.cgi?WorkingWithBlobs
>
> but was unable to get it to work.
>
> I also found this tidbit in the archives:
>
> http://groups.kasei.com/mail/arc/cdbi-talk/2004-07/msg00251.html
>
> but that didn't work either.
>
> Are one of these the solution? If so, I'll assume I'm doing something
> wrong and keep trying.
>
> I'm using CDBI 0.94.
>
> Thanks,
> Jim
>
> ==========================================
> Jim Brandt
> Administrative Computing Services
> University at Buffalo
>
==========================================
Jim Brandt
Administrative Computing Services
University at Buffalo
|
|
Re: search on Oracle CHAR primary key column
Jim Brandt 14:43 on 26 Aug 2004
|