比如:在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)
);
请问怎么实现?
谢谢! 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)
);
解决方案 »
- 只有数据文件,如何恢复
- 请教一个select语句的条件写法
- 怎样跟踪oracle里面的函数呢?
- 求两个时间点之间的工作日天数
- 急啊!!!!引号内的字符串没有正确结束
- 出错:ORA-12154: TNS:could not resolve service name wrydao(一刀)兄具体怎么解决的,急
- 菜鸟求教!
- 我在2003下ASP.NET应用下连oracle92然后报System.Data.OracleClient requires Oracle client software version 8.1.7 or greater这个错,
- 在VC++用ADO,求连接远程ORACLE数据库的连接字符串?
- 开贴讨论命令行操纵Oracle数据库脚本集锦,跟贴有分
- 这样的想法能实现吗?
- 如何取出oracle中某个表的数据结构,也就是所有列名,并放到一个dataset or datatable中?
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;
/