faqts : Computers : Programming : Languages : PHP : Database Backed Sites : Oracle

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 11 people (55%) answered Yes
Recently 5 of 9 people (56%) answered Yes

Entry

When I execute an OCIExecute statement I get an "invalid statement" error, but I'm not sure why?

Nov 7th, 2001 00:46
Sally Greenaway, Tracey Vernon,


Whenever I have received this error message it has been due to the fact 
that the statement that is being executed hasn't successfully been 
parsed by Oracle.
This is usually because of a syntax error in the original Select 
statment. e.g.
$select="Select firstname, lastname from addresses where MAX(age)";
$select_parse=ociparse($dbconn, $select);
ociexecute ($select_parse);
These statements will result in an "Invalid Statement Error" because 
the MAX(age) condition is invalid in Oracle, group functions cannot be 
performed in the WHERE clause of a statement.