简体   繁体   English

此功能如何工作? -甲骨文

[英]How this function works? - Oracle

I have just started using Oracle procedures, using following procedure(made by our DBA department) in my code but having difficulty in understanding this procedure, I have googled a lot and read tutorials but still have confusion. 我刚刚开始使用Oracle过程,在我的代码中使用以下过程(由DBA部门制作),但是由于难以理解该过程,我在Google上搜索了很多内容并阅读了教程,但仍然感到困惑。

If anyone could explain this to me, I would really be gratefull. 如果有人可以向我解释这一点,我将非常感激。

 function SF_MY_IDENTITY(name IN VARCHAR2, fName in VARCHAR2 class in VARCHAR2,std_Id in VARCHAR2)return UD_CURSOR
is
cursorReturn UD_CURSOR;
grNo VARCHAR(100);
phone VARCHAR(100);

 begin

In above part I couldn't figure out what is this 'is' doing?what it is being used for? 在上面的部分中,我无法弄清楚“做什么”在做什么?它的用途是什么?

 Open cursorReturn for
            SELECT
            grNo,
            phone
            FROM
                MY_SCHOOL MS
            WHERE
                MS.std_id=std_Id
                 AND MS.name=name
                 AND MS.fNameE=fName;

What is this part doing, what does open doing? 这部分在做什么,开放在做什么? and how the output variables 'grNo, phone' would be used in an irrelevant table(MY_SCHOOL) 以及如何在不相关的表中使用输出变量“ grNo,phone”(MY_SCHOOL)

1) The "is" token is part of the function definition in pl/sql 2) Opens a sql cursor. 1)“ is”标记是pl / sql中函数定义的一部分2)打开sql游标。

I highly recommend that you read a book about pl/sql. 我强烈建议您阅读一本有关pl / sql的书。 For instance the oracle documentation. 例如oracle文档。

It just takes few inputs and based on the input values it opens a cursor and returns it back. 它只需要很少的输入,并根据输入值打开一个游标并将其返回。

But there is some comma missing and the code is incomplete. 但是缺少一些逗号,代码不完整。 Based on what you have posted, this is what the function is doing. 根据您发布的内容,此功能正在执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM