Question

In: Computer Science

1. Describe when to use cursor:     implicit cursor      explicit  cursor 2. Please give one example for each...

1. Describe when to use cursor:

  •     implicit cursor
  •      explicit  cursor

2. Please give one example for each of below statement:

  •    TCL -- Transaction Control statement
  •    DML -- Data Manipulation statement
  •    Implicit Cursor Attributes --  PL/SQL statement

Solutions

Expert Solution

1.

A cursor is a pointer to a context area, which is memory created when an SQL statement is processed.

Implicit cursors Usage:

They’re used to check the DML operations status, whether the row is returned, etc.

They’re generated when a statement is used

They’re mainly used for the DML statements

Attributes such as %found ,%notfound, %rowcount, %isopen, %bulk_rowcount, %bulk_exceptions are used

They’re used in pl/sql procedures and are checked for the conditions, or used in procedural statements

They’re used for select into statements as well

These are predefined

It’s used when we’re working on one row

Explicit cursors Usage:

It’s used explicitly by the programmers

Declaring, opening, fetching, and closing are the steps followed to work with explicit cursor

Used to retrieve data, process statements set at one time

Used when working on many rows

2.

TCL – Transaction Control Statement

It manages the transactions in database.

Commit :

Used as

Commit;

It marks the permanent changes.

Rollback:

Used as

Rollback To name;

It either restores to the last state which is commited or jumps to a savepoint.

Savepoint:

Used as

SAVEPOINT name;

It temporarily stores a transaction

DML – Data Manipulation Language

Used for data manipulation and retrieval. It modifies the database.

Insert:

Used as

Insert into table_name..

This is an sql query which inserts data into the row of a table.

Update:

It’s used to modify or update a column value

Delete:

It’s used to delete one or more rows from the table

Used as

Delete from name…

Merge:

It’s used to merge tables

Implicit cursors attributes:

1. %found

It returns true when DML statement affects one or more rows or select into returns. Or else it returns false

2. %notfound

It’s the opposite of %found, returns true if DML doesn’t affect any rows, false otherwise.

3. %isopen

Returns false

4. %rowcount

Returns the number of rows affected by DML statements or returned by select into

comment for any doubts!


Related Solutions

Define implicit and explicit goals. Give an example of each.
Define implicit and explicit goals. Give an example of each.
Explain the difference between implicit and explicit costs. Give two examples of when an explicit cost...
Explain the difference between implicit and explicit costs. Give two examples of when an explicit cost is different from an implicit cost. In your own words, explain the difference between accounting and economic profit. Give two examples of when they differ. Finally, explain the difference between economies and diseconomies of scale. Provide examples of when an actual firm might benefit from economies of scale or be harmed by diseconomies of scale.
Explain the difference between implicit and explicit costs. Give two examples of when an explicit cost...
Explain the difference between implicit and explicit costs. Give two examples of when an explicit cost is different from an implicit cost. In your own words, explain the difference between accounting and economic profit. Give two examples of when they differ. Explain the difference between economies and diseconomies of scale. Provide examples of when an actual firm might benefit from economies of scale or be harmed by diseconomies of scale.
What is an example of an implicit and an explicit cost of raising children? In estimating...
What is an example of an implicit and an explicit cost of raising children? In estimating the housing cost of raising a child, should a child be assigned the same share of housing costs as any other member of the household (average total cost) or simply the cost of an extra bedroom (marginal cost)?
1. Give an example of when it might be best to use each of the following...
1. Give an example of when it might be best to use each of the following qualitative forecast techniques: a) Delphi method b) Jury of executive opinion c) Sales force composite d) Consumer market survey
determine wheter each of the followingis an explicit cost or an implicit cost
determine wheter each of the followingis an explicit cost or an implicit cost
1. Describe the impact of explicit and implicit costs in calculating accounting profit and economic profit....
1. Describe the impact of explicit and implicit costs in calculating accounting profit and economic profit. 2. Assume you are a business manager for a firm that does a few million dollars worth of business each year. Select the profit measure (accounting profit or economic profit) you believe provides the most helpful information in making business decisions, and explain why? Note: once again, no hedging your bet here by selecting both measures or combinations of both measures. :-) Select one...
What are the differences between implicit and explicit costs? Why do economists include implicit costs when...
What are the differences between implicit and explicit costs? Why do economists include implicit costs when determining economic profits? Do accountants include them? How can the inclusion of implicit costs help businesses and individuals select options that yield the greatest net benefits? Using the concept of implicit costs, explain how they affect the economic costs of attending college? Or starting your own business?
1. a) Distinguish between implicit and explicit deposit insurance. Give specific examples to illustrate their differences.(8...
1. a) Distinguish between implicit and explicit deposit insurance. Give specific examples to illustrate their differences. b) Explain the “moral hazard” behaviour induced by deposit insurance. c) Explain two (2) features that can be built into a deposit guarantee scheme to mitigate the moral hazard discussed in part (B).
1. Distinguish between explicit and implicit costs, giving 3 examples of each using the production of...
1. Distinguish between explicit and implicit costs, giving 3 examples of each using the production of higher education. 2. Which of the following are short-run and which are long-run adjustments? Freddie’s Frozen Custard builds 5 new restaurants. Pioneer Balloon Corporation hires 200 more production workers. Gaddert Farms increases the amount of fertilizer used on their corn crop. Boeing closes its manufacturing facility in Wichita, sells the plant and moves to Oklahoma City. 3. Answer all three parts: Why can the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT