저는 pl/sql 배열에 PHP 변수를 바인딩하려고합니다. pl/sql 프로시 저는 수동으로 실행하고 바인드를 설정할 때 잘 작동하므로 문제는 아닙니다. 문제를 일으키는 것은 oci_bind_array_by_name
입니다.PHP의 OCI8/Oracle oci_bind_array_by_name이 저에게 맞지 않는 이유는 무엇입니까?
Warning: oci_bind_array_by_name() [function.oci-bind-array-by-name]: You must provide max length value for empty arrays
나는의 최대 길이 (250)를 제공 사실이기 때문에 나는 혼란 스러워요 :
나는 내가 oci_bind_array_by_name
함수를 호출 할 경우 아래의 PHP 코드의 라인에 대한 다음과 같은 오류 메시지가 문서 당 함수 호출 :
http://php.net/manual/en/function.oci-bind-array-by-name.php 내가 사용하고 여기에 PHP 5.1.6
는 관련 PHP 코드
$SQL = "BEGIN MYPKG.PROCESS_USERS(:USER_ID_ARRAY); END;";
$conn = self::getConnection();
$stmt = OCIParse($conn, $SQL);
$userIdArray= array(); /*I've also tried not initializing the OUT array (same error)
If I put some dummy value into the $userIdArray the procedure will run fine, but the results afterward will contain only that dummy value and not the output of the procedure*/
oci_bind_array_by_name($stmt,'USER_ID_ARRAY', $userIdArray, 250, -1, SQLT_VCS);
나는 패키지에 정의 된 배열 유형이 있습니다
TYPE USER_ID_ARRAY IS TABLE OF VARCHAR2(250) INDEX BY BINARY_INTEGER;
The PROCESS_USERS function in an abbreviated form:
PROCEDURE PROCESS_USERS(p_userIdArray out USER_ID_ARRAY) AS
--Code here which processes all waiting users and returns their IDs in p_userIdArray
END PROCESS USERS;