host command [message #464207] |
Tue, 06 July 2010 22:24 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
jocylau
Messages: 11 Registered: July 2010
|
Junior Member |
|
|
i was trying to use the host command to run the commands from linux. however, it doesnt work can someone pls help out.
Thx
PROCEDURE compile_procedure IS
c_success boolean;
c_bare_filename varchar2(50);
command_string varchar2(1000) ;
BEGIN
c_bare_filename := substr(:B_DEV.B_DEV_ITEM_FILENAME,instr(:B_DEV.B_DEV_ITEM_FILENAME,'\',-1)+1);
c_success := webutil_file_transfer.Client_To_AS_with_progress
(clientFile => :B_DEV.B_DEV_ITEM_FILENAME
--,serverFile => 'c:\damntesting\'||c_bare_filename
--,serverFile => '/smsehk/mmds/core/src/fmb/us/'||c_bare_filename
,serverFile => '/tmp/leo/upload/'||c_bare_filename
,progressTitle => 'Upload to Application Server in progress'
,progressSubTitle => 'Please wait'
,asynchronous => false
,callbackTrigger => null
);
if c_success
then
message('File uploaded successfully to the Application Server');
command_string := 'cp /tmp/leo/upload/'||c_bare_filename || ' /smsehk/mmds/core/src/fmb/us';
synchronize;
host(command_string, NO_SCREEN);
synchronize;
command_string := '/smsehk/mmds/core/src/fmb/us/compile_f.sh ' || c_bare_filename;
synchronize;
host(command_string, NO_SCREEN);
synchronize;
command_string := 'cp ' || '/smsehk/mmds/core/src/fmb/us/' || substr(c_bare_filename, 1, (length(c_bare_filename) - 1)) || 'x' || ' /smsehk/mmds/core/orabin/fmx/us';
synchronize;
host(command_string, NO_SCREEN);
synchronize;
else
message('File upload to Application Server failed');
end if;
exception
when others
then
message('File upload failed: '||sqlerrm);
END;
|
|
|
|
Re: host command [message #464209 is a reply to message #464208] |
Tue, 06 July 2010 23:07 ![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) |
jocylau
Messages: 11 Registered: July 2010
|
Junior Member |
|
|
command_string := 'cp /tmp/leo/upload/'||c_bare_filename || ' /smsehk/mmds/core/src/fmb/us';
it works fine up to the above line.
as i've checked in linux that the file is stored there.
there are no error msgs in oracle but i used linux to check whether the file exists in the specific location
the rest of the lines dun seem to work as following as they dun exist in the location of the path i stated:
command_string := '/smsehk/mmds/core/src/fmb/us/compile_f.sh ' || c_bare_filename;
synchronize;
host(command_string, NO_SCREEN);
synchronize;
command_string := 'cp ' || '/smsehk/mmds/core/src/fmb/us/' || substr(c_bare_filename, 1, (length(c_bare_filename) - 1)) || 'x' || ' /smsehk/mmds/core/orabin/fmx/us';
synchronize;
host(command_string, NO_SCREEN);
synchronize;
|
|
|
|
Re: host command [message #465391 is a reply to message #464251] |
Wed, 14 July 2010 01:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Have you solved your problem?
You must remember that each 'host' command starts in a new session and you may have to establish 'path' and other environmental variables. I suggest displaying and capturing your 'command_string' and verify that each will work as the first command in a new session.
David
|
|
|