Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Problem with inserts #17

Closed
jeffchulg opened this issue Dec 11, 2012 · 1 comment
Closed

Problem with inserts #17

jeffchulg opened this issue Dec 11, 2012 · 1 comment

Comments

@jeffchulg
Copy link

Hi, I wonder if this is generated by your module or not...
I have a model class whose "store" method is called :
public function store(Event $e) {
$data = array(
/** some data /
) ;
/
.. . */
$this->tableGateway->insert($data);
}

The problem is under this level. I don't know if it's your module which generates this or ZF2... Could you have a look at it please.

I get the following error :

Zend\Db\Adapter\Exception\InvalidQueryException

vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php:220

with message "Statement could not be executed"
and previous exception message was :

SQLSTATE[HY000]: General error: 907 OCIStmtExecute: ORA-00907: missing right parenthesis
(/builddir/build/BUILD/php-5.4.6/ext/pdo_oci/oci_statement.c:148)

with stack trace :
#0 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php(218): PDOStatement->execute()
#1 /home/jeff/projects/winyumweb/zf2/vendor/bjyoungblood/bjy-profiler/src/BjyProfiler/Db/Adapter/Driver/Pdo/ProfilingStatement.php(31): Zend\Db\Adapter\Driver\Pdo\Statement->execute(NULL)
#2 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php(295): BjyProfiler\Db\Adapter\Driver\Pdo\ProfilingStatement->execute()
#3 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php(262): Zend\Db\TableGateway\AbstractTableGateway->executeInsert(Object(Zend\Db\Sql\Insert))
#4 /home/jeff/projects/winyumweb/zf2/module/Application/src/Application/Model/EventTable.php(73): Zend\Db\TableGateway\AbstractTableGateway->insert(Array)
#5 /home/jeff/projects/winyumweb/zf2/module/Application/src/Application/Controller/WinyumController.php(150): Application\Model\EventTable->store(Object(Application\Entity\Event))
#6 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(87): Application\Controller\WinyumController->lockAction()
#7 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#8 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(464): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#9 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(208): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(108): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(113): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#12 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#13 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(464): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#14 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(208): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /home/jeff/projects/winyumweb/zf2/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(297): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /home/jeff/projects/winyumweb/zf2/public/index.php(15): Zend\Mvc\Application->run()
#17 {main}

@jeffchulg
Copy link
Author

found the error.. When using Zend\Db\Sql\Expression with a function... I had to add quotes in my 'to_date' function....
Sorry for disturbance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant