Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle trim in a where clause

Re: Oracle trim in a where clause

From: Aleks <alexan.lee_at_gmail.com>
Date: 3 Oct 2006 07:46:46 -0700
Message-ID: <1159886806.581580.123250@e3g2000cwe.googlegroups.com>


If dblink table column is CHAR, you don't need to add spaces or to use trim.
By default Oracle for CHAR type will extend the string to 100 chars. Use b.id = SomeChars || myId;

Thanks,
Aleks
Lionel wrote:
> Hi !
>
> I have a performace problem on a SQL statement.
> I have to join a table column of type CHAR(100) over a dblink (the table
> comes from an external provider and can't be modified)
> My identifier value comes from a sequence.
> The dblink's table column identifier is formatted as (SomeChars || myId) +
> the spaces of the CHAR.
>
> It seems that using:
> select myColumn from myTable a, DbLinkTable b where 'SomeChars'||a.myId =
> trim(b.id)
> performs quite bad.
>
> I tried to append 88 spaces after my ID to avoid the trim: it is fast, but
> quite ugly (I'll have to remember to remove one whitespace when my
> sequence's length increases).
>
> Anyone sees a solution ?
> Thanks
>
> PS: The only solution I see would be to add a CHAR(100) column to my table,
> which would contain (SomeChars || myId).
> I would like to avoid that...
Received on Tue Oct 03 2006 - 09:46:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US