目的
読み取るLOBをオープンします。
構文
tdr.LobOpen_CL(locator, start, maxlength)
- locator
- パラメータ型: integer
テーブルに格納されているLOBのロケータ。
- start
- パラメータ型: numeric
LOBのこの位置で読み取りを開始する。
- maxlength
- パラメータ型: numeric
読み取る最大バイト数。
戻り値
2つの要素、contextIDおよびLOBlenを含むリスト。このリストはLOBの読み取りに使用できます。
使用上の注意
この関数は、テーブル演算子から呼び出された場合にのみ有効です。
関数がコントラクト関数から呼び出された場合は、エラーが発生します。
例: 読み取りのためのLOBのオープン
5 つの属性(int、int、int、int、clob)を持つ入力テーブルを想定します。この例では、次のように現在行の最後の属性を読み取る方法を示します。
- LOBロケータを取得する
- LOBを開く
- LOBを読み取る
- LOBを閉じる
# Open the input stream
inHandle <- tdr.Open("R", 0, 0);
# Get the 5th attribute in the current row (LOB locator)
att5 <- tdr.GetAttributeByNdx(inHandle, 4, NULL);
# Open the LOB for reading
inlob <- tdr.LobOpen_CL(att5,0,0);
# Read the LOB, convert it to character, and print it
string <- tdr.LobRead(inlob$contextID, inlob$LOBlen);
print(rawToChar(string$buffer));
# Close the LOB
tdr.LobClose(inlob$contextID);