gpt4 book ai didi

postgresql - Plpgsql:如何在声明部分为变量赋值?

转载 作者:行者123 更新时间:2023-11-29 14:11:28 31 4
gpt4 key购买 nike

例如。

--Assigning value to variable in function as a parameter.
create or replace function f1(number int :=1) --This method is not working to me.

--Assigning values to variables at declaration section.
declare
number int :=1; -- Here i need to assign the value to number but its not working.
name varchar :='xyz';

最佳答案

这里是你如何做到的:

create or replace function f1(my_number int default 1)

declare
my_number int :=1;

declaration documentation

关于postgresql - Plpgsql:如何在声明部分为变量赋值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21932493/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com