Lorsque j'insère une ligne dans une table contenant plus de 1 000 entrées et que je tente de renvoyer l'ID de ligne (que ce soit à partir d'un déclencheur/seq autoincrément ou manuellement) Je reçois une valeur tronquée:oci_bind_by_name RETOURNER dans la valeur tronquée
$db = OCILogon(DATABASE_LOGIN, DATABASE_PASSWORD, DATABASE_NAME);
$mysqldate = date('Y/m/d G:i:s');
$db_vid_id = 748;
$authorID = 310;
$typeID = 2;
$timecode = 47;
$shortDescrip = "hello world";
$query = "INSERT INTO TESTTHOUSAND (ID, VIDEO_ID, AUTHOR_ID, TYPE_ID,
DATE_CREATED, TIMECODE, SHORT_DESCRIPTION, APPROVED, IS_PUBLIC)
VALUES(4067, :videoID, :authorID, :typeID, TO_DATE('$mysqldate','yyyy/mm/dd HH24:MI:SS'),
:timecode, :shortDescrip, 0, 0)
RETURNING ID INTO :id";
$stmt = oci_parse($db, $query);
oci_bind_by_name($stmt, ':videoID', $db_vid_id);
oci_bind_by_name($stmt, ':authorID', $authorID);
oci_bind_by_name($stmt, ':typeID', $typeID);
oci_bind_by_name($stmt, ':timecode', $timecode);
oci_bind_by_name($stmt, ':shortDescrip', $shortDescrip);
oci_bind_by_name($stmt, ':id', $theID);
oci_execute($stmt);
oci_free_statement($stmt);
oci_commit($db);
oci_close($db);
echo $theID;
Ce code s'exécute correctement et les valeurs sont correctement stockées dans la base de données. Cependant, la valeur de $theID
est 406, pas 4067.
Je cours PHP 5.2.6 et Oracle 10.1
Quelqu'un at-il rencontré avant?
+1 pour le suivi avec la réponse. – DCookie