eZ Community » Forums » Developer » Stroed Procedures and MS Sql Server 2000
expandshrink

Stroed Procedures and MS Sql Server 2000

Stroed Procedures and MS Sql Server 2000

Tuesday 19 May 2009 3:23:16 pm - 4 replies

Hi I have the following code in a template doing a simple query via ezcDb api

$query ='SELECT LOCATION_NAME as name,
LOCATION_ID as id FROM LOCATION WHERE LOCATION_TYPE_ID = 2
AND PARENT_LOCATION_ID = '.$country_id;

$confObject = databaseconfig::getInstance();
$dbconfig = $confObject->getConfig();
$db = ezcDbFactory::create($dbconfig);
ezcDbInstance::set( $db );
$db = ezcDbInstance::get();
$rows = $db->query($query) ;
return $rows->fetchAll();;

However I would like to convert this from the quesry above to calling a stored proceedure but can't find anything in the documentation for how to call a stroed procedure.

Can any one help

Thanks

Tuesday 19 May 2009 3:49:43 pm

You'll probably get more response if you post to the ezc mailing list.
As far as I know, ezc DB does not have any specific support for stored procedures yet.

Tuesday 19 May 2009 3:57:13 pm

Thanks Andre will do

Friday 20 April 2012 12:00:27 pm

Hi all

Has there been any developments in this area?

I am building a solution that implements some custom tables (extending eZPersistentObject) and the usage of MySQL stored procedures would definitely simplify most of the data retrieval system.

Cheers

Io

Saturday 21 April 2012 2:55:49 pm

I found a simple solution. d'oh!

$dbObj = eZDB::instance()
$spResult = $dbObj->arrayQuery('call mySP()');
mysqli_next_result($dbObj->DBConnection); 

works for me happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu