共用方式為


OracleLob.IsTemporary 屬性

定義

取得值,指出 OracleLob 是否為暫時 LOB

public:
 property bool IsTemporary { bool get(); };
public bool IsTemporary { get; }
member this.IsTemporary : bool
Public ReadOnly Property IsTemporary As Boolean

屬性值

如果 OracleLob 為暫時 true,則為 LOB,否則為 false

例外狀況

連接關閉。

物件已關閉或處置。

發生 Oracle 錯誤。

備註

下列範例示範如何建立暫時的 LOB

OracleConnection connection = new OracleConnection("server=MyServer; integrated security=yes;");
connection.Open();
OracleTransaction transaction = connection.BeginTransaction();
OracleCommand command = connection.CreateCommand();
command.Transaction = transaction;
command.CommandText = "declare xx blob; begin dbms_lob.createtemporary(xx, false, 0); :tempblob := xx; end;";
command.Parameters.Add(new OracleParameter("tempblob", OracleType.Blob)).Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
OracleLob tempLob = (OracleLob)command.Parameters[0].Value;
tempLob.BeginBatch(OracleLobOpenMode.ReadWrite);
tempLob.Write(tempbuff,0,tempbuff.Length);
tempLob.EndBatch();
command.Parameters.Clear();
command.CommandText = "MyTable.MyProc";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new OracleParameter("ImportDoc", OracleType.Blob)).Value = tempLob;
command.ExecuteNonQuery();
transaction.Commit();
connection.Close

適用於