Sunday, June 7, 2015

Removing Special Character File Names in Linux

Accidentally a file was created with a name of "-rw-r--r--.err". I can't remove this file using our normal shell commands. At last lot of searches in Google I found a solution.

Find the inode of the file using the following command

$ ls –il


 9078727 is inode number.

Now Use find command to delete file by inode:
$ find . -inum 9078727 -exec rm -f {} \;

It will find that file and will remove it with force i.e remove without prompt.

Wednesday, January 1, 2014

Delete document attachments using API


Begin
l_entity_name FND_ATTACHED_DOCUMENTS.entity_name%type;
l_pk1_value FND_ATTACHED_DOCUMENTS.pk1_Value%type;
l_delete_document_flag varchar2 (1)   :=  'Y';    
l_user_id Number;
l_responsibility_id Number;
l_resp_application_id Number;
BEGIN

fnd_global.apps_initialize ( user_id          =>  l_user_id
                                      ,resp_id          =>  l_responsibility_id
                                      ,resp_appl_id  =>  l_resp_application_id);

fnd_attached_documents2_pkg.delete_attachments
( X_entity_name                 =>  l_entity_name
, X_pk1_value                    =>   l_pk1_value
, X_delete_document_flag   =>   l_delete_document_flag);

commit;
END;

SQL Query to list Active Responsibilities of a Active User

SQL Query to list Active Responsibilities of a Active User

SELECT fu.user_name,
       frv.responsibility_name,
      frv.responsibility_key,
      furgd.start_date,
       furgd.end_date
FROM fnd_user fu,
  fnd_user_resp_groups_direct furgd,
  fnd_responsibility_vl frv
WHERE fu.user_id                     = furgd.user_id
AND furgd.responsibility_id          = frv.responsibility_id
AND furgd.end_date                  IS NULL
AND furgd.start_date                <= sysdate
AND coalesce(furgd.end_date, sysdate + 1) > sysdate
AND fu.start_date                   <= sysdate
AND coalesce(fu.end_date, sysdate + 1)    > sysdate
AND frv.start_date                  <= sysdate
AND coalesce(frv.end_date, sysdate + 1)   > sysdate;


Oracle SQL Query to list all Form Personalizations

Oracle SQL Query to list all Form Personalizations

SELECT ffv.form_id                 ,
  ffv.form_name                     ,
  ffv.user_form_name                ,
  ffv.description ,
  ffcr.SEQUENCE                     ,
  ffcr.description "Rule Name",
  ffcr.trigger_object,
  ffcr.condition
  From fnd_form_vl ffv,
              fnd_form_custom_rules ffcr
  Where ffv.form_name = ffcr.form_name
  Order By ffv.form_name, ffcr.SEQUENCE;

Tuesday, December 31, 2013

How to delete a concurrent program in APPS

Oracle application allows creation of concurrent programs but does not allow deletion of the concurrent programs. Through form user can disable a concurrent program.

We can use API for deleting concurrent programs and executables:

Delete the concurrent program. The script is

BEGIN
   fnd_program.delete_program (program_short_name   =>'XXPMSJB',
                                                 application          =>'XXPMS');
   COMMIT;
END;

The above concurrent program is deleted and it cannot be queried.


The executable exists. It can be deleted also using PL/SQL,


BEGIN
   fnd_program.delete_executable (executable_short_name   =>'XXPMSJB',
                                  application          =>'XXPMS');
   COMMIT;
END;