我試圖執行此標量函數內計算算術表達式,我嘗試了很多的方法來實現這一點,但我會被卡住 Create FUNCTION CalculateElementFunc()
RETURNS int
AS
BEGIN
DECLARE @ResultVar numeric(18,6)
DECLARE @eq nvarchar(MAX)
set @eq = '7.5/100*12
CREATE OR REPLACE Function fun_Find_Staff_Name(v_staffid IN NUMBER)
RETURN VARCHAR2
IS
staff_name VARCHAR2(60);
CURSOR c_staff IS
SELECT staff_firstName || ' ' || staff_lastName
into sta
據我所知,當你在postgresql中創建一個用戶定義的函數時,你必須指定參數號和類型。就像這樣: CREATE OR REPLACE FUNCTION my_add(xx INTEGER, yy INTEGER)
RETURNS INTEGER AS
$$
BEGIN
RETURN xx + yy;
END;
$$
LANGUAGE plpgsql;