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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Multi-Language data

Re: Multi-Language data

From: <rtproffitt_at_my-deja.com>
Date: Wed, 05 Jan 2000 17:00:02 GMT
Message-ID: <84vta9$4cc$1@nnrp1.deja.com>


Goeff,
Some thoughts on your problem...

  1. you could try a UNION in which the first Select is the desired language and the second select is for the default language...only one will be true at any time. Select a,b,c from tbl where lang = 'F' <-- or bind variable ... other parts of where clause... UNION ALL Select a,b,c from tbl b Where lang = 'D' <- default langauge ... other parts of where clause... and NOT EXIST (select 'x' from tbl c where lang = 'F' <-- or bind variable ... other parts of where clause ...)
  2. Create a stored function to determine the proper language code, 'F' or Default. Then use the function in the WHERE clause. I think however, that using function in the WHERE might cause index not be used (...comments anyone?...)

Create Function TheLangCode

   (DesiredLang varchar2,
    DefaultLang varchar2,
    a,b,c,d all the other variables needed to define the select...) Return Varchar2 is
  x char;
Begin
  Select 'x' into x
  From tbl
  Where Lang = DesiredLang
  And ....a,b,c,d...other parts of where clause...;

Good Luck
Robert Proffitt
Beckman Coulter

In article <84v64t$77r$1_at_quince.news.easynet.net>,   "Geoff Munday" <geoffm_at_qsiuk.com> wrote:
> We have a need to present data in a multi language form
> eg
> SELECT SOMETHING FROM TABLE WHERE LANG='F' ....
> will give SOMETHING in the correct language.
> If there is no data in F(rench) then the default language version
should be
> returned.
> Our first thought was to split the original table into a language
> independent part and a
> language dependent part and select from a view using
> NVL(B.SOMETHING,A.SOMETHING).
> This will not work when it comes to an UPDATE.
>
> As far as I can see NLS does not relate to data and so will not help
in this
> matter.
> From what little I have found I suspect that TYPE or the text
cartridge may
> form part of a solution.
> Does anyone have any ideas?
>
> What we would ideally like to do is present data to a user in his own
> language with
> no restrictions in UPDATEs, INSERTs and QBE.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Jan 05 2000 - 11:00:02 CST

Original text of this message

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