Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PHP and OCI-Lob::read from oracle clob

JakeMorganSep 18 2014 — edited Sep 22 2014

I'm having a weird problem with PHP and the OCI-Lob::read method.

We have a page that connects to the database and pulls all the other fields out with no problems. However, it when it comes to the clobs, only a small portion of the actual data is retrieved.

The code uses:

$content= $features[14]->read(2000); echo $content;

And we're getting a tiny section of the field returned (only about 185 out of a total 553 chars). The really strange thing is that no matter what the length specified is - it still only returns a small section - and the cut off seems to actually be 549 bytes/chars - anything below the read(length) specified as 549 shortens the returned string (even though what is returned is far less the 549 chars) but anything over 549 makes no difference.

Additionally, we've used the OCI-Lob::load method with exactly the same results where only a portion of the actual contents of the clob field is returned.

Any ideas what could be causing this?

PHP version is 5.1.6

RDBMS is 11.2.0.4.2

Following shows OCI config via phpinfo()

oci8

OCI8 Support

enabled

Revision

$Revision: 1.269.2.18 $

Active Persistent Connections

1

Active Connections

1

Oracle Instant Client Version

  1. 10.2

Temporary Lob support

enabled

Collections support

enabled

Directive

Local Value

Master Value

oci8.default_prefetch

10

10

oci8.max_persistent

-1

-1

oci8.old_oci_close_semantics

0

0

oci8.persistent_timeout

60

60

oci8.ping_interval

60

60

oci8.privileged_connect

Off

Off

oci8.statement_cache_size

20

20

This post has been answered by JakeMorgan on Sep 22 2014
Jump to Answer

Comments

Timo Hahn
Answer

You can download the jdk doc from https://www.oracle.com/java/technologies/javase-jdk8-doc-downloads.html
Put the zip file somewhere local on your machine. Then open JDeveloper and select the menu tools->'manage libraries'. There you select the 'Java SE definition' tab and select the JDK version you are using
image.pngclick on the 'Doc Path' and select 'Add Entry' button. In the file dialog that opens, you go to the directory where you put the zip file and open it and select the 'docs/api' folder. Then save everything and restart JDev.
Then you'll get the javadoc you are missing.

Timo

Marked as Answer by ChristianM0147 · Jul 9 2021
ChristianM0147

Unfortunately it did not work. I did exactly what you described.
image.pngBut it seems that it has no effect.
image.pngDo you know what i may be missing?
Kind Regards

Timo Hahn

Well, you are looking at the code for the method and not the documentation. Select the 'Documentation' tab below the 'Element has no details' and you see the javadoc.
image.png
If you want to see the code you can download the jdk source and add the zip to the source path (in the manage libraries) where you added the path to the docs.

Timo

ChristianM0147

Oh... My bad. Thank you very much!

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 20 2014
Added on Sep 18 2014
3 comments
2,417 views