Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3243050
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:23:14+00:00 2026-05-17T18:23:14+00:00

Catchable fatal error: Object of class OCI-Collection could not be converted to string in

  • 0

Catchable fatal error: Object of class OCI-Collection could not be converted to string in E:\php\htdocs\PHPRPC\func.php on line 318

The code:

$sql='BEGIN NCCM_INTERFACE_HISDETAIL(:orgcode,:inhiscode,:inputer,:items); END;';
$conn=oci_connect('chis','chis123','ORCL','UTF8');
$stmt = oci_parse($conn, $sql);
$collection = oci_new_collection($conn,"NCCM_INTERFACE_TABLE");
foreach ($items as $item)
{
    $collection->append($item);
}
oci_bind_by_name($stmt, ":orgcode", $orgcode, -1);
oci_bind_by_name($stmt, ":inhiscode", $inhiscode, -1);
oci_bind_by_name($stmt, ":inputer", $inputer, -1);
oci_bind_by_name($stmt, ":items", $collection,-1); //here the error line
$s=oci_execute($stmt);

Can anyone help me to sort out this issue? Thanks in Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:23:15+00:00Added an answer on May 17, 2026 at 6:23 pm

    The issue is you are binding a collection object while Oracle expects the bound type to be SQLT_CHR, e.g. a VARCHAR. Thus, Oracle will try to use the bound object in a string context, which is not possible because the collection apparently has no __toString method implemented. Hence you get the error that the object could not be converted to string.

    I am not sure on this, but try to supply a different type in the binding call, for instance:

    oci_bind_by_name($stmt, ":items", $collection,-1, OCI_B_NTY);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error sometimes, Catchable fatal error: Object of class stdClass could not
I keep getting this error: Catchable fatal error: Object of class DateTime could not
Why am I getting this error: Catchable fatal error: Object of class Card could
So, I'm having this weird error: Catchable fatal error: Object of class Template_Standard could
Possible Duplicate: PHP ToString() equivalent I get this error: Catchable fatal error: Object of
I have a really odd error: [04-Jun-2010 15:55:32] PHP Catchable fatal error: Object of
I dont know why but I get this error : Catchable fatal error: Object
In my Zend Framework application I'm getting this error: Catchable fatal error: Object of
I'm using prepared statements and MySQLi, and am currently getting this error. PHP Catchable
i'm trying to diff two arrays and php is returning the following error: Catchable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.