How to create function that returns nothing

Kabi

I want to write a function with pl/pgsql. I'm using PostgresEnterprise Manager v3 and using shell to make a function, but in the shell I must define return type. If I don't define the return type, I'm not able to create a function.

How can create a function without return result, i.e a Function that creates a new table?

sqreept

Use RETURNS void like below:

CREATE FUNCTION stamp_user(id int, comment text) RETURNS void AS $$
    #variable_conflict use_variable
    DECLARE
        curtime timestamp := now();
    BEGIN
        UPDATE users SET last_modified = curtime, comment = comment
          WHERE users.id = id;
    END;
$$ LANGUAGE plpgsql;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to elegantly create a function which returns a lambda's return value or nothing?

Callback function for database query returns nothing

How can I create a "forEach" that returns an object that is a receiver to the consuming function?

Postgres: how to create overloaded function that returns setof type

how to create function in postgres that returns rowcounts between tables given as parameters

How to create function that returns all combinations of this list in Python?

How create a javascript function that returns a html

How to create an enum function that returns a tuple of Ints?

How to create a function that returns a new stack?

How to create SWIG typemap for function that takes and returns 2 tables

Async function to get JSON returns nothing

How to Create a function that returns the total number of boomerangs in an array

Function that only returns false returns nothing

Excel/VBA - How to create a function which returns a list

How to create function that returns 'change in highest denominations'

Replace function $$find always returns nothing

How do you get to the value inside of a python function that returns nothing for unit testing?

How to create function reference that does nothing

Why XMPP function returns nothing?

if function in javascript returns nothing..why?

Create a completion block that returns nothing but executes another function when completed?

Google spreadsheet custom function returns nothing

python function returns nothing

Laravel hasmany function returns nothing

ANY function returns nothing when the database is empty

Return function returns nothing

Non-void function returns nothing dart

How to create a function with zipWithIndex that returns an Int from a List[Int] in scala

How do you check if your function returns nothing?