2.4 Data Access Application Block: Default Oracle cursor cur_OUT
The managed provider for Oracle requires you to explicitly bind your reference cursor in your parameter collection. This means you must explicitly create an output parameter for the cursor in your application code. However, that code will not be portable with database systems that do not require a parameter for the cursor. The OracleDatabase allows you to create commands without specifying a cursor. It will create a cursor, named cur_OUT, for commands that execute a stored procedure and do not include an output parameter for the cursor. This means that you can name your reference cursor as "cur_OUT" and the Data Access Application Block will bind it for you; you do not need to explicitly create an output parameter for the cursor. If your stored procedures use a cursor with a name other than "cur_OUT," you must explicitly add a parameter for each cursor to the command. Similarly, if your stored procedure contains multiple cursors, you must explicitly add each cursor parameter to the command. 这下我就明白了。在我的oracle函数中,我的名字 cur_Static_User 和默认的名字cur_OUT不匹配。
Procedure STATIC_USER_SelectAll ( cur_OUT_f OUT T_OUT, cur_OUT_g OUT T_OUT) AS Begin OPEN cur_OUT_f FORSelect*from STATIC_USER; OPEN cur_OUT_g FORSelect*from STATIC_ROLE; End;
Procedure STATIC_USER_SelectAll ( cur_OUT_f OUT T_OUT, cur_OUT_g OUT T_OUT) AS Begin OPEN cur_OUT_f FORSelect*from STATIC_USER; OPEN cur_OUT_g FORSelect*from STATIC_ROLE; End;
Procedure STATIC_USER_SelectAll ( cur_OUT_f OUT T_OUT, cur_OUT_g OUT T_OUT) AS Begin OPEN cur_OUT_f FORSelect*from STATIC_USER; OPEN cur_OUT_g FORSelect*from STATIC_ROLE; End;