Home » Developer & Programmer » Forms » host command
host command [message #464207] Tue, 06 July 2010 22:24 Go to next message
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 #464208 is a reply to message #464207] Tue, 06 July 2010 22:31 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:
it doesnt work can someone pls help out
What does that mean? Did you get any error?
Try to print the command for debugging.
Have you executed the command from prompt and is it working fine?

By
Vamsi
Re: host command [message #464209 is a reply to message #464208] Tue, 06 July 2010 23:07 Go to previous messageGo to next message
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 #464251 is a reply to message #464209] Wed, 07 July 2010 02:21 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Please don't use chat language.
Do you have permissions on compile_f.sh?Quote:
Have you executed the command from prompt and is it working fine?
By
Vamsi
Re: host command [message #465391 is a reply to message #464251] Wed, 14 July 2010 01:21 Go to previous message
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
Previous Topic: Passing parameters to next page, but values not saved
Next Topic: How to handle Tlist
Goto Forum:
  


Current Time: Fri Sep 20 06:33:29 CDT 2024