oracle|函數|資料 PL/SQL 代碼:
CREATE OR REPLACE PACKAGE "SCOTT"."PKG_TEST" AS
TYPE myrcType IS REF CURSOR;
FUNCTION get(strbarcode VARCHAR) RETURN myrcType;
END pkg_test;
CREATE OR REPLACE PACKAGE BODY "SCOTT"."PKG_TEST" AS
FUNCTION get(strbarcode IN VARCHAR) RETURN myrcType IS
rc myrcType;
BEGIN
OPEN rc FOR strbarcode;
RETURN rc;
END get;
END pkg_test;
--------------------------------------------------------------------------------------------------------
VB 代碼:
Private Sub Command1_Click()
On Error GoTo cursorErr:
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim cmd As New ADODB.Command