473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Oracle/PHP problem

Cross-posted to comp.databases.oracle.misc and comp.lang.php ...

Using PHP 4.3.11 on Linux and ADODB data abstraction library.

Oracle client version is 10.1.

Can successfully connect to remote database (version 9.2.0.6 on Linux
NLS_LANG=AL32UTF8).

When doing a simple select from a view:
select RTS_LOAD from VW_R_PROJECTED_LOAD_OUTPUT
I get the error message:
ociexecute(): OCIStmtExecute: ORA-01858: a non-numeric character was found
where a numeric was expected in adodb/461/drivers/adodb-oci8.inc.php on
line 942
1858: ORA-01858: a non-numeric character was found where a numeric was
expected

This happens even if I just select count(*) from the view.

Using SQLPlus from the web server I don't have any problems at all
selecting from the view, so it is definitely valid.

If in my PHP script I directly query the underlying table that this Oracle
view is based on, I have no problem.

Any clues?

Geoff M
Feb 28 '06 #1
3 2628
Geoff Muldoon wrote:
Cross-posted to comp.databases.oracle.misc and comp.lang.php ...

Using PHP 4.3.11 on Linux and ADODB data abstraction library.

Oracle client version is 10.1.

Can successfully connect to remote database (version 9.2.0.6 on Linux
NLS_LANG=AL32UTF8).

When doing a simple select from a view:
select RTS_LOAD from VW_R_PROJECTED_LOAD_OUTPUT
I get the error message:
ociexecute(): OCIStmtExecute: ORA-01858: a non-numeric character was found
where a numeric was expected in adodb/461/drivers/adodb-oci8.inc.php on
line 942
1858: ORA-01858: a non-numeric character was found where a numeric was
expected

This happens even if I just select count(*) from the view.

Using SQLPlus from the web server I don't have any problems at all
selecting from the view, so it is definitely valid.

If in my PHP script I directly query the underlying table that this Oracle
view is based on, I have no problem.

Any clues?

Geoff M


Hi Geoff,

Assuming you set up the whole thing right, and you had some experience with
adodb... well, in that case it sounds like a firstclass bug to me. :-(

I would contact John Lim (jlim#natsoft.com, replace# with @) and ask him he
has a clue, and maybe he can fix it for you right away if you ask nicely.
:-)

Regards,
Erwin Moller
Feb 28 '06 #2
On Tue, 28 Feb 2006 14:37:33 +1100, Geoff Muldoon
<ge***********@trap.gmail.com> wrote:
Cross-posted to comp.databases.oracle.misc and comp.lang.php ...

Using PHP 4.3.11 on Linux and ADODB data abstraction library.

Oracle client version is 10.1.

Can successfully connect to remote database (version 9.2.0.6 on Linux
NLS_LANG=AL32UTF8).

When doing a simple select from a view:
select RTS_LOAD from VW_R_PROJECTED_LOAD_OUTPUT
I get the error message:
ociexecute(): OCIStmtExecute: ORA-01858: a non-numeric character was found
where a numeric was expected in adodb/461/drivers/adodb-oci8.inc.php on
line 942
1858: ORA-01858: a non-numeric character was found where a numeric was
expected

This happens even if I just select count(*) from the view.

Using SQLPlus from the web server I don't have any problems at all
selecting from the view, so it is definitely valid.

If in my PHP script I directly query the underlying table that this Oracle
view is based on, I have no problem.

Any clues?


Try enabling debug on the ADOdb connection so you can see what it is actually
tring to execute (rather than what you expect it is executing) - just to make
sure.

My initial thought is NLS issues - implicit conversions somewhere in the view?

ORA-01858 is thrown by date conversions - don't think anything else throws
that, IIRC.

What's NLS_DATE_FORMAT set to?

What's the definition of the view?

When you queried the table directly, did you use *exactly* the same SQL as the
view definition?

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Feb 28 '06 #3
an**@andyh.co.uk says...
My initial thought is NLS issues - implicit conversions somewhere in the view?
Bingo.

Although in my PHP code I always use explicit (to_date) date conversion in
any SQL, it appears that querying a view that has been successfully
compiled using implicit date conversion causes the problem.

Odd that PHP and/or AdoDB and/or OCI appears to be attempting to
"revalidate" the view when simply selecting from it. Don't know if this
is version specific or even at what stage (PHP/AdoDb/OCI/Oracle Client)
it's kicking in.

Just recompiled the view with explicit date conversion and moving on, no
time to chase further.

Thanks Andy and Erwin for your pointers, owe you one.

Geoff
ORA-01858 is thrown by date conversions - don't think anything else throws
that, IIRC.

What's NLS_DATE_FORMAT set to?

What's the definition of the view?

When you queried the table directly, did you use *exactly* the same SQL as the
view definition?

Feb 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: simianphile | last post by:
OK, I had a problem that I've now fixed but I can't really understand what was causing it in the first place. I have an intranet site that uses basic authentication to allow users to view and...
3
by: Harry | last post by:
Using Oracle 8i enterprise on win 2000 (sp3) Installed the standard configuration & whenever I make a connection it takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason there...
1
by: Phil Hindmoor | last post by:
Hi, I am sure if anyone can help me, you guys can! I am an Informix Developer, moving to Oracle 8i and later databases. I am struggling to find the Oracle equivelant to many of the useful...
5
by: SerGioGio | last post by:
Hello, I am going nuts. I am trying to connect to my local ORACLE instance using ODBC. It used to work few weeks ago, but it fails now. Connection with: - SQL*plus: connection works! -...
4
by: Ellen K. | last post by:
Hi all, Being that so far I didn't get an answer to my below problem on the Oracle newsgroup, I figured it couldn't hurt to try here. While at my current job I've been working with mostly SQL...
11
by: Ellen K | last post by:
Hi all, I set up our Oracle Financials as a linked server to one of my SQL Server boxes. On running a test query, I got the following error message: OLE DB provider 'MSDAORA' supplied...
63
by: Nick Palmer | last post by:
Hi all, Is there a DB2 equivilant to Oracle's DB Link functionality ? I have two DB2 databases and I need to get access to the tables in one from the other. In Oracle I would just create a DB...
2
by: Steve Foo | last post by:
I have been posting this question in google group, EE, and Oracle OTN forum and still no cannot find a suitable solution for it. I have contacted Singapore Microsoft support regarding the problem...
13
by: Chris Botha | last post by:
The machine is running XP Pro with all the latest service packs, etc. I must access an Oracle database so I installed the Oracle client stuff. I can query Oracle from a Windows app, no problem....
2
by: Ruslan A Dautkhanov | last post by:
Hello ! I'm about to install O9i on FreeBSD box. uname -a: FreeBSD stat2.scn.ru 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #2: Fri Apr 23 19:19:43 KRAST 2004...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.