Hi all,
I've created a Java class in my Oracle DB that calls a Visual Basic program to convert a XLS file into a CSV file in order to load it into an external table. The problem that I have is that when I call the Visual Basic program from the Java class, nothing happens. I had the same problem with a Python program, and I thought that the problem was from Python, but now with Visual Basic the problem remains, both aren't executed.
The strange thing is that when I call the same Java class outside Oracle, directly from a command line, it executes both Python and Visual Basic programs.
Here is the Java class defined in Oracle:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "OSCommand" AS
import java.io.*;
public class OSCommand{
public static void Run(){
try
{
Runtime r = Runtime.getRuntime();
Process p = r.exec("cmd /c C:\\Ficheiros\\SAP\\Novos\\XlsToCsv.vbs C:\\Ficheiros\\SAP\\Novos\\SAP.xls C:\\Ficheiros\\SAP\\Novos\\SAP.csv");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
/
And here is the procedure that calls the Java class:
create or replace
procedure run_os_command
as language java
name 'OSCommand.Run()';
Can anyone help?
Thanks,
André