How to make a request to the database PostgreSQL

edited October 2019 in Developers

I want to write to a custom table all user session from a method taoDelivery/DeliveryServer/runDeliveryExecution
How to write a request?
$dbquery = new common_persistence_sql_dbal_Driver();
$dbquery->query('custom_table', ['field','value']);
Something like this?


  • Hello,
    I wrote the code here, but for some reason it doesn’t work. Where is the mistake?

    $storageService = $this->getServiceManager()->get(StorageInterface::SERVICE_ID);
    $persistence = $storageService->getPersistence();
    $sql = "select * from statements where predicate = '';";
    $r = $persistence->exec($sql);

  • use common_persistence_SqlPersistence;
    use oat\oatbox\service\ServiceManager;

Sign In or Register to comment.

We use cookies on our website to support technical features that enhance your user experience. Cookie Policy Privacy Policy