Monday, 13 May 2013

Code for excute a data loader from oracle forms.

In "When Button Pressed " Trigger of a button in the form, write the below mentioned code,



DECLARE
   usid            VARCHAR2 (10)   := 'apps';
   pwd             VARCHAR2 (10)   := 'wipl10';
   db              VARCHAR2 (10)   := 'dev';
   msqlldr         VARCHAR2 (300);
   ctrl_filename   VARCHAR2 (300)
               := '/c03/DEV/apps/apps_st/appl/payapps/12.0.0/bin/my_test.ctl';
   data_filename   VARCHAR2 (300)
               := '/c03/DEV/apps/apps_st/appl/payapps/12.0.0/bin/my_data.csv';
   fname           VARCHAR2 (1000);
BEGIN
   msqlldr :=
         'sqlldr'
      || ' userid='
      || usid
      || '/'
      || pwd
      || '@'
      || db
      || ' control='
      || ctrl_filename
      || ' data='
      || data_filename;
   HOST (msqlldr, no_screen);
END;

Usid :- is the user id of the database.
pwd:- is the password of the database
db:- the database sid.
ctrl_filename:- is the control file location along with the control file name in the server
data_filename:- is the control file location along with the control file name in the server

1 comment:

  1. Nice article. Thanks!

    I like Data Loader a third party tool which is an alternative to SQL Loader, which does not need any commands or programming and supports bulk loads also. One can download it from http://www.dbload.com

    ReplyDelete