cubrid_lob2_bind
(PECL CUBRID >= 8.4.1)
cubrid_lob2_bind — 준비된 명령문에 lob 객체나 문자열을 매개변수로 바인딩
설명
cubrid_lob2_bind( resource $req_identifier, int $bind_index, mixed $bind_value, string $bind_value_type = ? ): bool
cubrid_lob2_bind() 함수는 cubrid_prepare()에 전달된 SQL 문에서 해당하는 물음표 플레이스홀더에 BLOB/CLOB 데이터를 바인딩하는 데 사용된다. bind_value_type
이 지정되지 않은 경우 문자열은 기본값으로 "BLOB"이 됩니다. 그러나 이전에 cubrid_lob2_new()를 사용한 경우 bind_value_type
은 기본적으로 cubrid_lob2_new()type과 일치한다.
매개변수
req_identifier
- cubrid_prepare() 결과 요청 식별자.
bind_index
- 바인딩 매개변수의 위치입니다. 1부터 시작합니다.
bind_value
- 바인딩의 실제 값입니다.
bind_value_type
- "BLOB" 또는 "CLOB"이어야 하며 대소문자를 구분하지 않습니다. 지정하지 않으면 기본값은 "BLOB"입니다.
반환 값
성공하면 true
를, 실패하면 false
를 반환합니다.
Examples
예제 #1 cubrid_lob2_bind() 예제
<?php
// Table: test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
cubrid_execute($conn,"DROP TABLE if exists test_lob");
cubrid_execute($conn,"CREATE TABLE test_lob (id INT, contents CLOB)");
$req = cubrid_prepare($conn, "INSERT INTO test_lob VALUES (?, ?)");
cubrid_bind($req,1, 3);
$lob = cubrid_lob2_new($conn, 'CLOB');
cubrid_lob2_bind($req, 2, $lob);
cubrid_execute($req);
cubrid_bind($req, 1, 4);
cubrid_lob2_bind($req, 2, 'CUBRID LOB2 TEST', 'CLOB');
cubrid_execute($req);
cubrid_disconnect($conn);
?>
기타
- cubrid_lob2_new() - lob 객체 생성
- cubrid_lob2_close() - LOB 개체 닫기