EzOracle extensions Query no execute???

Author Message

Amer Azzaz

Thursday 19 January 2006 12:18:27 am

Hi to all
I write the function in my Class but in this function I want to connect Oracle via ezoracle extension and execute query but this query is concatenate with multiple variable like that:
function DisplayDataRegional($CountryId, $StateId, $Industryid, $brandId)
{
$result = array('ls' => Array());

$databaseParameters=array('server'=>'Dbox','user'=>'tatis','password'=>'tatis','database'=>'EPSA.CMS');

$conn =& eZDB::instance( 'ezoracle', $databaseParameters,true);
if (!$conn) {
$result['ls'] = "Cannot Login";
return $result;
}
$x="Canada";
$query ='Select * FROM V_CONTACT_WEB WHERE CNTNAME=(select COUNTRYNAME from COUNTRY Where COUNTRYID='."$CountryId".')
AND
ADD_STATE=(select STATENAME from STATEID Where STATEID='."$StateId".')
AND
IDNWEB_CUSTOMER in( SELECT IDNWEB_CUSTOMER FROM NWEB_INDUSTRY_NWEB_CUSTOMER
WHERE IDNWEB_INDUSTRY='."$Industryid".')
AND
IDNWEB_CUSTOMER in( SELECT IDNWEB_CUSTOMER FROM NWEB_BRAND_NWEB_CUSTOMER
WHERE IDNWEB_BRAND='."$brandId".')';
$stid =$conn->arrayQuery( $query );
if (!$stid) {
$result['ls'] = "Cannot execute";
return $result;
}

$counter=$counter1=0;

foreach ( $stid as $row )
{
$counter1 = 0;
foreach ($row as $item)
{
$result['ls'][$counter][$counter1]=$item;
$counter1++;
}
$counter++;
}

return Array ('result' => $result);
}
Error: eZOracleDB Jan 19 2006 10:16:23
Error (936): ORA-00936: missing expression

If I change the query like the query execute and The data retreived from DB.
Thank you

Frederik Holljen

Thursday 19 January 2006 12:26:36 am

I think you stand a better chance to get a good answer if you also include the result of your method (e.g the offending query). Even better would be if you made a smaller reproduceable case out of the query.

Amer Azzaz

Thursday 19 January 2006 1:04:39 am

Ok ok The query executed but no data in page
Thank you

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.