Execute OS command from form in 10g
Hi,
Is there a equivalent function/procedure in 10g forms for HOST command available in 6i?
Migrated a form from 6i to 10g that contains HOST procedure. Now this is no longer working in 10g forms.
Thanks
Hello,
I attached webutil.pll to the form and changed HOST to CLIENT_HOST.
This is the actual code
PROCEDURE CheckFTPDaemonStatus IS
Str VARCHAR2(100);
BEGIN
-- Check if FTP Daemon is up
Str := 'ps -efx | grep TPFTP.jar | grep -v grep';
Client_Host(Str);
IF (NOT FORM_SUCCESS)
THEN
Message_Box(NULL,'FTP daemon is unavailable. Please start the FTP daemon.',0);
EXIT_FORM(NO_COMMIT);
END IF;
END;This procedure is invoked when the form is being opened. Now the form itself is not coming up. Though ps -efx | grep TPFTP.jar | grep -v grep from UNIX command line shows this JAR is executing at OS level.
I am running the form on HP-UX
How do I check if CLIENT_HOST is successful or failure?
Thanks
Similar Messages
-
HOW CAN I EXECUTE DINAMIC SENTENCES FROM FORMS
HOW CAN I EXECUTE DYNAMIC SENTENCES FROM FORMS.
Ex.
I would like to execute this commands from table SENTENCES
COL1
set_item_property (item1, enabled , property_true )
set_item_property (item2, enabled , property_true )
set_item_property (item3, enabled , property_false )
Regards
Message was edited by:
jcruizcarrera
Message was edited by:
jcruizcarrera... but you could imagine a sort of workaround...
PROCEDURE Set_Item
PC$Item In Varchar2
,PN$Property In Number
,PC$Value In Varchar2
) IS
BEGIN
Set_Item_Property( PC$Item, PN$Property, PC$Value ) ;
END;That you can call like this:
Set_Item( 'BL.BUTTON', LABEL, 'Hello' ) ;Francois -
Running Copy command from Forms 6i
HI!
I want to run Copy command through Forms 6i i.e copy from scott/tiger@orcl insert test@msora(ename) using select to_char(ename) ename from emp;
I can run DDL command through Forms_ddl functions in Forms 6i, But copy command is not working using Forms_ddl.
thanks in advance.
Edited by: Kami_Lily on Aug 2, 2009 10:04 PMDear Kami Lily,
Oracle Forms is able to execute SQL and PL/SQL command only. Additionally it supports Operating System command by HOST built-in.
Though COPY is a SQL*Plus command, it is not possible to execute this command by HOST built-in.
Instead, if you hardly want to execute COPY command oracle forms 6i, then you make a batch file in operating system and run that batch file from HOST built-in.
Thanks. -
How to execute unix command from ODI Procedure
Hi,
I am trying to execute below unix command from ODI Procedure (Command on Target tab) but I am getting the error "java.io.IOException: Cannot run program "cd": error=2, No such file or directory" but when I try to execute the same command using OdiOSCommand, it is executing successfully. I don't want to use shell script to execute this command. Is there any specific syntax am I missing to execute this command from ODI procedure?
cd /project3/tmt/;ls *.dmp > dmplist.lst
Please help me on this...
Thanks
MTHi nahlikh,
Thank you for the reply.
I used below command in Procedure but still getting the same error as "java.io.IOException: Cannot run program "OdiOSCommand": error=2, No such file or directory".
OdiOSCommand "-COMMAND=cd /project3/tmt/;ls *.dmp > dmplist.lst"
as I mentioned earlier if I use the command cd /project3/tmt/;ls *.dmp > dmplist.lst in OdiOSCommand tool it is executing successfully without any issues.
any thoughts appreciated to get a solution for this issue.
Thanks
MT -
How to execute Linux command from Java app.
Hi all,
Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
Thanks a lot,You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
java.io.BufferedReader br =
new java.io.BufferedReader(new java.io.InputStreamReader(
Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
getInputStream()));
while ((s = br.readLine()) != null) {... -
hi experts ,
i need to execute DOS command from SAP .
earlier we have 'GUI_EXEC' WS_EXECUTE , 'WS_DOWNLOAD' etc which are Obsolete now.
as we are using ECC6.0. kindly guide how to do this.
best regards,
RahulTry out...
DSVAS_DOC_WS_EXECUTE_50
or
CL_GUI_FRONTEND_SERVICES=>EXECUTE
<b><REMOVED BY MODERATOR></b>
Thanks & Regards
ilesh 24x7
Message was edited by:
Alvaro Tejada Galindo -
Execute a command from servlet
Hello,
How can I execute this command from a servlet ?
example: I want execute "java -cp /root/:/root/log/api/:/root/log/apps/ Transmitter" when I lunch servlet1.java
so which class in JAVA can do this ?
Thanks ?why u want to run another program? Usually you call the methods within the second program.
Is it possible to invoke another program in the server using a servlet? If so it could even mess up the whole server. I am not sure. -
Execute linux command from java
I wanna execute linux command from java, bu the output has error:
Return code = 1
top: failed tty get
The code as:
import java.io.*;
public class Execute {
public static void main(String[] args) {
try {
final Process process = Runtime.getRuntime().exec("top");
new Thread() {
public void run() {
try {
InputStream is = process.getInputStream();
byte[] buffer = new byte[1024];
for (int count = 0; (count = is.read(buffer)) >= 0;) {
System.out.write(buffer, 0, count);
} catch (Exception e) {
e.printStackTrace();
}.start();
new Thread() {
public void run() {
try {
InputStream is = process.getErrorStream();
byte[] buffer = new byte[1024];
for (int count = 0; (count = is.read(buffer)) >= 0;) {
System.err.write(buffer, 0, count);
} catch (Exception e) {
e.printStackTrace();
}.start();
int returnCode = process.waitFor();
System.out.println("Return code = " + returnCode);
} catch (Exception e) {
e.printStackTrace();
}Help please.Your code is probably good to run a program, that does not use terminal capabilities.
Program "top" is a little bit more complicated - you have to run it with a real terminal.
Try to run "xterm -e top". You can find an example how to run an external program
from java code in cnd/gdb module on http://cnd.netbeans.org
For example, take a look at openExternalProgramIOWindow() method on this page:
http://cnd.netbeans.org/source/browse/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/proxy/Attic/GdbProxyCL.java?rev=1.1.2.6.2.5&only_with_tag=release551_fixes&view=markup
It runs a command with external terminal.
Thanks,
Nik -
Unable to execute Linux command from Java
Hi,
I am currently working on a code wherein i need to execute Linux command from Java. Below are some of the query i have.
1) Is there any efficient method of running OS commands from Java, rather than using Runtime and Process method.
2) Below is details of my code which fails in execution
**-- Java Version**
java version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK Server VM (build 1.6.0-b09, mixed mode)
-- Program Code ----
Where <path> = Path i put myself
package test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.*;
public class GetInode{
* @param args
public static void main(String[] args) {
GetInode test = new GetInode();
test.getInode();
public void getInode(){
String command = "/usr/bin/stat -Lt <path>;
System.out.println(command);
Process process;
Runtime rt;
try{
rt = Runtime.getRuntime();
process = rt.exec(command);
InputStreamReader isr = new InputStreamReader(process.getErrorStream());
BufferedReader bre = new BufferedReader(isr);
BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream());
System.out.println(bre.readLine());
System.out.println(br.readLine().split(" ")[7]);
process.destroy();
}catch (Exception ex){
System.out.println("Error :- " + ex.getMessage());
------Output -------------
/usr/bin/stat -Lt "<path>"
/usr/bin/stat: cannot stat `"<path>"': No such file or directory
Error :- null
Can any one help me what is wrong and why i am unable to run the Linux command from Java.For clarity purpose............i m submitting actual code here
--- Code ---
package test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.*;
public class GetInode{
* @param args
public static void main(String[] args) {
GetInode test = new GetInode();
test.getInode();
public void getInode(){
String command = "/usr/bin/stat -Lt \"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt\"";
System.out.println(command);
Process process;
Runtime rt;
try{
rt = Runtime.getRuntime();
process = rt.exec(command);
InputStreamReader isr = new InputStreamReader(process.getErrorStream());
BufferedReader bre = new BufferedReader(isr);
BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
System.out.println(bre.readLine());
System.out.println(br.readLine().split(" ")[7]);
process.destroy();
}catch (Exception ex){
System.out.println("Error :- " + ex.getMessage());
--- Output ---
[ratz]s0898671: java GetInode
/usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
/usr/bin/stat: cannot stat `"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"': No such file or directory
Error :- null
-- Linux Terminal --
If i copy the first line from the output and execute on Linux terminal her is the output that i get
[ratz]s0898671: /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt 12003 24 81a4 453166 10000 1c 360466554 2 0 1 1246638450 1246638450 1246638450 4096
Can you just assist me where am i really making mistake.......i was wondering if the command that i pass from Java....can be executed on Linux terminal why is it faling to run from java.........and when i print the Error Stream for process output........it show cannot Stat....... -
Execute shell command from Java
Hi all,
I need some idea for executing shell script from Java programe.
For example i have start.sh script in /tmp/start.sh folder of unix server.
I want to execute shell script from local java code.
Any idea on this.Hi,
Read the following articles/posts, maybe this could help you:
How to execute shell command from Java
Running system commands in Java applications | java exec example | alvinalexander.com
Want to invoke a linux shell command from Java - Stack Overflow -
Issue with Executing OS commands from Stored Procedure
I am trying to execute the scripts provided at :
http://github.com/xtender/XT_SHELL
provided by xtender user.
As required, I have asked my DBAs to grant privileges by executing the following scripts:
Begin
--change to needed permissions and execute
dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/factiva/ODS/bin/CVIM_Rpt_ExportCSVFile’, 'read,write,execute' );
end;
/where CVIM_Rpt_ExportCSVFile is my script residing in the Unix server where my Oracle is installed.
The error I am facing when I try to execute the following command is:
select * from table(xt_shell.shell_exec('/var/scripts/CVIM_Rpt_ExportCSVFile',100))
Exception:the Permission (java.io.FilePermission /var/scripts/CVIM_Rpt_ExportCSVFile execute) has not been granted to ODS. The PL/SQL to grant this is dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )I have asked my DBA to also execute the following scripts: - But I still see the same error as above. I am not able to figure out whats going on. Can anyone pls help me out??
EXEC Dbms_Java.Grant_Permission('ODS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
EXEC Dbms_Java.Grant_Permission(ODS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )DUPLICATE
===============================================================
Issue with Executing OS commands from Stored Procedure
============================================================== -
Execute system commands from LabVIEW
Hi,
can anybody please help me with how to execute sytem commands from labview
(WIn98 in particular).
Basically I would like to execute the command "javac example.java"
Looking forward to responses.
Please be kind enough to send me a email also
manjul [email protected]Oops. Looks like I lost the attachment on the way. Sorry... Here it comes
Attachments:
Command_Execution.vi 21 KB -
Execute operatingsystem commands from java classes?
How can I execute operatingsystem commands from my java classes?
So that I on a Linux box could i.e. execute "ls -l" etc.Also read this:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html -
Can we execute DOS Commands from a Java Application
I just want to know whether we can execute DOS Commands from a Java Application.
Thanks.hi,
try this:
Runtime.getRuntime().exec("cmd /c start abc.bat");
andi -
Broken URL in executing forms from Form Builder (10g)
From Form Builder I'm trying to execute a form "opened".
I push "Run Form" button and i can see Explorer opening with a wrong URL :
"http://%%20http://127.0.0.1:3696/4gjkr8swXxZKBJppfymDMZmBSac7cACualcFLIa3Vgsk6hmm"
Obviously, "http://%%20" are wrong characters. If I erase them, I can see my form correctly executed. But I can't understand where are wrong characters .. in registry ?? ... in a configuration file ??
From Form Builder, i can only change the "Application Url" from Preferences/Runtime tab, but this is the "second" URL, and not the First startup Url.
Any helps ?See Metalink Note 238159.1 for several solutions and/or workarounds for this problem.
Maybe you are looking for
-
Dear all, Workflow 2.6.4 The below procedure consumes lot of time and oracle advises the below : Recommendation 1: SQL Tuning Estimated benefit is .58 active sessions, 29.74% of total activity. Action Tune the PL/SQL block with SQL_ID "6bd4fvsx8n42v"
-
Read the valid Operation/Activity Master Recipe data using an FM
Dear all, Can anyone guide me to a function module, which could read the relevant master recipe data taking the validity date into consideration. i.e. the function module should return the correct valid data based on the Key Date. Is there such a fun
-
Creating a multipage pdf in photoshop CS4
I've just upgraded from CS1 to CS4, and previously you could create a multipage PDF easily under the File>Automate menu. So how do you do that in CS4? The feature has been moved somewhere. I dont want two seperate A4's I want to learn how to create o
-
Import mxf to pro cs3 3.0
I'm told it's possible to import MXF files from P2 cards into Pro cs3 3.0. It seems to only import the sound and no picture. Do I need 3.1 or later ?
-
Cuando pongo a cargar a mi ipod 4 en la computadora no lo reconoce.
Cuando pongo a cargar a mi ipod 4 en la computadora no lo reconoce. ¿Qué pasa? Ya tengo bajado la última versión de itunes.