php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1276 OCIBindByName with DATE variable -> error
Submitted: 1999-03-28 17:40 UTC Modified: 2006-07-17 08:43 UTC
From: steffenmail at writeme dot com Assigned: thies (profile)
Status: Closed Package: OCI8 related
PHP Version: 3.0.7 OS: SuSE linux 6.0
Private report: No CVE-ID: None
 [1999-03-28 17:40 UTC] steffenmail at writeme dot com
OK, the problem seems to appear when I try to insert an empty value into a table. When I do

OCIBindByName($stmt,":vorname",&$vorname, 20);

and $vorname is "" then PHP says:

Warning: OCIStmtExecute: ORA-01480: trailing null missing from STR bind value in /www/e-shirt.de/htdocs/bestellung4.phtml on line 80

How can I insert empty values? Or do I have to check on every value if it's empty?

Thanks in advance,
- Steffen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-04-06 07:59 UTC] thies
works for me -> try this code....
you should be able to insert empty columns using bound variables like shown below:

<?php
$conn = OCILogon("scott","tiger");

$stmt = OCIParse($conn,"insert into emp (empno, ename) ".
                       "values (:empno,:ename) ");

$data = array(1111 => "", 2222 => "Bill", 3333 => "Jim");

// "1111" has no user-name....

OCIBindByName($stmt,":empno",&$empno,10);
OCIBindByName($stmt,":ename",&$ename,6);


while (list($empno,$ename) = each($data)) {
    OCIExecute($stmt);


OCIFreeStatement($stmt);
OCILogoff($conn);
?>

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC