René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

Inserting in an Oracle table with a java procedure

create table some_tab (a number, b varchar2(10));

create or replace and compile java source named "InsTab"
as
import java.sql.*;

public class InsTab {
  public static void Go(oracle.sql.NUMBER p_a, String p_b) throws SQLException {
    #sql {
      insert into some_tab values(:p_a, :p_b)
    };
  }
}
/

show errors

create or replace procedure j_ins_tab(v_a in number, v_b in varchar2)
  as language java
    name 'InsTab.Go(oracle.sql.NUMBER, java.lang.String)';
/

show errors
   

begin
  j_ins_tab(10, 'ten');
  j_ins_tab(20, 'twenty');
  j_ins_tab(30, 'thirty');
end;
/
  
See also Java in Oracle