Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 442 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
View select queries produce no results

I followed the "Using PHP OCI8 and Oracle" instruction on Installing PHP and the Oracle 11g Instant Client for Linux and Windows. It works perfectly.
I selected my own table:
$stid = oci_parse($conn, 'select * from person');
and all my table rows appeared.
I then created a view from that table, and selected it:
$stid = oci_parse($conn, 'select * from vw_person');
The query executed without errors, but no rows have appeared.
The views displays a few rows when I query it in the SQL Command Line.
I tried: changing the spelling and adding "/" but just got ORA errors. Which means the connection is sound.
I changed it back, even tried selecting one column, but no errors appeared nor any rows.
help?
Answers
-
It's funny that the day before, I get stumped by a problem the whole day... then the next day I find the answer to my problem.
The view is actually working. but the last record is not appearing. This is the same for my tables. no last record.
I get 3 rows in the table in the SQL Command Line.
I get 2 rows in the view in the SQL Command Line.
I get 2 rows in the table in the PHP Web page.
I get 1 row in the view in the PHP Web page.
I have only changed the select statement, the rest of the code is the same.
help?
-
OK, I have just figured it out.
Oracle 11g XE allows for one session. Connecting to Oracle through PHP counts as a session.
Disconnecting the console fixed the problem.
-
You can have more than one session at a time to XE. At a guess, you hadn't committed in the first session and disconnecting performed the commit for you. This let the other session see the data.