是不是authid子句哪里用错了,运行显示警告: 创建的函数带有编译错误

haiwenlin 2003-04-26 02:52:36
create or replace function mypi
authid current_user as
begin
NULL;
return 3.14;
end;
/
运行时显示
警告: 创建的函数带有编译错误
大家看看错 在哪里,就这两三行代码
...全文
236 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
haiwenlin 2003-04-26
  • 打赏
  • 举报
回复
已经结贴
haiwenlin 2003-04-26
  • 打赏
  • 举报
回复
beckhambobo(beckham),你哪里搞来那一串说明啊,跟我说说行吗,以后碰到问题我也可以去查啊
beckhambobo 2003-04-26
  • 打赏
  • 举报
回复
SQL> create or replace function mypi
2 return number authid current_user as
3 begin
4 return 3.14;
5 end;
6 /

Function created

SQL> select mypi from dual;

MYPI
----------
3.14
beckhambobo 2003-04-26
  • 打赏
  • 举报
回复
语法已经有问题了,请看以下说明:
invoker_rights_clause
The invoker_rights_clause lets you specify whether the function executes with the privileges and in the schema of the user who owns it or with the privileges and in the schema of CURRENT_USER.

This clause also determines how Oracle resolves external names in queries, DML operations, and dynamic SQL statements in the function.

AUTHID CURRENT_USER
Specify CURRENT_USER if you want the function to execute with the privileges of CURRENT_USER. This clause creates an "invoker-rights function."

This clause also specifies that external names in queries, DML operations, and dynamic SQL statements resolve in the schema of CURRENT_USER. External names in all other statements resolve in the schema in which the function resides.

AUTHID DEFINER
Specify DEFINER if you want the function to execute with the privileges of the owner of the schema in which the function resides, and that external names resolve in the schema where the function resides. This is the default.

你的语句没有返回值.
haiwenlin 2003-04-26
  • 打赏
  • 举报
回复
2/1 PLS-00103: 出现符号 "AUTHID"在需要下列之一时:
(returncompresscompiled
wrapped
符号 "return在 "AUTHID" 继续之前已插入。
我在oracle 9i环境下,这种错误提示信息好像看不是很明白,书上说可以参考oracle帮助,不知哪位也是oracle9i 中文版的,帮助哪里查看啊
haiwenlin 2003-04-26
  • 打赏
  • 举报
回复
show error 后如下:
FUNCTION MYPI 出现错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
2/1 PLS-00103: 出现符号 "AUTHID"在需要下列之一时:
(returncompresscompiled
wrapped
符号 "return在 "AUTHID" 继续之前已插入。

more_zou 2003-04-26
  • 打赏
  • 举报
回复
show error
PostgreSQL中文学习手册 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (数据表 数据表 ) 4 一、表的定义: 一、表的定义: 一、表的定义: . 4 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (模式 Schema) Schema) .9 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (表的继承和分区 表的继承和分区 表的继承和分区 表的继承和分区 ) 10 一、表的继承: 一、表的继承: 一、表的继承: .10 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (常用数据类型 常用数据类型 常用数据类型 ) 16 一、数值类型: 一、数值类型: 一、数值类型: .16 六、数组: 六、数组: .22 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (函数和操作符 函数和操作符 函数和操作符 <一>) 25 一、逻辑操作符: 一、逻辑操作符: 一、逻辑操作符: 一、逻辑操作符: .25 四、字符串函数和操作: 四、字符串函数和操作: 四、字符串函数和操作: 四、字符串函数和操作: 四、字符串函数和操作: 四、字符串函数和操作: .27 五、位串函数和操作符: 五、位串函数和操作符: 五、位串函数和操作符: 五、位串函数和操作符: 五、位串函数和操作符: .29 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (函数和操作符 函数和操作符 函数和操作符 <二>) 30 六、模式匹配: 六、模式匹配: 六、模式匹配: .30 八、时间 八、时间 /日期函数和操作符: 日期函数和操作符: 日期函数和操作符: 日期函数和操作符: 日期函数和操作符: 33 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (函数和操作符 函数和操作符 函数和操作符 <三>) 35 九、序列操作函数: 九、序列操作函数: 九、序列操作函数: 九、序列操作函数: . 35 十二、系统信息 十二、系统信息 十二、系统信息 函数函数: .38 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (索引 ) 42 一、索引的类型: 一、索引的类型: 一、索引的类型: 一、索引的类型: .42 四、唯一索引: 四、唯一索引: 四、唯一索引: .43 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (事物隔离 事物隔离 ) 45 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (性能提升技巧 性能提升技巧 性能提升技巧 ) 46 一、使用 一、使用 EXPLAINEXPLAINEXPLAINEXPLAIN EXPLAIN: 46 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (服务器配置 服务器配置 服务器配置 ) 50 一、服务器进程的启动和关闭: 一、服务器进程的启动和关闭: 一、服务器进程的启动和关闭: 一、服务器进程的启动和关闭: 一、服务器进程的启动和关闭: 一、服务器进程的启动和关闭: . 50 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (角色和权限 角色和权限 角色和权限 ) 52 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (数据库管理 数据库管理 数据库管理 ) 54 一、概述: 一、概述: .54 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (数据库维护 数据库维护 数据库维护 ) 56 一、恢复磁盘空间: 一、恢复磁盘空间: 一、恢复磁盘空间: 一、恢复磁盘空间: . 56 二、更新规划器统计: 二、更新规划器统计: 二、更新规划器统计: 二、更新规划器统计: 二、更新规划器统计: .57 四、定期重建索引: 四、定期重建索引: 四、定期重建索引: 四、定期重建索引: . 59 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (系统表 系统表 ) 61 一、 pg_class: pg_class: pg_class: pg_class:pg_class: 61 三、 pg_attrdef: pg_attrdef: pg_attrdef:pg_attrdef:pg_attrdef:pg_attrdef:pg_attrdef:pg_attrdef:pg_attrdef: . 63 四、 pg_authid: pg_authid: pg_authid: pg_authid:pg_authid: 64 五、 pg_auth_members: pg_auth_members: pg_auth_members: pg_auth_members:pg_auth_members: pg_auth_members:pg_auth_members:pg_auth_members:pg_auth_members: .64 七、 pg_tablespace: pg_tablespace: pg_tablespace: pg_tablespace: pg_tablespace: pg_tablespace:pg_tablespace: .65 十、 pg_index: pg_index: pg_index:pg_index:pg_index:pg_index: . 67 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (系统视图 系统视图 ) 68 一、 pg_tables: pg_tables: pg_tables: pg_tables: pg_tables: 68 二、 pg_indexes: pg_indexes: pg_indexes:pg_indexes:pg_indexes:pg_indexes: 68 三、 pg_views: pg_views:pg_views: pg_views: pg_views:pg_views: . 68 四、 pg_user: pg_user: pg_user:pg_user:pg_user: .69 五、 pg _roles:_roles:_roles:_roles: _roles: 69 六、 pg_rules: pg_rules:pg_rules:pg_rules: pg_rules: 69 七、 pg_settings: pg_settings: pg_settings: pg_settings:pg_settings: pg_settings:pg_settings:pg_settings: .70 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (客户端命令 客户端命令 客户端命令 <一>) 70 零、口令文件: 零、口令文件: 零、口令文件: .70 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (客户端命令 客户端命令 客户端命令 <二>) 75 七、 pg_dump: pg_dump: pg_dump:pg_dump:. 75 八、 pg_restore: pg_restore:pg_restore:pg_restore: pg_restore:pg_restore:pg_restore:pg_restore: 77 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (SQL (SQL语言函数 语言函数 ) . 83 一、基本概念: 一、基本概念: 一、基本概念: .83 PostgreSQL PostgreSQL PostgreSQL学习手册 学习手册 学习手册 (PL/pgSQL (PL/pgSQL(PL/pgSQL 过程语言 过程语言 ) .86 一、概述: 一、概述:

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