Is cursor a secure way of handling data in PL/SQL? If not, what other ways can y
ID: 3909235 • Letter: I
Question
Is cursor a secure way of handling data in PL/SQL? If not, what other ways can you confirm data security while working with multiple rows in a programming block? Provide an example to support your view. Justify your post with at least two credible sources.
Is there any disadvantage of using stored procedure/function versus an anonymous block? Provide an example to support your view. Justify your post with at least two credible sources.
A procedure, similar to a function, is a program unit that performs a task, can receive input values, and returns values to the calling environment. The main difference between functions and procedures is that a function is part of an expression. When would you use procedure over a function and vice versa? Provide an example to support your view. Justify your post with at least two credible sources.
Post a paragraph explaining your view. Make sure to include a scenario in which you will use SQL or PL/SQL (whichever you prefer) and explain how you will use it. Be sure to include at least two credible reference sources to support your post
Explanation / Answer
PL/SQL offers several ways to define and manipulate cursors to execute SELECT statements. This article focuses on the most-common ways programmers execute SELECT statements in PL/SQL, namely
SELECT-INTO
Using the SELECT-INTO statement
Fetching from an explicit cursor
Using a cursor FOR loop
Using EXECUTE IMMEDIATE INTO for dynamic queries
Using cursor variables
SELECT-INTO offers the fastest and simplest way to fetch a single row from a SELECT statement. The syntax of this statement is
SELECT select_list INTO variable_list FROM remainder_of_query;
Fetching from Explicit Cursors
A SELECT-INTO is also referred to as an implicit query, because Oracle Database implicitly opens a cursor for the SELECT statement, fetches the row, and then closes the cursor when it finishes doing that (or when an exception is raised).
Using the Cursor FOR Loop
The cursor FOR loop is an elegant and natural extension of the numeric FOR loop in PL/SQL. With a numeric FOR loop, the body of the loop executes once for every integer value between the low and high values specified in the range. With a cursor FOR loop, the body of the loop is executed for each row returned by the query.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.