Store query result in a variable using in PL/pgSQL

前端 未结 5 1328
别那么骄傲
别那么骄傲 2020-11-29 21:12

How to assign the result of a query to a variable in PL/pgSQL, the procedural language of PostgreSQL?

I have a function:

CREATE OR REPLACE FUNCTION t         


        
5条回答
  •  -上瘾入骨i
    2020-11-29 21:52

    You can use the following example to store a query result in a variable using PL/pgSQL:

     select * into demo from maintenanceactivitytrack ; 
        raise notice'p_maintenanceid:%',demo;
    

提交回复
热议问题