Thursday, May 28, 2015

Arabic Characters Displayed in ?? ???

 Arabic Characters Displayed in  ?? ???



      In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that

              A frequently asking question about how to avoid retrieving Arabic characters in question marks. In Shaa Allah, today i will explain the reasons for such a problem and how to overcome it. Since it is a common and annoying problem facing most developers who are not familiar with Oracle character-set pre-installation requirements.
  

Key Problem:


    Data retrieved from database into forms in question marks ????? ??? ?????   


Key Reason:


 In fact, this problem starts on setting up "Oracle database". The Oracle Universal Installer always makes checks on the default language you specified  for your Windows Operating System.

This check makes sense to The Oracle database Installer to select the logical Character-set that fits your requirements.


     Determining Oracle Database encoding method: 


 SELECT parameter , value
     FROM NLS_DATABASE_PARAMETERS
    ;’% WHERE parameter like ‘%CHARACTERSET
PARAMETER                                        VALUE
—————————— —————————————-
NLS_CHARACTERSET                       WE8MSWIN1252
NLS_NCHAR_CHARACTERSET         AL16UTF16

 

  The Problem Reasons Conclusion   


There are two precise reasons for such problems(Question marks & junck):

1.      Incompatible"NLS_LANG" parameter with your default Windows Operating System's language.
2.     In-compatible character-set between Oracle database Server and the Client-side (forms and reports) applications.

  In other words, just for instance, if Oracle database uses UTF-8 characters, thus your client's Oracle  forms and reports applications  MUST  use the same UTF-8 Character set too. Otherwise, you will face language issues for incompatible character-set.


Key Solution:

     Enabling the default Arabic Language on your server or pc is a necessary step but not a solutionit guarantees inserting Arabic Letters but, still your data retrieved in question marks. On the other hand, Re-installing the Oracle database with the correct nls_lang is also expensive in time, effort and not a good alternative solution. 

 The Key Solution For enabling both English and Arabic Languages 


     This solution implies two necessary steps, in some cases, related to each other.  

1.     Client Side:

                   Create a New User environment Variable named 'NLS_LANG'  give the                         following value: AMERICAN_AMERICA.AR8MSWIN1256

          2.     Oracle Database Server Side: 

                  The following workaround will help you to avoid removing and re-installing                    a new Oracle database.

         Warning:


              Oracle Express Edition is limited to a single instance on any server. 

              Oracle licensing terms don't allow for more than one instance on a given server.
             If you need more database instances, you need to download
             Either Oracle Database Standard or Enterprise Edition.

   Create a New Oracle Database Instance Steps


1)  Take a back up from the current database.

2) Select Start > All Programs > Oracle - OraDb10g_home1 > Configuration and migration Tools >Database Configuration Assistant >Create a Data Base

3)(Press Next)    > General Purpose  (Press Next) > Global Database Name (SID)   (Press Next)  > Configure the data base with Enterprise Manager (no changes)

4) (Press Next)   > Specify  a password for your account  & confirm it (Press Next)  > File System (No Changes) (Press Next)  > Use Database file Location from Template (No Changes)

5) (Press Next)   > Specify Flash Recovery Area (No Changes) (Press Next) > Sample Schema (No Changes)

6) (Press Next)   > (a Window with 4 tabs appeared ) Select the Character Sets 's tab use the Default (Only and only if your Default Language was set to Arabic)
(Notice: AR8MSWIN1256) (IF not choose from the list of the character sets that AR8MSWIN1256) (u have also the default  Language and date u don't have to change) 

7) Data base Storage (No Changes) (Press Next)    >

8) Create Database (No Changes)  (Press Next)  > Then  Press  Finish  >

9) A General Purpose Summary Window will appear (Notice the Character Sets is now that AR8MSWIN1256 we r looking for it as selected)

10) Press OK Now the Creation Process of the data base will Start as if u r installing a new database from the beginning up to the end then Press Exit button

11) Connect your db with the new password u previously included in the Wizard and
 import the old dump then try to connect your forms with the new db,enter the data,
 save & Retrieved.




Note: The following are successful examples.

How to Test New effects  

   Fixing the problem DOES NOT CORRECT the wrong data the user had input. 
You have to RE-ENTER new data, store and retrieve it.
  Changing"NLS_LANG" parameter has NO affect on the Old stored data. 


 Run the following query. The output of your correct query result should be as follow:

SQL>  SELECT * FROM v$nls_parameters
  2  WHERE parameter in ('NLS_CHARACTERSET','NLS_LANGUAGE');
PARAMETER                           VALUE
-------------------------------   ---------------------------------
NLS_LANGUAGE                 ARABIC
NLS_CHARACTERSET       AR8MSWIN1256

Note: If  no change in data base "NLS_LANGoccurs then you have to restart the database to refresh its "NLS_LANG" with the new parameter  value.


Hope it Helps…


My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.



Wednesday, May 13, 2015

Dependent Drop Down List


In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

Key Problem:
 The problem you will face when you have two popup lists and you are attempting to populate the second  popup list depending on the selected  value of 
the first popup list is



Key Solution: 

Let's Suppose we have the first list DNAME which displays all the department names stored in the department table.
The idea of populating the second popup list depending on the selected value of the first popup list is replies in using a specific DEPTNO value to filter the values displayed according to the Second popup list


The following example is intended to populate  the emp_name in respect to the first list-item selection of e.g. DNAME 


In When-List-Changed  Trigger of the First List e.g." DNAME"  you have to write the 

following code...




 
-- The following code attain the key solution of the problem.
-- The list DNAME will be changed depending on the DNAME list value  
-- selection & filtered by the DEPTNO
 
DECLARE
 
rg_city RECORDGROUP;
rg_name VARCHAR2(40) := 'EMP';
list_id Item := Find_Item('EMP.ENAME');
vTemp NUMBER;
 
BEGIN

-- The following is checking your Group doesn't already exist through 
-- searching for it and delete it if exists.
 
rg_city  := FIND_GROUP(rg_name); 
IF NOT id_null(rg_city) 
 THEN Delete_Group(rg_name);
End if;
  
-- If it doesn't exist then create it and add your query to it
 
rg_city :=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT ENAME , ENAME FROM EMP WHERE EMP.DEPTNO = '|| :DEPT.DEPTNO);
 
SET_RECORD_PROPERTY(:system.cursor_record,'EMP',status,new_status);
vTemp:=POPULATE_GROUP(rg_name);
 POPULATE_LIST('EMP.ENAME', rg_name); 
 
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL;
WHEN OTHERS THEN MESSAGE('Follow up the error : '||SQLERRM); 
END;


Note: in the select statement there are two database columns selected; 'SELECT ENAME , ENAME' one column for the 'List Element' and the other column is  for 'List Item Value'. In compare with 'The Static List Item' that has a fixed value; "Elements In List" property.


 Three Steps to Forms Data Exchange "Parameter List":   Learn More about




My success only comes from Allah, pls. note your comments and suggestions are great 

help for me in progress thanks in advance.


Saturday, May 9, 2015

Best 3 Steps To Suppress Messages Oracle Forms

 The Best 3 Steps To Suppress
Messages Oracle Forms 



In the name of Allah, Most Gracious, Most Merciful

Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

Introduction


     In fact, start learning oracle forms must be confronted with some problems as any programming language. You may find yourself desperate, .stressed and  unable to move forward smoothly
This is really embarrassing especially when the dead line of your application delivery is getting closer.
  
No worries, it's normal. Many error messages pop-up at run-time since you are new to this working programming language environment. But, forms needs you to realize the way to output your required tasks the way you expect.  you didn't handle them properly as expected. 

     Eventually, the following optimized technique is the best practice i successfully used not only to oblige the application end-users to input valid data, but also to save more wasted time and effort early before testing and maintaining stages.


ask DefinitionT   
         
    
  Suppress Errors & Informative Oracle Forms Messages


Task Solution:

    

Pls follow the following three steps:


Step One: 


Create a table for customizing Form Errors


CREATE TABLE ERROR_MESSAGES
)
,MSG_CODE NUMBER (5, 0) NOT NULL Primary Key 
,MSG_TYPE VARCHAR2 (1) NOT NULL 
MSG_DESC VARCHAR2 (200) NOT NULL
; ( 


Step Two:


Run the Following Ready English Script 


     The above link is just a sample data of  such Oracle Form error & informative messages into the above table created in step one.


Step Three:


Create On-Message and On-Error Triggers  



DECLARE
       lv_errcod NUMBER  := ERROR_CODE;    
       alert_message          VARCHAR2 (200);
  BEGIN
         SELECT msg_desc
         INTO     alert_message
         FROM   error_messages
         WHERE msg_code = lv_errcod ;
 EXCEPTION
         WHEN OTHERS THEN
       alert_message:=message_type||'-'|| To_Char(message_code)
 || ': ' ||  message_text;
 Raise Form_Trigger_failure;    
  END;

 

Conclusion: 

       You can make a full benefit of the three steps as:

  1.  Create a table to build a database to your form errors.
  2.   Run the following most common customized informative and error messages of The Oracle Forms.
  3. Create an On-Error & On-Message triggers Form-Level to call the customized messages just in need. 




Hope this helps…



My success only comes from Allah, pls. note your comments and suggestions 
are great help for me in progress thanks in advance.


 Forms 6i Icons Do Not Display on Windows 7 


  

     In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


    In respect to fulfilling customer's requests on a daily basis, your customer may ask you to make his old forms version application ' forms 6i' works on his laptop or his windows 7 work office PC.

Many issues you will face concerning compatibility between Oracle forms and Windows 7 operating system.


    The Oracle Form icons issue is a significant issue for your forms application. If your form icons do not display icon images, then your whole project will be stuck.


Key Problem: 

Oracle forms 6i Icons Do Not Display on Windows 7 version.


Key Reason: 

The reason of this issue is as a result of either the path of the form's icon parameter is Not Set correctly or it is not initially created before running your form.
   On the other hand, if you verified that your iconic parameter is exist and set correctly with the appropriate folder name and path, then most probably it's a compatibility issue of using such old form version with newer operating system version.


Key Solution:


·        Select Windows Start menu > Choose Run > enter regedit, and click OK.


·      Close all your Oracle forms.

·     Check that the UI_ICON is set correctly:
  
o   If your operating system "Windows7 32 Bit" then follow the Registry
 Path: "HKEY_LOCAL_MACHINE \ SOFTWARE \ ORACLE"
o   If your operating system"Windows7 64 Bit" then follow the Registry
 Path:"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE"
o   Alternatively,  Search for UI_ICON key; Press F3
o   If  you found it Double click UI_ICON  key to open or edit it > copy the path of your image folder and reset  UI_ICON key the paths of your icon folder
o   If  not found then you have to manually Create a Registry Key string: UI_ICON
         o   Then Double click UI_ICON  key to set the correct path for your button icon images. 

·     Second, Search for the Oracle forms 6i executable file name: “IFBLD60.EXE”  right click the file under “File Properties“ -> “Compatibility”  tab : you have a check box option > “Run this program in compatibility mode” you had a check mark on this option during installation process to start; now you have to “uncheck” it.

·      Reopen your old Oracle forms 6i, you will be able to see your icons in Forms run-time.  


Note:
·        Client/server Forms uses the' .ico' format for icons.
·        Specifying the icon name in the property palette of your form; just put the 'open' not 'open.ico'.


Hope this helps…

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.