Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    464

    Unanswered: Trying to understand a PL/SQL block

    Hi guys

    Could someone please translate this into simple english:

    This is not for practice. I'm trying to understand this section of a package.

    Code:
    Function GET_ABC (QWE number) RETURN number IS
    QAZ number;
    BEGIN
    GHJ:= GET_TGB (QWE number);
    SELECT DISTINCT OPP
    INTO QAZ
    FROM DD_TABLE
    WHERE
    WSX=QWE;
    RETURN QAZ;
    EXCEPTION
    WHEN TOO_MANY_ROWS THEN
    ADD_TO_LOG(GET_TGB(QWE)
    Basically I'm trying to understand the significance of QWE & QAZ?

    Regards
    Shajju
    Last edited by shajju; 04-23-13 at 08:45.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    QWE is function's IN parameter.
    QAZ is function's local variable.

    Though, the "GHJ" line looks suspicious. What kind of a syntax is it? What is GHJ? Where is it declared? What is "number" doing in the brackets?

  3. #3
    Join Date
    Aug 2008
    Posts
    464
    Thanks.

    How is this IN parameter used here?

    You're right, number should not be there.
    GHJ:= GET_TGB (QWE);

    and GHJ is declared earlier in the package.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    QWE, as function's IN parameter, is not used here. It is just passed to the function. Review its (function's) code in order to find out how it is used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •