Skip to content
Advertisement

Variable value assignment using RETURNING clause

I try to do this, but it’s a syntax error, what am I doing wrong?

my table:

Advertisement

Answer

You need to use the INTO clause in the RETURNING to set the value being returned into your variable:

You also need to specify the data type of your variable; I’m glad to see postgresql supports %TYPE and %ROWTYPE.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement