大剑
天天加班,哪有时间写博客 ---- 专注于ERP软件开发技术,关注Oracle相关技术

Oracle 存储过程返回多个值

glave posted @ 2009年7月15日 06:18 in ORACLE with tags oracle 参数 返回值 in out , 14470 阅读

 

在Oracle中存储过程中,Function可以返回值,但只是一个
加入需要返回多个值,如果不用数组的话,可以用out参数,传出参数
有传出就有传入,in就是传入参数

以PB调用Oracle过程为例:

PL/SQL代码:
/*******************************************************************/
PROCEDURE p_example (ai_a IN NUMBER, ai_b OUT NUMBER, ai_c OUT NUMBER)
IS
    ll_count NUMBER;

BEGIN

    ll_count := 10;
    ai_b := ll_count + ai_a;
    ai_c := ll_count - ai_a;
   
 RETURN;
END;
/*******************************************************************/

PB代码:
/*******************************************************************/
long  ll_b
long  ll_c
long  ll_lan

ll_lan = 1

DECLARE p_pro PROCEDURE FOR p_example(:ll_lan);

EXECUTE p_pro ;
 if sqlca.sqlcode <> 0 then
  CLOSE p_pro ;
  return 1
 end if
 
 FETCH p_pro INTO :ll_b,:ll_c ;
 
 if sqlca.sqlcode = -1 then
  CLOSE p_pro ;
  return 1
 end if

CLOSE p_pro;
/*******************************************************************/

那么,ll_b,和ll_c里分别保存了存储过程返回的结果.

Avatar_small
3 说:
2013年1月10日 17:54

用 徐禾了 答 等 等条珍正月

Avatar_small
apple.com/bill 说:
2023年7月20日 23:35

Manchmal sind wir schockiert oder besorgt über einige unerwartete Apple-Rechnungsbelastungen, die in Form von Textnachrichten oder E-Mails durchscheinen. Diese Arten von ungewohnten Zahlungen werden häufig auf apple.com/bill für ihre Apple-ID-Kunden angezeigt, die sich nach monatlichen und jährlichen Kontoauszugstransaktionen erkundigen. Dies liegt daran, dass ihre Apple-IDs gehackt wurden oder Kreditkarteninformationen entwendet wurden und ein unschuldiges Kind oder Familienmitglied ohne ihr Wissen eingekauft hat.

Avatar_small
Sikkim 4th Class Te 说:
2023年8月01日 18:48

SCERT Sikkim Follows NCERT Curriculum These Textbooks are Updated as per the Syllabus Prescribed by SCERT Sikkim. Students of 4th Class Should follow Prescribed Textbooks while Preparing for Exam.Our Sikkim 4th Class Textbook 2024 Team Refer to the Respective Subject Textbook while Preparing the Final Important questions. Students Best Practice Study Materiel about Textbooks are the Fact that they are so Comprehensible that it does not require the aid of a Subject Literate.SCERT Sikkim once Publishes the Sikkim Elementary School Textbooks 2024 Other Study materials on the official web site, we will update the Information on this page.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter