Skip to main content
Solved

Where is the translated value stored?


Forum|alt.badge.img+5
  • Do Gooder (Customer)
  • 16 replies

Can someone help me to understand where decode value is actually being stored?

Let’s use the following function as example:

When we pass the value to Decode function. for example ‘N’, then the fuction return ‘Not Cyclic Counting

Inventory_Part_Count_Type_API.Decode(cycle_code) cycle_code

I found that this function called Domain_SYS.Decode_(Domain_SYS.Get_Translated_Values(lu_name_), Get_Db_Values___, db_value_);

FUNCTION Decode (
   db_value_ IN VARCHAR2 ) RETURN VARCHAR2
IS
   
   FUNCTION Base (
      db_value_ IN VARCHAR2 ) RETURN VARCHAR2
   IS
   BEGIN
      RETURN Domain_SYS.Decode_(Domain_SYS.Get_Translated_Values(lu_name_), Get_Db_Values___, db_value_);
   END Base;

BEGIN
   RETURN Base(db_value_);
END Decode;

 

As i further dig into it, it called Domain_SYS.Get_Translated_Values:

FUNCTION Get_Translated_Values (
   domain_ IN VARCHAR2,
   lang_code_ IN VARCHAR2 DEFAULT Fnd_Session_API.Get_Language) RETURN VARCHAR2
IS
BEGIN
   RETURN(coalesce(Get_Ctx_Values___(domain_, lang_code_), Get_Client_Values___(domain_)));
END Get_Translated_Values;

 

as i drill in furhter, it seems like it called Domain_SYS.Get_Ctx_Values___

FUNCTION Get_Ctx_Values___ (
   domain_ IN VARCHAR2,
   value_  IN VARCHAR2 DEFAULT NULL ) RETURN VARCHAR2
IS
   client_id_     CONSTANT VARCHAR2(64) := Sys_Context('USERENV', 'CLIENT_IDENTIFIER');
   context_       CONSTANT VARCHAR2(30) := domain_ ||suffix_;
   context_value_          VARCHAR2(4000);
BEGIN
   -- We would like to have this check, but it is causing a lot of problems right now.
   -- Raise an error if the domain name is not in the Dictionary
   --IF (NOT Dictionary_SYS.Logical_Unit_Is_Installed(domain_)) THEN 
   --   Error_SYS.Appl_General(service_, 'NOT_A_LU: The domain [:P1] is not a LU in the Dictionary.', domain_);
   --END IF;
   -- The use of global context does not handle when Client Identifier is set, therefore we need to unset it when fetching from the context
   -- If client identifier is set
   IF (client_id_ IS NOT NULL) THEN
      -- Clear client identifier
      Dbms_Session.Clear_Identifier;
      context_value_ := Sys_Context(context_, nvl(value_, 'PROG'), ctx_length_); -- Use PROG if no language
      -- Set back Client identifier
      Dbms_Session.Set_Identifier(client_id_);
   ELSE
      context_value_ := Sys_Context(context_, nvl(value_, 'PROG'), ctx_length_);  -- Use PROG if no language
   END IF;
   RETURN(context_value_);
EXCEPTION
   -- What ever happens make sure that Client Identifier is set to its original value
   WHEN OTHERS THEN
      Dbms_Session.Set_Identifier(client_id_);
      RAISE;
END Get_Ctx_Values___;

 

And from here, then i begin to confuse and not sure how the system decode the ‘N’ to ‘Not Cyclic Counting’

 

Appreciate if anyone can give me some hints. 

Best answer by SimonTestard

EE:

 

 

 

Cloud:

 

 

 

Enumerations like this basically generate translatable codes that the Decode Functions look up base on the client language you’ve selected to determine what to show the user.

 

The DB Version (Y,N in your case) is what is actually stored at the database level in the table, no matter which language the user actually uses (hence the Decode and Encode functions)

View original

4 replies

Forum|alt.badge.img+16
  • Superhero (Partner)
  • 398 replies
  • March 19, 2025

Hint: Inventory_Part_Count_Type_API.Language_Refreshed


Forum|alt.badge.img+12
  • Hero (Customer)
  • 256 replies
  • Answer
  • March 19, 2025

EE:

 

 

 

Cloud:

 

 

 

Enumerations like this basically generate translatable codes that the Decode Functions look up base on the client language you’ve selected to determine what to show the user.

 

The DB Version (Y,N in your case) is what is actually stored at the database level in the table, no matter which language the user actually uses (hence the Decode and Encode functions)


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Customer)
  • 16 replies
  • March 21, 2025
SimonTestard wrote:

EE:

 

 

 

Cloud:

 

 

 

Enumerations like this basically generate translatable codes that the Decode Functions look up base on the client language you’ve selected to determine what to show the user.

 

The DB Version (Y,N in your case) is what is actually stored at the database level in the table, no matter which language the user actually uses (hence the Decode and Encode functions)

Thank you, if i need to look up this translate value in database. Is there a sepcific table I find such as info?


Forum|alt.badge.img+12
  • Hero (Customer)
  • 256 replies
  • March 21, 2025

View is text_translation, the actual base table that holds the translated field is called language_translation_tab, but the primary key to that table attribute IDs, so you first need to know which attributes you’re looking at.

 

 

Might honestly be easier to just use an API call to get the translated values if that’s what you’re after.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings