適用対象
説明
指定したパラメータのステータスを示す整数を戻します。設計時には使用できません。実行時は読取り専用です。
使用方法
parameter_status = oraparameter.Statusparameter_status = oraparamarray.Status
データ型
Integer
備考
Statusプロパティは、それぞれがパラメータについての情報を提供する一連のビットとして解析されます。パラメータは、有効な場合にのみバインドでき、自動的な有効化によってのみ有効にできます。
パラメータのStatusプロパティのビット値は、次のとおりです。
| 定数 | 値 | 説明 |
|---|---|---|
ORAPSTAT_INPUT |
&H1& |
入力パラメータとして使用可能。 |
ORAPSTAT_OUTPUT |
&H2& |
出力パラメータとして使用可能。 |
ORAPSTAT_AUTOENABLE |
&H4& |
自動バインド可能。 |
ORAPSTAT_ENABLE |
&H8& |
使用可能。このビットは常に設定されています。 |
これらの値は、ORACLE_BASE\\ORACLE_HOME\oo4o\oraconst.txtファイルにあります。
例
この例では、パラメータとExecuteSQLメソッドを使用して、(ORAEXAMP.SQLにある)ストアド・プロシージャをコールする方法を示します。ストアド・プロシージャをコールした後、各パラメータのStatusプロパティをチェックします。このコードをコピーして、フォームの定義セクションに貼り付けてください。次に[F5]を押します。
Sub Form_Load ()
'Declare variables as OLE Objects.
Dim OraSession As OraSession
Dim OraDatabase As OraDatabase
Dim OraDynaset As OraDynaset
'Create the OraSession Object.
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
'Create the OraDatabase Object by opening a connection to Oracle.
Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "scott/tiger", 0&)
'Add EMPNO as an Input parameter and set its initial value.
OraDatabase.Parameters.Add "EMPNO", 7369, ORAPARM_INPUT
'Add ENAME as an Output parameter and set its initial value.
OraDatabase.Parameters.Add "ENAME", 0, ORAPARM_OUTPUT
'Execute the Stored Procedure Employee.GetEmpName to retrieve ENAME.
' This Stored Procedure is located in the file ORAEXAMP.SQL.
OraDatabase.ExecuteSQL ("Begin Employee.GetEmpName (:EMPNO, :ENAME); end;")
If OraDatabase.Parameters("EMPNO").Status & ORAPSTAT_INPUT Then
MsgBox "Parameter EMPNO used for input."
End If
If OraDatabase.Parameters("ENAME").Status & ORAPSTAT_OUTPUT Then
MsgBox "Parameter ENAME used for output."
End If
'Display the employee number and name.
MsgBox OraDatabase.Parameters("EMPNO").value
MsgBox OraDatabase.Parameters("ENAME").value
'Remove the Parameters.
OraDatabase.Parameters.Remove "EMPNO"
OraDatabase.Parameters.Remove "ENAME"
End Sub