What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?

1 Answer

Answer :

A cursor declared in a package specification is global and can be
accessed by other procedures or procedures in a package.
A cursor declared in a procedure is local to the procedure that can not
be accessed by other procedures.

Related questions

Description : Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.

Last Answer : A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any ... functions and procedures that are grouped together based on their commonality to a business function or application.

Description : What is the difference between restricted and unrestricted package procedure ?

Last Answer : Restricted package procedure that affects the basic functions of SQL * Forms. It cannot used in all triggers except key triggers. Unrestricted package procedure that does not interfere with the basic functions of SQL * Forms it can be used in any triggers.

Description : When the form is running in DEBUG mode, If you want to examine the values of global variables and other form variables, What package procedure command you would use in your trigger text ?

Last Answer : Break. SYSTEM VARIABLES

Description : What package procedure is used for calling another form ?

Last Answer : Call (E.g. Call(formname)

Description : What ERASE package procedure does ?

Last Answer : Erase removes an indicated global variable.

Description : Name the tables where characteristics of Package, procedure and functions are stored ?

Last Answer : User_objects, User_Source and User_error.

Description : What are the different types of Package Procedure ?

Last Answer : 1. Restricted package procedure. 2. Unrestricted package procedure.

Description : What is a Package Procedure ?

Last Answer : A Package procedure is built in PL/SQL procedure.

Description : What Enter package procedure does ?

Last Answer : Enter Validate-data in the current validation unit.

Description : What package procedure used for invoke sql *plus from sql *forms ?

Last Answer : Host (E.g. Host (sqlplus))

Description : Can we use a restricted package procedure in ON-VALIDATE-FIELD Trigger ?

Last Answer : No

Description : What the PAUSE package procedure does ?

Last Answer : Pause suspends processing until the operator presses a function key

Description : EXIT_FORM is a restricted package procedure ?a. True b. False

Last Answer : True

Description : Difference between an implicit & an explicit cursor.?

Last Answer : only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop. Explicit cursor is a cursor in which the cursor name is explicitly ... statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO

Description : What are savepoint mode and cursor mode properties ? level?

Last Answer : Specifies whether Oracle Forms should issue savepoints during a session. This property is included primarily for applications that will run against non-ORACLE data sources. For applications that will run ... use the default setting. Cursor mode - define cursur state across transaction Open/close.

Description : What are attributes of cursor?

Last Answer : %FOUND , %NOTFOUND , %ISOPEN,%ROWCOUNT

Description : What are cursor attributes?

Last Answer : %ROWCOUNT -%NOTFOUND -%FOUND -%ISOPEN

Description : What is use of a cursor variable? How it is defined?

Last Answer : A cursor variable is associated with different statements at run time, which can hold different values at run time. Static cursors can only be associated with one run time query. A cursor ... indicating the types of the select list that will eventually be returned by the cursor variable.

Description : What is a cursor for loop?

Last Answer : Cursor For Loop is a loop where oracle implicitly declares a loop variable, the loop index that of the same record type as the cursor's record.

Description : How you were passing cursor variables in PL/SQL 2.2?

Last Answer : In PL/SQL 2.2 cursor variables cannot be declared in a package.This is because the storage for a cursor variable has to be allocated using Pro*C or OCI with version 2.2, the only means of passing a cursor variable to a PL/SQL block is via bind variable or a procedure parameter.

Description : What WHERE CURRENT OF clause does in a cursor?

Last Answer : LOOP SELECT num_credits INTO v_numcredits FROM classes WHERE dept=123 and course=101; UPDATE students FHKO;;;;;;;;;SET current_credits=current_credits+v_numcredits WHERE CURRENT OF X;

Description : Can cursor variables be stored in PL/SQL tables.If yes how. If not why?

Last Answer : No, a cursor variable points a row which cannot be stored in a two- dimensional PL/SQL table.

Description : How you open and close a cursor variable.Why it is required?

Last Answer : OPEN cursor variable FOR SELECT...Statement CLOSE cursor variable In order to associate a cursor variable with a particular SELECT statement OPEN syntax is used. In order to free the resources used for the query CLOSE statement is used.

Description : What is a cursor?

Last Answer : Oracle uses work area to execute SQL statements and store processing information PL/SQL construct called a cursor lets you name a work area and access its stored information A cursor is a mechanism used to fetch more than one row in a Pl/SQl block.

Description : What a SELECT FOR UPDATE cursor represent.?

Last Answer : SELECT......FROM......FOR......UPDATE[OF column-reference][NOWAIT] The processing done in a fetch loop modifies the rows that have been retrieved by the cursor. A convenient way of ... the FOR UPDATE clause in the cursor declaration, WHERE CURRENT OF CLAUSE in an UPDATE or declaration statement.

Description : What should be the return type for a cursor variable.Can we use a scalar data type as return type?

Last Answer : The return type for a cursor must be a record type.It can be declared explicitly as a user-defined or %ROWTYPE can be used. eg TYPE t_studentsref IS REF CURSOR RETURN students%ROWTYPE

Description : What are the cursor attributes used in PL/SQL ?

Last Answer : %ISOPEN - to check whether cursor is open or not % ROWCOUNT - number of rows fetched/updated/deleted. % FOUND - to check whether cursor has fetched any row. True if rows are ... featched. These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.

Description : What is a cursor for loop ?

Last Answer : Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes when all the records have been processed. eg. FOR emp_rec IN C1 LOOP salary_total := salary_total +emp_rec sal; END LOOP;

Description : What is a cursor ? Why Cursor is required ?

Last Answer : Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.

Description : What are the PL/SQL Statements used in cursor processing ?

Last Answer : DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.

Description : A sales representative from a software company shows an accounting firm that a new software package can perform bookkeeping tasks that the firm's present package cannot. The accounting firm ... ? A)problem recognition B)product specification C)product supplier search D)product selection

Last Answer : A)problem recognition

