1

I have a procedure structure like this in an Oracle database:

procedure overlapping_course (
  v_id  number,
  v_program varchar2,
  v_message_type  varchar2,
  v_user_type varchar2,
  v_language  varchar2, 
  v_channel varchar2,
  v_country varchar2,
  v_start_date  date,
  v_end_date  date,
 v_return_val  out varchar2
 )

I am trying to call this procedure from Drupal 7 and I am following this link. My code looks like this:

 $conn = Database::getConnection();
 $saved_class = $conn->getAttribute(PDO::ATTR_STATEMENT_CLASS);
 $conn->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatement')); 
 $statement = $conn->prepare('call overlapping_course(?,?,?,?,?,?,?,?,?,?)');    

$statement->bindParam(1, $id,PDO::PARAM_INT);

$id=1;

$statement->bindParam(1, $program,PDO::PARAM_STRING);

$program='c++';
 -------
 --------

but I am always getting the following error

Fatal error: Call to undefined method DatabaseStatementPrefetch::bindParam()   in C:\Apache24\htdocs\drupal\includes\database\oracle\database.inc on line 655. 
1

I don't know the problem, but after adding the following piece of code in my database.ini of oracle directory and changing my calling method prepare('-----') to oraclePrepare('-------') I am able to access the stored procedure with parameters. I got the reference from here

Check for the oraclePrepare('-------') method in database.ini. If it is not there then add following lines in the DatabaseConnection_oracle class.

code Added in DatabaseConnection_oracle class of oracle's database.ini:

 public function oraclePrepare($query)
 {
     return parent::prepare($query);
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.