小弟是刚接触postgreSQL ,
想创建个函数 很郁闷 啥也不说了 看代码,
CREATE FUNCTION addnumbers(integer,integer) returns integer as '
delcare
number_1 alias for $1;
number_2 alias for $2;
begin
return number_1 + number_2;
end;
' language 'plpgsql';
执行报错:
ERROR: syntax error at or near "delcare"
LINE 2: delcare
^
********** 错误 **********ERROR: syntax error at or near "delcare"
SQL 状态: 42601
字符:67请问我这个简单的函数有问题吗?
想创建个函数 很郁闷 啥也不说了 看代码,
CREATE FUNCTION addnumbers(integer,integer) returns integer as '
delcare
number_1 alias for $1;
number_2 alias for $2;
begin
return number_1 + number_2;
end;
' language 'plpgsql';
执行报错:
ERROR: syntax error at or near "delcare"
LINE 2: delcare
^
********** 错误 **********ERROR: syntax error at or near "delcare"
SQL 状态: 42601
字符:67请问我这个简单的函数有问题吗?
解决方案 »
- 求一查询语句
- 一个比较初级的sql语句
- 查找出错。都一个星期了。晕死了#2006 - MySQL server has gone away根本解决不了
- 100分---mysql 双机热备,error connecting to master的问题
- 关于MySQL中的group by,多谢!
- *****??? 针对 mysql 5.x 接口 c++ 接口 mysqlpp 2.1 存在严重得内存泄漏,不知道那位有 办法修复吗???
- mySql中float字段的问题
- mysql 存储过程 通过参数查询的问题
- mysql存储过程中如何求出数据表统计列所占百分比
- MySQL用户误操作delete from 表。如何查询这个用户信息?
- sql语句 含标点问题!
- 这样的查询语句能否实现?
delcare ====> declare
改一下就可以了。