Project and Portfolio Management Practitioners Forum
cancel

Custom Portlet Does not work in Turkish

Highlighted
sevcan
Super Contributor.

Custom Portlet Does not work in Turkish

Hey all,

 

We have a multi language system (English, Turkish).  We created a custom drill down portlet to see to see the total request for people for each status. I will attach the sql in the below. 

When we enter the system in English the custom porlet works fine. But, when we enter the sytem in Turkish(Browser IE) It throws an error like the sql returns multiple value. But, the sql work fine when I run it in the sql developer.  Do you have any idea what can be the error?

 

ORA-01427: tek satırlık alt sorgu birden fazla satır döndürüyor

--Yürütülen SQL sorgusu:
SELECT distinct(ku.full_name) ATANAN_KISI, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Yeni') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) YENI, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Yonetici Onayi') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) YONETICI_ONAYI, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Yazilim Birimi Müdürü Onayi') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) YAZILIM_MUDURU_ONAYI, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Ilgili Personel Onayi') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) ILGILI_PERSONEL_ONAYI, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Bilgi Güncelleme') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) BILGI_GUNCELLEME, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Talep Kapaniş Onayi') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) KAPANIS_ONAYI, (Select count(request_id) from kcrt_requests kr1 where status_id IN (select status_id from kcrt_statuses where status_name in ('Yeni','Yonetici Onayi','Yazilim Birimi Müdürü Onayi','Ilgili Personel Onayi','Bilgi Güncelleme','Talep Kapaniş Onayi')) and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) TOPLAM_KAPATILAN_DISINDA, (Select count(request_id) from kcrt_requests kr1 where status_id=(select status_id from kcrt_statuses where status_name='Talep Kapatildi') and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) TALEP_KAPATILDI, (Select count(request_id) from kcrt_requests kr1 where status_id IN (select status_id from kcrt_statuses where status_name in ('Yeni','Yonetici Onayi','Yazilim Birimi Müdürü Onayi','Ilgili Personel Onayi','Bilgi Güncelleme','Talep Kapaniş Onayi','Talep Kapatildi')) and kr1.request_type_id=31062 and kr1.assigned_to_user_id=ku.user_id) TOPLAM
FROM knta_users ku
WHERE 1=1 and
ku.department_code IN ((Select department_code from krsc_org_units where parent_org_unit_id=(Select org_unit_id from krsc_org_units where manager_id=(Select user_id from knta_users where resource_title_code='DIREKTOR' and user_id=100884))) union
(select department_code from knta_users where user_id=100884))
AND ROWNUM <= 200 ORDER BY ATANAN_KISI ASC

 

 

5 REPLIES
ieroglif
Respected Contributor.

Re: Custom Portlet Does not work in Turkish

Hello, Sevcan.

 

I had the same problem, but with rus-characters=)

 

I added character handler at java-class and problem was solved. Try to check this, hope it helps.

Best Regards,
Ieroglif.
sevcan
Super Contributor.

Re: Custom Portlet Does not work in Turkish

Hey,

 

How can I add this character handler in java class. Can you describe it?

 

Regards,

Sev

Etienne_Canaud
Outstanding Contributor.

Re: Custom Portlet Does not work in Turkish

Hi Sev, 

 

The Oracle Error code (ORA-01427: single-row subquery returns more than one row) points at a problem with the SQL, not with PPM itself, so I'm not quite sure that a Java-class character handler (whatever that means) will help.

 

I'll make a wild guess at the root cause now. Could you confirm that when you run:

 

SELECT VALUE FROM NLS_SESSION_PARAMETERS WHERE PARAMETER ='NLS_LANGUAGE'

 

in SQL Developer, the returned value is "AMERICAN"?

 

If that's the case, try setting the value to "TURKISH" in SQL Developer and try to run the SQL statement again.

To set NLS_LANGUAGE to TURKISH for the session opened in SQL Developer, simply run:

 

ALTER SESSION SET NLS_LANGUAGE= 'TURKISH';

 

If the SQL execution fails after changing NLS_LANGUAGE to TURKISH, it means that one of the PPM MLU views returns more than one record while using Turkish when only one is expected in the SQL. It should be easy for you to pinpoint and fix the problem in the SQL from there if you can reproduce the issue in SQL Developer. Note however that this could be a symptom of a more serious problem, as MLU views are NOT supposed to return a different number of records depending on the language of the session.

 

However, if the SQL executes just fine even after changing NLS_LANGUAGE to 'TURKISH' in SQL Developer, then it means that the error might come from some SQL executed by PPM code itself, not from the SQL of the portlet - which by the way would be surprising if this is the only custom portlet failing in Turkish.

 

Kind Regards,

Etienne.

sevcan
Super Contributor.

Re: Custom Portlet Does not work in Turkish

Hi Etienne,

 

The sql returned American.

 

Before I can it to the Turkish. I run this select in the test environment. In test, the same custom portlet works just fine in both language. It also return American. Should I still alter the settings to Turkish??

 

This portlet's sql runs just fine in sqldeveloper. This is the only custom portlet fails. 

Etienne_Canaud
Outstanding Contributor.

Re: Custom Portlet Does not work in Turkish

But does the SQL run fine in SQL Developer in PROD if you set the Session NLS_LANGUAGE to Turkish?

 

You should not hesitate to do that in SQL Developer ; it will only alter the current database session (I think), it shouldn't impact the data in the database nor the running PPM application.