Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Translate table data into english language in Oracle

ChaitraEswareMay 10 2019 — edited May 11 2019

Hi Team,

I need one help regarding translating the one of the table data to English language from french.

I have created the ACL as per the below link.

OraFAQ Forum: SQL & PL/SQL » Using internet translators from Oracle

with the help of DBA , for my schema , i got access to ACL 'utl_http.xml and assign_acl to google translator.

Still i'm not able to translate to english language

create or replace function eospb_translation

     (p_words in clob,

  p_to in varchar2 default 'ar',

  p_from in varchar2 default 'en')    

    return    clob

   as

     l_res    clob;

    l_words    clob;

   begin

l_res := httpuritype('http://translate.google.com/?hl=' ||p_from || '&layout=1&eotf=1&sl=' || p_from ||'&tl=' || p_to || '&text=' ||utl_url.escape (p_words) || '#').getclob();

l_words :=  regexp_substr(l_res, '<span id=result_box class="short_text"><span[^>]*>(.*)</span></span>',1, 1, 'i', 1);

return l_words;

     return l_words;

   end eospb_translation;

   /

select eospb_translation ('cats', 'fr') from dual;

I'm getting below error

ORA-29273: HTTP request failed

ORA-06512: at "SYS.UTL_HTTP", line 1819

ORA-29276: transfer timeout

ORA-06512: at "SYS.HTTPURITYPE", line 34

ORA-06512: at "PFREXPMI.EOSPB_TRANSLATION", line 10

ORA-06512: at line 1

29273. 00000 -  "HTTP request failed"

*Cause:    The UTL_HTTP package failed to execute the HTTP request.

*Action:   Use get_detailed_sqlerrm to check the detailed error message.

           Fix the error and retry the HTTP request.

I have 1 cr data which are in frenceh language, which has to converted to English language  for some of teh reporting purpose.

Could you please help me on this ?

RG,

Chaitra

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2021
Added on May 10 2019
9 comments
1,478 views