如何从 Oracle 程序中获取单个结果?
我有这个程序:
CREATE OR REPLACE PROCEDURE CONV1(
pDate IN VARCHAR2,
pYear OUT number,
pMonth OUT number,
pDay OUT number
)
AS
lDate DATE;
BEGIN
lDate := to_date(pDate, 'DD.MM.YYYY HH24:MI:SS');
pYear := to_number(to_char(lDate, 'YYYY'));
pMonth := to_number(to_char(lDate, 'MM'));
pDay := to_number(to_char(lDate, 'DD'));
END CONV1;
/
如果我只想要其中一个出局,我该如何调用这个程序? (就像Select FMAN_STAT_CONV1('16.07.2010', pDay) from Dual;
(顺便说一句,这是行不通的))
再见!
I've got this procedure:
CREATE OR REPLACE PROCEDURE CONV1(
pDate IN VARCHAR2,
pYear OUT number,
pMonth OUT number,
pDay OUT number
)
AS
lDate DATE;
BEGIN
lDate := to_date(pDate, 'DD.MM.YYYY HH24:MI:SS');
pYear := to_number(to_char(lDate, 'YYYY'));
pMonth := to_number(to_char(lDate, 'MM'));
pDay := to_number(to_char(lDate, 'DD'));
END CONV1;
/
How do I call this procedure if I just want ONE of the outs in there?
(Like Select FMAN_STAT_CONV1('16.07.2010', pDay) from dual;
(which ain't work btw))
Greetz!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建将使用过程 conv1 的函数,但仅返回一个值。
或者更适合您的特定情况
或常见情况是:
Create function which will use procedure conv1, but will return only one value.
Or even better for your particular case
Or common case is: