Wednesday, November 9, 2016

 Digital Clock Timer's Trick  



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,


     You can not create a digital clock directly in Oracle forms. There is some work around i will show you to display a digital clock by using the timer trickA timer is not an object but it is actually an internal clock you pro-grammatically create. Now, let's define today's task and recognize what can be the solution for to simply perform the task. 



Task Definition:   

       Create a digital clock.    


Task Solution:

      The timer's trick is the only solution for Oracle Form. 
You can create the clock on the master's block or in the tool bar canvas.


Create a Timer:
  1.    Declare a variable of timer data type.
  2.      Initialize a variable with one second number data type.
  3.      Use a CREATE_TIMER built-in with the timer's name, interval and it's status  repeats every one second on timer's expiration.
  4.      Assign the timer's creation built-in to a variable of timer data type. 
  5.  Paste the following code in  WHEN-NEW-FORM-INSTANCE trigger Form-Level:     
DECLARE
   timer_id   Timer;
   one_sec    NUMBER (5) := 1000;   -- 1 second in milliseconds
BEGIN
   timer_id := CREATE_TIMER ('MYTIMER', one_sec, REPEAT);
END;
                                    
         Note: We assign one second interval with 1000 millisecond for one_sec variable.
 The user may be not interested  with seconds but only interested in hours and minutes only. Consequently, you can assign an initial value 60000  millisecond (minute ) for one_minute variable with .number  datatype as mentioned earlier.

       Delete a Timer:

       
       In timer's creation and expiration one second  created, executed in regards to current system date. It repeats itself endlessly. 
  1.  create a non database on your form named e.g. 'DIGITAL_TIME' with a character data type.
  2. Paste the following code in When-Timer-Expired Trigger Form-Level :
BEGIN
:DIGITAL_TIME := TO_CHAR(SYSDATE , 'HH12:MI:SS AM');
SYNCHRONIZE;
END; 
       
        If you want to display the system date and time in the same field correctly, you have to change the data type from character datatype to DATE TIME datatype and change the format mask for date and time. 

       Now, compile, generate and  run the form, if it works then save your form safely

         
         On the other hand, digital clock has a disadvantage in regards to form's input stability for the blinking of the cursor; it losses item focus. So digital clock in Oracle Forms is not recommended to use it frequently only for a specific purposes.

 Learn more about:


        ·       In-Direct Global Variable Access
   ·     Menu Item Enable/Disable



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.




Monday, September 26, 2016

Oracle Forms
 Default Menu Toolbar



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,


     Oracle forms can easily handle the CRUD processes of your system application and more in one menu toolbar.
 New developer with a  previous experience of other programming languages tends to manually handle the CRUD processes by  writing many lines of code which almost ends with wasting time and efforts while Oracle forms presents these functions and more in a menu toolbar.

Oracle forms toolbar 
 is a set of iconic buttons that represent individual items from a menu. Some of these buttons are  shortcuts to the forms basic operations CRUD  of Captured One.

The Acronym CRUD 
refers to all of the major functions that are implemented in relational database applications. Each letter in the acronym can map to a standard SQL statement as follows:

  Create  - INSERT  - to store new data.
  Read    - SELECT  - to retrieve data.
  Update - UPDATE - to change or modify data.
    Delete  - DELETE  - delete or remove data 

Without at least these four operations, your application  software cannot be considered complete. 
  
The  Oracle Forms default menu toolbar is not a separate menu module, but is built into every form module. If and Only if a developer specify this into each for menu as the  following steps:

·        Press (F4) to open the form module property.
·         Functional's node > select  menu module  property.
·        Paste  > DEFAULT&SMARTBAR

It includes standard commands for database transactions e.g. Save, New, Delete, Print button and common  navigating arrows as shown in the below image




Alternatively u could either create a canvas toolbar from canvas's property> canvas type> toolbar.
Or u could customize the menudefs.mmb. in the demos provided by Oracle.


Note:

  •        Pls notify that the DEFAULT&SMARTBAR must be attached if required to every form module as mentioned.
  •        The default menu toolbar is not for customization because it is a part of the frmall_jinit.jar.

In my point of view, any Oracle Developer  building a new system application can optimize his time by using the default menu toolbar giving by Oracle forms.
 Otherwise, if any other requirement is needed you can create your own customized one.

:Learn more about



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.





Thursday, September 22, 2016

Import Oracle Database



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,

  
Well, after discussing the export utility  to create an Oracle binary-format dump file, we will logically need to learn about  reading this binary file through using the Import utility.

Task Definition:   

Import  data  from dump files into an Oracle  database


 What Is the Import Utility?

        The Import utility is used to read data from Export files into an Oracle database. Export dump files can only be read by the Oracle Import utility. 


   Before using Import :            

  • Run the catexp.sql or catalog.sql script.
  • Verify that you have the required access privileges.

Task Solution:

There are two Import utility methods  you have to consider:
1.     imp (Old & not recommended).
  2.     impdp  (New & recommended).

Both methods will do the same function; import a dump file e.g. file_name .dmp and store the imported data into the database.

 The question you may ask is...
 What is the difference between both methods if they are giving me the same output ?

The Answer to Your Question:

·        Data Pump recreates  the user, whereas the old imp utility requires you or the DBA to create the user ID before importing.
·        The original import utility dates back to the earliest releases of Oracle, and it's quite slow and primitive compared to Data Pump that  gives 15 – 50%  performance improvement than exp/imp.
·        It's much easier to implement as you will see.

Now,let me ask you:  How do you export  your data ...?
 You have only two answers either using exp or using expdp method.

·         Using exp and a full schema requires these Solution Steps:
  
1.    Create the user:

create user identified by default tablespace quota unlimited on ;

2.    Grant the rights:

Grant connect, create session, imp_full_database to ;

3.    Start importing Data:

    Select Start  menu> select Run> write CMD then a window will open write the following command according to your naming requirements:

impdp user_name/password@database_instance   file= file_name.dmp  log=log_file_name.log full=y;
 Example:
 impdp Scott/tiger@orcl  file=test.dmp  log= test_log.log  full=y;     
·         Using expdp and a full schema requires you to only write this command line:
 Select Start  menu> select Run> write CMD then a window will open write the following command according to your naming requirements:

impdp user_name/password@database_instance   file= file_name.dmp  log=log_file_name.log    full=y;
 Example:
impdp Scott/tiger@orcl  file=test.dmp  log= test_log.log full=y;
          The Data Pump Import utility is invoked using the impdp command. The characteristics of the import operation are determined by the import parameters you specify. These parameters can be specified either on the command line or in a parameter file.

Note:
·        The version of the Import utility cannot be earlier than the version of the Export utility used to create the dump file.

Learn more about:

           Export Utility


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.




Tuesday, June 28, 2016

Export Oracle Database

Export Oracle Database


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,


Well, it's quite important to realize how you keep up your existing data safe
Taking a backup file from your database user is the key to safe guard your data.

Task Definition:   

Export data from Oracle database

       What Is the Export Utility?

        The Export utility provides a simple way for you to transfer data objects between Oracle  databases,  even if they reside on platforms with different hardware and software configurations.The extracted data is written to an Export file.


        Before using Export :            

  • Ensure there is sufficient disk or tape storage to write the export file
  • Verify that you have the required access privileges. 

  
Task Solution:

There are two Export utility methods:

1.  Exp.      
2.   Expdp. 

       Both methods will generate a dump file with extension file_name .dmp
    The  Export dump file is an Oracle binary-format dump file. The dump file name and  path directory is pre-determined before running the export utility.

      Start Exporting Data:

     Select Start menu> Run> write CMD then a window will open write the following command according to your naming requirements:


                              exp /@ file=.dmp log=.log full=y;

exp  user_name/password@database_instance  file= file_name.dmp
 log=log_file_name.log   full=y;

Example:

Exp Scott/tiger@orcl file=test.dmp  log= test_log.log full=y;


·                      It is  recommended to start exporting data with expdp command as follow:

    Expdp user_name/password@database_instance  file= file_name.dmp
 log=log_file_name.log   full=y;

            Example:


Expdb Scott/tiger@orcl file=test.dmp  log= test_log.log full=y;

The Data Pump Export utility is invoked using the expdp command. The characteristics of the export operation are determined by the export parameters you specify. These parameters can be specified either on the command line or in a parameter  file. 


Expdp Vs. Exp


  • Both does the same functionality; Exporting data.
  •   The original Export utility dates back to the earliest releases of Oracle, and it's quite slow and primitive compared to Data Pump that  gives 15 – 50%  performance improvement than exp/imp.


Note:


The contents of an export file can be displayed without actually performing an import.  How ???  using the Import   SHOW   parameter.

 The SHOW parameter Default: 'N' can be used ONLY with the FULL=Y 

When SHOW=y, the contents of the export file are listed to the display and not imported. 
The SQL statements contained in the export are displayed in the order in which Import will execute them.

Learn more about:

 ·        Import Oracle Database


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.