Description : Difference between procedure and function.?

Last Answer : Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.

Description : What is difference between a PROCEDURE & FUNCTION ?

Last Answer : A FUNCTION is always returns a value using the return statement. A PROCEDURE may return one or more values through parameters or may not return at all.

Description : You have just compiled a PL/SQL package but got errors, how would you view the errors?

Last Answer : SHOW ERRORS

Description : What is a Package ?

Last Answer : A Package is a collection of related procedures, functions, variables and other package constructs together as a unit in the database.

Description : What are the advantages of having a Package ?

Last Answer : Increased functionality (for example,global package variables can be declared and used by any proecdure in the package) and performance (for example all objects of the package are parsed compiled, and loaded into memory once)

Description : What is a package ? What are the advantages of packages ? What is Pragma EXECPTION_INIT ? Explain the usage ?

Last Answer : The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error. e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)

Description : What are two parts of package ?

Last Answer : The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY. Package Specification contains declarations that are global to the packages and local to the schema. Package Body contains actual procedures and local declaration of the procedures and cursor declarations.

Description : Identify package function from the following ?

Last Answer : 1. Error- Code 2. Break 3. Call 4. Error-text 5. Form-failure 6. Form-fatal 7. Execute-query 8. Anchor View 9. Message_code? 1. Error_Code 2. Error_Text 3. Form_Failure 4. Form_Fatal 5. Message_Code

Description : Error_Code is a package proecdure ?

Last Answer : a. True b. false False

Description : Can we use GO-BLOCK package in a pre-field trigger ?

Last Answer : No

Description : What is a Text_io Package?

Last Answer : It allows you to read and write information to a file in the file system.

Description : What does DBMS_FGA package do?

Last Answer : The DBMS_FGA package provides fine-grained security functions. DBMS_FGA is a PL/SQL package used to define Fine Grain Auditing on objects. DBMS_FGA Package Subprograms: ▪ ADD_POLICY Procedure - ... DROP_POLICY Procedure - Drops an audit policy ▪ ENABLE_POLICY Procedure - Enables an audit policy

Description : Features to be tested, approach, item pass/fail criteria and test deliverables should be specified in which document? a) Test case specification b) Test procedure specification c) Test plan d) Test design specification

Last Answer : c) Test plan

Description : What are the two parts of a procedure ?

Last Answer : Procedure Specification and Procedure Body.

Description : What are Procedure,functions and Packages

Last Answer : Procedures and functions consist of set of PL/SQL statements that are grouped together as a unit to solve a specific problem or perform set of related tasks. Procedures do not ... Provide a method of encapsulating and storing related procedures, functions, variables and other Package Contents

Description : Use the ADD_GROUP_ROW procedure to add a row to a static record group? I) TRUE II)FALSE

Last Answer : I) FALSE

Description : What is syntax for dropping a procedure and a function .Are these operations possible?

Last Answer : Drop Procedure procedure_name Drop Function function_name

Description : What is a Procedure ?

Last Answer : A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks.

Description : What is a stored procedure ?

Last Answer : A stored procedure is a sequence of statements that perform specific function.