CREATE OR REPLACE FUNCTION FUN_GETBRNAME (pbrno varchar)returns varchar(80)begindeclare @pbrname varchar(80);set @pbrname = select br_name from TBL_ORG_DEPARTMENTS where br_no = pbrno;return @pbrname;end;這個找不到哪里有錯誤,請大神指正。
2 回答

千巷貓影
TA貢獻(xiàn)1829條經(jīng)驗 獲得超7個贊
CREATE OR REPLACE FUNCTION FUN_GETBRNAME (pbrno varchar)
returns varchar(80)
begin
declare @pbrname varchar(80);
select br_name into @pbrname from TBL_ORG_DEPARTMENTS where br_no = pbrno;
return @pbrname;
end;
CREATE FUNCTION FUN_GETBRNAME (pbrno varchar(80)) returns varchar(80) begin declare pbrname varchar(80); select br_name into pbrname from TBL_ORG_DEPARTMENTS where br_no = pbrno; return pbrname; end;

呼啦一陣風(fēng)
TA貢獻(xiàn)1802條經(jīng)驗 獲得超6個贊
這句錯了,直接改成select @pbrname = br_name from TBL_ORG_DEPARTMENTS where br_no = pbrno;
- 2 回答
- 0 關(guān)注
- 1291 瀏覽
添加回答
舉報
0/150
提交
取消