Running a Bat file from a stored procedure

This is part II of Re: Need to run bat file from application express
I thought I would open a new thread
I thought I had this fiqured out but it still doesn't work
1) I granted CREATE EXTERNAL JOB to my user
2) startup the OracleJobScheduler Service
3)
create or replace
PROCEDURE RUN_OS_COMMAND(p_cmd IN varchar2)
is
v_job_exists pls_integer:=0;
begin
  select count(1)
  into  v_job_exists
  from  all_scheduler_jobs
  where job_name='JAVA_EXE';
  if v_job_exists>0 then 
    dbms_scheduler.drop_job(job_name =>'JAVA_EXE');
  end if;
  dbms_scheduler.create_job
  (   job_name          =>'JAVA_EXE'
    , job_action        =>p_cmd
    , job_type          =>'executable'
    , enabled           =>false
    , auto_drop         =>false
    , start_date        =>systimestamp
  dbms_scheduler.run_job(job_name =>'JAVA_EXE');
end;test.bat is del test.csv
I run this
begin
  RUN_OS_COMMAND('C:\temp\test.bat');
end;
/ anonymous block completed
It runs with no errors but does not run the bat file... what am i missing, thanks Doug

LLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\wblincoe\Application Data
CLASSPATH=.;[ORACLE_HOME]\jdbc\lib\ojdbc6.jar;c:\myjar\xdocore.jar;c:\myjar\i18nAPI_v3.jar;c:\myjar\xdoparser.jar;c:\myjar\xmlparserv2.jar
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=WBLINCOELT
ComSpec=C:\WINDOWS\system32\cmd.exe
DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\wblincoe
LDMS_LOCAL_DIR=C:\Program Files\LANDesk\LDClient\Data
LOGONSERVER=\\03N-DAYT-DC01
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\OraHome_1\jre\1.4.2\bin\client;C:\OraHome_1\jre\1.4.2\bin;C:\app\wblincoe\product\11.1.0\db_1\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PERL5LIB=C:\oracle\product\10.2.0\http_1\sysman\admin\scripts;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1\lib;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1;C:\oracle\product\10.2.0\http_1\perl\5.6.1\lib\MSWin32-x86;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1\MSWin32-x86;
PHPRC=C:\Program Files\PHP\
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f02
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
TMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
USERDNSDOMAIN=CACI.COM
USERDOMAIN=CACI
USERNAME=wblincoe
USERPROFILE=C:\Documents and Settings\wblincoe
VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
windir=C:\WINDOWS

Similar Messages

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • Running ".sh" file from a stored procedure

    Hi,
    I need to call a file.sh linux bat file whit arguments from a stored procedure.
    How can I do?
    Thanks in advance...

    Hi rajni,
    I've tryed your solution but it doesn't work, for the same reason that yuo can see here:
    Re: questions about dbms_scheduler.create_job (ORA-27371)
    I've also tryed the solution of the "user534897", but it doesn't work too.
    At execution time Oracle give me this error:
    ORA-29540: class djv_osCommand does not exist
    ORA-06512: at "CICCSV.DPK_OSCOMMAND", line 5
    ORA-06512: at "CICCSV.DPK_OSCOMMAND", line 28
    ORA-06512: at "CICCSV.DFN_mkdir", line 5
    ORA-06512: at line 8
    If you have any other idea or suggestion you're welcome. At the moment I've no solution for my problem.
    Thanks in advance.

  • Trying to run a bat file from oracle

    I have followed these steps, see bottom for results, everything is valid but the bat file does not run???? PLease need your help. Doug
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "getbatx" AS
    class getbatx //class pdfopen
    public static void execmd(String c) //main function
    try
    System.out.println("Executing:" + c);
    Runtime.getRuntime().exec("C:\\WINDOWS\\system32
    cmd.exe /c "+c);
    System.out.println("Executing:" + c + " ...done");
    } catch (Exception e) //catch any exceptions here
    System.out.println("Error" + e ); //print the error
    CREATE OR REPLACE PROCEDURE host_command2 (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'getbatx.execmd (java.lang.String)';
    /Then as sysdba I put in in the following.
    exec dbms_java.grant_permission( 'CAPRS', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' );
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');Then I make the call.
    SET SERVEROUTPUT ON SIZE 1000000
    CALL DBMS_JAVA.SET_OUTPUT(1000000);
    BEGIN
    host_command2 (p_command => 'c:\mybook.bat');
    END;
    /***** I run this, it completes but does not run the bat file and there is no error message
    SQL> BEGIN
    2 host_command2 (p_command => 'mybook.bat');
    3 END;
    4 /
    Executing:mybook.bat
    Executing:mybook.bat ...done
    PL/SQL procedure successfully completed.

    Yes it should open a dos box, but you forgot to add the .bat file witch you like to run: String[] command = {"cmd", "/c", "start", "c:/Batch files/Cardiobackup/cardiobackup_v1.4"}

  • Accessing files from Java Stored Procedures

    I am trying to access a file from a Java Stored Procedure but get the exception: "no such file or directory". The path and filename as seen by the database JVM is "\\wgcaub01\a1500is\fabi\mmv\mmvtestdata.txt".
    I have granted permissions to open the file using:
    call dbms_java.grant_permission('MMV', 'java.io.FilePermission', '\\\\wgcaub01\\a1500is\\fabi\\mmv\\mmvtestdata.txt', 'read');
    a) When I run the program as a Java class using a main method it works so the problem has to do with the Oracle JVM not finding the file.
    b) The MMV user has permissions on the file after granting them using the above dbms_java.grant_permission command.
    Can you tell me what am I missing? Is this a database configuration issue? Is there a problem with using a UNC path?
    (I am using FileReader and BufferedReader.)

    Vincent,
    Not sure if this is the cause of your problem, but I had some Java code which read from/wrote to a file, and I needed to run the following (you can obviously change <<ALL FILES>> to something more restrictive):
    declare
    security_key number;
    begin
    dbms_java.grant_permission('DAN', 'java.io.FilePermission', '<<ALL FILES>>', 'read,write,execute,delete', security_key);
    dbms_java.grant_permission('DAN', 'java.lang.RuntimePermission', 'writeFileDescriptor', NULL, security_key);
    dbms_java.grant_permission('DAN', 'java.lang.RuntimePermission', 'readFileDescriptor', NULL, security_key);
    end;
    Note that the security_key won't be set if the grant didn't work.
    Hope this helps,
    -Dan
    http://www.compuware.com/products/numega/dbpartner/dbpordebug.htm
    Debug PL/SQL and Java in the Oracle Database

  • How can I run a .bat file from an html/javascript adobe air installation package?

    I write an html/javascript code which works completely true
    but when I made the installation package by air-sdk
    it dosent work properly
    my code is:
    <html>
    <head>
        <title>Hello World</title>
              <script type="text/javascript">
            function appLoad() {
                air.trace("Hello World");
        </script>
    </head>
    <body onLoad="appLoad()">
        <h1>Hello World</h1>
              <br />
    <button onclick="window.open('file:///C:/Windows/notepad.exe')"> Launch notepad </button>
    <button onclick="window.open('file:///D:/opennotepad.bat')"> Launch batnote </button>
    </body>
    </html>
    Chapter 5: Creating your first HTML-based AIR application with the AIR SDK

    Seems to be security violation. You can't execute bat or cmd

  • How can I write to a (external)file from a stored procedure

    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

    an extraction out of expert one-on-one from Thomas Kyte
    <quote>
    when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
    To change the default logon for the Oracle services go to (in Windows NT):
    Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
    In Windows 2000, this would be:
    Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
    Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
    * Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
    * Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
    You will of course need to stop and restart Oracle after changing the properties of the service.
    <\quote>
    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

  • Running .bat files from java applications

    Has anyone tried to run a .bat file from a java application?
    I know I can run java commands by getting the application's runtime, but I've a number of *.bat files I like to run from the application without having to extract the commands from the .bat files.
    thks,

    Crikey! You were answered very shortly after you posted your question, and you STILL haven't bothered to come back. And are you going to create a new userid the next time you ask a question, since bat2004 seems tied to this particular question?

  • Execute .Bat file from pl/sql code

    Hi,
    Can you please let me know that how can I execute the .Bat file from pl/sql procedure? Does anybody have a sample code??
    Thanks.

    Hi
    This may help you
    http://www.dba-oracle.com/t_running_windows_bat_file_dbms_scheduler.htm
    br,Jari

  • Running bat files from JDeveloper

    hi
    Sometimes it could be convenient to run a bat file directly from JDeveloper.
    For example, the application in SQLAuthenticatorApp-v0.02.zip (see also forum thread "how to disable (or lock) users") has an Ant file BuildStuff/build-wlst.xml which has targets like "wlst.create-domain" and "create.wls-start-stop-bat-files", the last one resulting in some bat files which I have been able to configure to run from JDeveloper,
    see http://www.consideringred.com/files/oracle/img/2011/run-using-cmd-20110529.png
    The External Tool cmd configuration I use is shown in the screenshot
    at http://www.consideringred.com/files/oracle/img/2011/external-tool-cmd-20110529.png
    See also the blog post by John 'JB' Brock
    at http://blogs.oracle.com/jdevextensions/entry/how_to_extend_jdeveloper_without_writing_code
    - (q1) How can I configure the External Tool cmd to run in its own cmd (command) window outside JDeveloper?
    many thanks
    Jan Vervecken

    Hi Jan,
    It looks like this is going to be a bug from what I can see. After looking at it a little more this morning, not only does it not display the cmd window, but if you use the /k argument, it leaves the script running in memory. Look at your Task Manager after running a few times with /k
    I'll file a bug, and see if anyone has a work around or something that I missed.
    For now, it would appear this is not possible, and you will just have to see the result in the log window. I would not use /k as well. Stick with /c for now.
    Sorry for the inconvenience.
    --jb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Running bat-files from Java

    Hello,
    I have been trying to launch a bat-file from my Java code, running under windows, but with no success.
    Here is my simple code:
    Runtime.getRuntime().exec(new String[] {
             "C:\\temp\\test.bat"
          });This does nothing at all and generates no exception. Any suggestions?

    It seems java has a real problem with this... if you
    want to run another java program, for instance, you
    cannot do that either with String cmd="cmd.exe /C
    java myProgram"
    I need to pass parameters from one program into the
    program I'm going to open using java, that is why I
    need to call it from my first program. It can open
    executables and shortcuts, but has a real big problem
    doing things with the command line.No it doesn't have a problem with it. You just must be doing something wrong. By the way, since "java(.exe)" is already an executable, there's little value in wrapping that by the "cmd.exe" shell (unless you want to use the command shell for some reason such as passing the redirector (>) symbols to it to let it redirect stdout / stderr to a file)

  • Running .bat files from java code

    Dear Forum,
    I have seen numerous postings on the web about this question, still I have found no answer that works (for me)
    I�m trying to run a simple .bat file from a piece of java code , however it does not work. No error message , but still.
    Does anyone have a tip?
    best regards
    temuj
    try{
                String cmd = "cmd.exe C:\\mybat.bat";
                Runtime.getRuntime().exec(cmd);
    catch(IOException e){System.out.println("ERROR: "+e);}Message was edited by:
    temujin

    "cmd.exe C:\mybat.bat" is being passed to the OS for execution
    what happens when in a terminal/dos window you execute letter for letter:
    cmd.exe C:\mybat.bat
    The output will be identical to what is happening when java makes this call.

  • Run .bat file from Flex

    Hi,
    I'd like to execute a .bat file from Flex. I thought this piece of code should work but no luck
    fscommand("Exec", "C:\\Sandbox\\doSomething.bat");
    Can someone please point me in the right direction?
    Thanks in advance,

    Sandbox does not allow external apps to be run in Flex apps. AIR 2.0 may have this.
    If this post answered your question or helped, please mark it as such.

  • Call a Vbscript from a stored procedure

    Hi,
    I wonder is it possible to call a Vbscript from a stored procedure, any good reference for this.
    thanks

    Well here is quick and dirty example I just created.
    Step 1. Create a test_batch.bat file that creates a folder "c:\test_dir" and copy "c:emp.lst" into it.
    C:\oracle102\examples\test_batch.bat
    md c:\test_dir
    copy c:\emp.lst c:\test_dir
    Step2. From SQLPLUS, spool scott.emp into c:\emp.lst and call the batch from the dbms_scheduler that kicks off right away,
    set echo off
    set feedback off
    spool c:\emp.lst;
    select * from scott.emp;
    spool off;
    begin
         dbms_scheduler.create_job(job_name => 'run_batch',
         job_type => 'EXECUTABLE',
         job_action => 'C:\oracle102\examples\test_batch.bat',
         start_date => sysdate,
         enabled => true,
         comments => 'Run VB Script');
    end;
    Check if the directory is created and if the file is copied over. Task is to kick off the executable and test is the VBscript within the batch. Challenge is how long the script runs before the next statement in the PL/SQL runs. May be you have to introduce sleep in between.
    Note: You must have at least "CREATE JOB" privilege.
    Happy coding!
    Prakash
    Message was edited by:
    Prakash Rai

  • File Uploads using stored procedures

    Hello, I'm quite new here, but I have a question that I've been butting my head against for the past day. Here goes.
    We need to upload a file using a stored procedure (PL/SQL procedure.)
    The two things I have found that work are
    1) Having oracle do the file handling (using bfiles) in the procedure
    2) using an insert statement directly to upload the file contents into a blob.
    The platform is php (Oracle instant client) and I will show some code examples.
    1) is unworkable because Oracle will not have direct access to any files.
    2) is fine, but we would prefer to use a procedure so as to abstract what exactly goes on and possibly other operations away from the php and the framework.
    What worked:
    1)
    CREATE OR REPLACE PROCEDURE php_upload_file (file_name in varchar2, canonical_name in varchar2, owner in number, file_id IN OUT number)
    AS
    src_loc bfile:= bfilename('DOC_LOC',php_upload_file.file_name);
    dest_loc BLOB;
    begin
    insert into files values(owner,canonical_name,empty_blob(),files_seq.nextval) returning files.data, files.file_id
    into dest_loc, file_id;
    dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(
    dest_lob => dest_loc
    ,src_lob => src_loc
    ,amount => DBMS_LOB.getLength(src_loc));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    COMMIT;
    end;
    'DOC_LOC' is a directory I've set up that the user has access to.
    Interfacing with PHP this just looks like
    oci_parse($conn,"BEGIN php_upload_file('{$uploadfilename}','{$propername}',{$ownerid},:file_id); END;");
    Dead simple, right?
    I also do a bind command to pull out 'file_id' so I know the id that was just inserted.
    The other solution is
    $contents = file_get_contents($_FILES["uploadedfile"]["tmp_name"]);
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
    $stmt = oci_parse($conn,
    "INSERT INTO files (employee_id, filename, data, file_id) VALUES(175,'"
    .$_FILES["uploadedfile"]["name"].
    "', empty_blob(), files_seq.nextval) RETURNING file_id, files.data INTO :file_id, :src_contents");
    where :src_contents is binded to a lob and :file_id as before is binded to an INT:
    oci_bind_by_name($stmt, ':src_contents', $lob, -1, OCI_B_BLOB);
    oci_bind_by_name($stmt, ':file_id', $insert_id, -1, SQLT_INT);
    oci_execute($stmt,OCI_DEFAULT);
    In this case the last thing I do before the commit is
    $lob->save($contents);
    Both work fine, but what I need is this
    $contents = file_get_contents($_FILES["uploadedfile"]["tmp_name"]);
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
    $stmt = oci_parse($conn,"BEGIN do_upload_file(:src_contents,'{$propername}',{$ownerid},:file_id); END;");
    oci_bind_by_name($stmt, ':src_contents', $lob, -1, OCI_B_BLOB);
    oci_bind_by_name($stmt, ':file_id', $insert_id, -1, SQLT_INT);
    oci_execute($stmt,OCI_DEFAULT);
    $lob->save($contents);
    oci_commit($conn);
    this omits error conditions (such as on $lob->save ... etc.) it is simplified.
    The content of the procedure I changed as follows, but it seems untestable.
    CREATE OR REPLACE PROCEDURE do_upload_file (src_contents IN OUT blob, canonical_name in varchar2, owner in number, file_id IN OUT number)
    AS
    dest_loc BLOB;
    begin
    insert into files values(owner,canonical_name,empty_blob(),files_seq.nextval) returning files.data, files.file_id
    into dest_loc, file_id;
    dbms_lob.open(src_contents,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.COPY(dest_lob => dest_loc,
    src_lob => src_contents
    ,amount => DBMS_LOB.getLength(src_contents));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_contents);
    COMMIT;
    end;
    I don't get errors because I cannot figure out a way to run this procedure in my PL/SQL environment with valid data. (I can run it with a blank blob.)
    But when I work out the order of what's going on, it doesn't make sense; the commit in the procedure is before the $lob->save(...) and thus it would never save the data... nonetheless it should at least create a record with an empty blob but it does not. What is wrong is beyond the error level that seems to be supported by PHP's oci_error function (unless I have not discovered how to turn all errors on?)
    In any case I think the logic is wrong here, but I'm not experienced enough to figure out how.
    To test it I would need to create a driver that loads an external file into a blob, and passes that blob into the procedure. Trouble is, even if I make a blob and initialize it with empty_blob() it treats it as an invalid blob for the purposes of the dbms_lob.copy procedure.
    If someone has solved this problem, please let me know. I would love to be able to do the file upload with just a single procedure.

    Thanks. In my estimation that is exactly the issue. But that doesn't help with a resolution.
    The actual file size: 945,991 bytes
    If Firefox is miscalculating the length (in Safari/Chrome 945991 and 946241 in Firefox), then Firefox is reporting erroneously and should be raised as a bug in Firefox, would you agree?

Maybe you are looking for