mysql - Temp table inside function in amazon rds read replica -


i trying create , drop temporary table inside user defined function called stored procedure error 1 mysql server running --read-only option cannot execute statement sql2.sql 1 1 have created , drop temp table in stored procedures , seems work fine not functions? there setting needs changes? here sample, query is

select        mer.merchantguid guid,         fn_testfunction(merchantid) upcomingrebate         merchants mer; 

and function is

create definer = 'testuser'@'%'    function testdb.fn_testfunction(        i_merchantid int(11)       )         returns varchar(1000) charset latin1    begin         create temporary table if not exists tdeals           (pid int(11),              pmerchantdealid int(11)        );      insert tdeals values(1, 12);         drop temporary table if exists tdeals;            return 'test';  end 

and when call function in query "read only" error. appreciated


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -