Answer the question
In order to leave comments, you need to log in
Is it possible to get data from a temporary table in multiple queries?
Good afternoon. I am writing a service that sends a request to the Table, and it must receive data in order to work with it further. Request example:
$sql = <<<SQL
CREATE GLOBAL TEMPORARY TABLE SADMIN.DUBLES (
RESULT varchar2(200),
GUID DATE
)
ON COMMIT DELETE ROWS
SQL;
$this->module->db_crm->createCommand($sql)->execute();
$sql = <<<SQL
DECLARE
RESULT varchar2(200) ;
BEGIN
-- всякая логика
INSERT INTO SADMIN.DUBLES (RESULT, GUID) VALUES (RESULT, CURRENT_DATE);
END;
SQL;
$this->module->db_crm->createCommand($sql)->execute();
$sql = <<<SQL
SELECT * FROM SADMIN.DUBLES
SQL;
$data2 = $this->module->db_crm->createCommand($sql)->queryAll();
Answer the question
In order to leave comments, you need to log in
But I am not getting data. I seem to understand that this is due to the fact that this request is already considered another transaction, so I don’t see the data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question