Home > Database > Mysql Tutorial > oracle Functioin

oracle Functioin

WBOY
Release: 2016-06-07 14:57:41
Original
1571 people have browsed it

OracleFunction 无 create or replace function get_userreturn varchar2 isResult_user varchar2(50);begin select username into Result_user from user_users;return Result_user;end get_user;drop function get_user调用:SQL var Re varchar2(50)SQL ;SQ

Oracle Function
create or replace function get_user
return  varchar2 
is
Result_user varchar2(50);
begin 
select  username into Result_user from user_users;
return Result_user;
end get_user;
drop function get_user

调用:
SQL> var Re varchar2(50)
SQL> ;
SQL> exec :re:=get_user;
 
PL/SQL procedure successfully completed
Re
---------
YPGJ
 
Copy after login
--oracle 存储过程的调用
declare 
Re varchar2(50);
begin
Re :=get_user();
dbms_output.put_line(Re);
end;
///
declare
  m                         number(6);
  begin
  dbms_output.put_line('请输入一个数字');
  m                         := &x;
  dbms_output.put_line     (m);
end;
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template