|
|
|
|
|
|
|
|
|
|
|
Re: How to call bat file from Oracle Form [message #547131 is a reply to message #547130] |
Mon, 12 March 2012 08:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Sounds like there's something wrong with your forms setup:
01041, 00000, "internal error. hostdef extension doesn't exist"
// *Cause: Pointer to hstdef extension in hstdef is null.
// *Action: Report as a bug
I suggest you look the error up on My Oracle Support.
|
|
|
|
|
|
Re: How to call bat file from Oracle Form [message #547221 is a reply to message #547154] |
Tue, 13 March 2012 06:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
i am using same thing with but its working fine here anyway try something else like
u can use either SQL Loader or external Tables. or u have to choosed SQL loader option and created a form along with a control file and batch file based.
Control File
LOAD DATA
INFILE 'D:\mughals\Pay\Clock Dump\CLK_050611\clock_dump.txt'
INTO TABLE ARS_CLOCK_DUMP
(TDATE POSITION(01:08) DATE 'YYYYMMDD',
VER POSITION(09:10) CHAR,
EMPNO POSITION(11:15) CHAR,
TTIME POSITION(16:19) CHAR,
BRADD POSITION(21:22) CHAR
)
Batch file being called from the form
sqlldr userid=mughal/mughal@owais
ERRORS=500000
control=D:\mughals\Pay\Modified\Forms\ars_clock_dump.ctl
log=D:\mughals\Pay\Modified\Forms\ars_clock_dump.log
and the above batch files is called from the form using
host('D:\mughals\Pay\Modified\Forms\load_data.bat',no_screen);
With above all the form works perfectly which is the development evironment and also client PC.
-------Other Solution-------when-button-pressed----------------
declare
usid varchar2(10):= get_application_property(username);
pwd varchar2(10):= get_application_property(password);
db varchar2(10):= get_application_property(connect_string);
begin
v_ctl_file := text_io.FOPEN(v_live_path||'ars_clock_dump.ctl', 'w');
text_io.PUT_LINE (v_ctl_file, 'LOAD DATA');
text_io.PUT_LINE (v_ctl_file, 'INFILE '''||v_live_path||'clock_dump.txt''');
text_io.PUT_LINE (v_ctl_file, 'INTO TABLE ARS_CLOCK_DUMP');
text_io.PUT_LINE (v_ctl_file, '(TDATE POSITION(01:08) DATE ''YYYYMMDD'',');
text_io.PUT_LINE (v_ctl_file, 'VER POSITION(09:10) CHAR,');
text_io.PUT_LINE (v_ctl_file, 'EMPNO POSITION(11:15) CHAR,');
text_io.PUT_LINE (v_ctl_file, 'TTIME POSITION(16:19) CHAR,');
text_io.PUT_LINE (v_ctl_file, 'BRADD POSITION(21:22) CHAR');
text_io.PUT_LINE (v_ctl_file, ')');
text_io.FCLOSE (v_ctl_file);
v_bat_file := text_io.FOPEN(v_live_path||'load_data.bat', 'w');
text_io.PUT_LINE (v_bat_file, 'sqlldr userid = '|| usid || '/' ||pwd || '@' ||db || ' ERRORS=1000000 control = '|| v_live_path||'ars_clock_dump.ctl log = '|| v_live_path||'ars_clock_dump.log');
text_io.FCLOSE (v_bat_file);
host(v_live_path||'load_data.bat',no_screen);
Exception when others then
message(sqlerrm||dbms_error_text);
message(' ');
end;
Presently i am working on all these things which i given detail for u as above
hope it should work for u
Best regards
|
|
|
|
|
|