To be callable from a SQL expression, a user-defined function must do what?
A.
Be stored only in the database.
B.
Have both IN and OUT parameters.
C.
Use the positional notation for parameters.
D.
Return a BOOLEAN or VARCHAR2 data type.
Explanation:
Functions called from SQL statements must use positional notation to pass values to the IN parameters.
Incorrect Answers:
A.Functions invoked using SQL statements must be stored in the database, however if they are stored on the client this alone will not cause the statement to fail. B: The function must only have parameters of the IN Mode for them to be used in a SQL Expression.
D: You cannot use PL/SQL data types, such as BOOLEAN, RECORD, or TABLE for returning values for the function to be callable from a SQL expression.
what is the correct solution for this question,some website shows option A is correct,some shows option B or C ??
C is the most correct answer. A is not incorrect but it’s too obvious. D could also be correct as it’s perfectly acceptable for a function called from a SQL statement to return either a VARCHAR2 or a BOOLEAN datatype. However, the key is in the wording of the question and in this case, because SQL function calls MUST use positional notation, it makes it the most suitable answer.
Sadly, with these Oracle questions, there usually is more than one answer that is technically correct. You just need to read them carefully think hard.
i disagree with your explanation about D – you can’t have boolean datatype in SQL (there is none, in PL/SQL – of course, but not in pure SQL, and the question is about SQL). I’m giving a big “na-ah” for your “perfectly acceptable” 😉
correct is C as everyone else says:)
I think A is correct answer, because for a function to be callable, it should be present(stored) in database. C is correct only if function is present(stored) in database.
A is correct answer.
Corrent ANS: A
only A is correct.
I believe A is the correct answer.
If side-effects are considered, in this case only B is correct otherwise the first and foremost requirement is to be present stored function in database.
A) is correct.
C) As I know, in 11g, for user-defined function, positional notation is no longer mandatory.