Results 1 to 2 of 2

Thread: [Resolved] ORA-01461 Error on ocibindbyname

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    [Resolved] ORA-01461 Error on ocibindbyname

    I'm kinda wondering why I'm getting this. I have this code and it works fine.

    Code:
    extract(get_object_vars($post));
    			$conn = OracleDaoFactory::createConnection();
    			$query = "insert into weblog_posts(title, excerpt, body, created_at)
    				values(:title, :excerpt, :body, :createdAt)";
    			$stmt = ociparse($conn, $query);
     
    			ocibindbyname($stmt, ':title', $title);
    			ocibindbyname($stmt, ':excerpt', $excerpt);
    			ocibindbyname($stmt, ':body', $body);
    			ocibindbyname($stmt, ':createdAt', $createdAt);
    			ociexecute($stmt) or die(ocierror());


    But this doesn't work.

    Code:
    extract(get_object_vars($post));
    			$conn = OracleDaoFactory::createConnection();
    			$query = "insert into weblog_posts(title, excerpt, body, created_at)
    				values(:title, :excerpt, :body, :createdAt)";
    			$stmt = ociparse($conn, $query);
    			oci_utility($stmt, array(':title' => $title, ':excerpt' => $excerpt, ':body' => $body, ':createdAt' => $createdAt));
    			ociexecute($stmt) or die(ocierror());


    When oci_utility is just a wrapper on binding

    Code:
    function oci_utility(&$stmt, $parameters = array()) {
    		foreach ($parameters as $name => $value) {
    			ocibindbyname($stmt, $name, $value);
    		}
    	}


    Any help is greatly appreciated. Thanks a lot.
    Last edited by nebulom; Mar 17th, 2008 at 10:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width