what is the diff between cursor and plsql table

5 pts.
Tags:
Cursor Table
PL/SQL Table
what is the diff between cursor and plsql table

Answer Wiki

Thanks. We'll let you know when a new response is added.

Cursor expressions (sometimes known as cursor subqueries) are an element of the SQL language (earlier) and now of the PL/SQL too. A cursor expression can be used as an actual parameter to a PL/SQL procedure or function, which has great significance in connection with table. It can also be used functions in the SELECT statement used to open a PL/SQL cursor, and manipulated appropriately as per the requirement. Cursor expressions allow encapsulation of logic for re-use in compatible query situations, giving increased developer productivity and application reliability. A table function with a ref cursor input parameter can be invoked with another table function as the data source. Thus table functions can be daisy-chained allowing modular program design and hence increased ease of programming, re-use and application robustness. Both cursor and PL/SQL table can be used to store temporary data for manipulation. You don’t “store” data in a cursor, the data comes from a table or global temporary table. you store data in a table. Global Temporary Tables are ideal for this. A correct name for a PL/SQL table would be PL/SQL array (earlier it was used as table). A cursor variable (i.e. a variable of type ref cursor) points to an actual cursor, and may be used as a formal parameter to a PL/SQL procedure or function or array. So in nutshell a Cursor is not a data type to store some data; it is either declared with the FOR clause that will bind it to a SELECT statement or it will act as an alias for another cursor, with the SET statement. A Table data type is an alternative way to create a temporary table. The variable declaration requires the column definition for the table and it creates a temporary table in tempdb.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following