比如:在Oracle中的存储过程中定义记录,需要在jdbc从调用的时候传入记录
请问怎么实现?
谢谢!   TYPE createpara IS RECORD (
      ibktablename   VARCHAR2 (30),                        /** 后台表名   **/
      ifttablename   VARCHAR2 (30),                        /** 前台表名   **/
      inetype        NUMBER (10),                          /** 格式 1+2+3 **/
      imoduletype    NUMBER (10),                          /** 格式 1+2+3 **/
      crttab         VARCHAR2 (32767),
      ikind          NUMBER (3)
   );

解决方案 »

  1.   

    在程序中执行正常的sql会吧,一样的道理,call(pro,pars1,par2...),就完了
      

  2.   

    Using Records as Procedure Parameters and Function Return Values
    Records are easy to process using stored procedures because you can pass just one parameter, instead of a separate parameter for each field. For example, you might fetch a table row from the EMPLOYEES table into a record, then pass that row as a parameter to a function that computed that employee's vacation allowance or some other abstract value. The function could access all the information about that employee by referring to the fields in the record.The next example shows how to return a record from a function. To make the record type visible across multiple stored functions and stored procedures, declare the record type in a package specification.Example 5-44 Returning a Record from a FunctionDECLARE
       TYPE EmpRecTyp IS RECORD (
         emp_id       NUMBER(6),
         salary       NUMBER(8,2));
       CURSOR desc_salary RETURN EmpRecTyp IS
          SELECT employee_id, salary FROM employees ORDER BY salary DESC;
       emp_rec     EmpRecTyp;
       FUNCTION nth_highest_salary (n INTEGER) RETURN EmpRecTyp IS
       BEGIN
          OPEN desc_salary;
          FOR i IN 1..n LOOP
             FETCH desc_salary INTO emp_rec;
          END LOOP;
          CLOSE desc_salary;
          RETURN emp_rec;
       END nth_highest_salary;
    BEGIN
       NULL;
    END;
    /Like scalar variables, user-defined records can be declared as the formal parameters of procedures and functions:Example 5-45 Using a Record as Parameter to a ProcedureDECLARE
       TYPE EmpRecTyp IS RECORD (
          emp_id       NUMBER(6),
          emp_sal      NUMBER(8,2) );
       PROCEDURE raise_salary (emp_info EmpRecTyp) IS
       BEGIN
          UPDATE employees SET salary = salary + salary * .10
                 WHERE employee_id = emp_info.emp_id;
       END raise_salary;
    BEGIN
       NULL;
    END;
    /