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

1 Answer

Answer :

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

Related questions

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 : 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 : 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 the basic structure of PL/SQL ?

Last Answer : PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.

Description : What are the datatypes a available in PL/SQL ?

Last Answer : Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN. Some composite data types such as RECORD & TABLE.

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

Last Answer : SHOW ERRORS

Description : What command would you use to encrypt a PL/SQL application?

Last Answer : WRAP

Description : What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?

Last Answer : Procedures and Functions,Packages and Database Triggers.

Description : What are the components of a PL/SQL block ?

Last Answer : A set of related declarations and procedural statements is called block.

Description : What are the components of a PL/SQL Block ?

Last Answer : Declarative part, Executable part and Exception part.Datatypes PL/SQL

Description : Explain how procedures and functions are called in a PL/SQL block ?

Last Answer : Function is called as part of an expression. sal := calculate_sal ('a822'); procedure is called as a PL/SQL statement calculate_bonus ('A822');

Description : Question What is PL/SQL ?

Last Answer : PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.

Description : What are the two panes that Appear in the design time pl/sql interpreter?

Last Answer : 1. Source pane. 2. Interpreter pane

Description : What are three panes that appear in the run time pl/sql interpreter?

Last Answer : 1. Source pane. 2. interpreter pane. 3. Navigator pane.

Description : Where is a procedure return in an external pl/sql library executed at the client or at the server?

Last Answer : At the client.

Description : Does PL/SQL support “overloading”? Explain

Last Answer : The concept of overloading in PL/SQL relates to the idea that you can define procedures and functions with the same name. PL/SQL does not look only at the referenced name, however, ... Prefacing a procedure or function name with the package name fully qualifies any procedure or function reference.

Description : Is it possible to insert comments into sql statements return in the data model editor?

Last Answer : Yes

Description : How many types of Sql Statements are there in Oracle

Last Answer : There are basically 6 types of sql statments.They are a) Data Defination Language(DDL) :: The DDL statments define and maintain objects and drop objects. b) Data Manipulation Language(DML) :: The DML ... e.g:: Using the Sql Statements in languages such as 'C', Open,Fetch, execute and close

Description : What are the factors causing the reparsing of SQL statements in SGA?

Last Answer : Due to insufficient Shared SQL pool size. Monitor the ratio of the reloads takes place while executing SQL statements. If the ratio is greater than 1 then increase the SHARED_POOL_SIZE. LOGICAL & PHYSICAL ARCHITECTURE OF DATABASE.

Description : What are the factors causing the reparsing of SQL statements in SGA?

Last Answer : Due to insufficient shared pool size. Monitor the ratio of the reloads takes place while executing SQL statements. If the ratio is greater than 1 then increase the SHARED_POOL_SIZE.

Description : I understand what the PL/SQL code below is supposed to do, but when I run the code, it won't compile. Can anybody help with why this is so?

Last Answer : answer:PL\SQL really isn’t my thing, but I believe you need something between the first IF statement and the ELSIF. What do you want it to do with the number if it is 50 or 90?

Description : Does anyone here have experience working with PL/SQL? I need some help getting started...

Last Answer : answer:PL/SQL is Oracle's take on SQL. It's mostly vanilla SQL, but with some Oracle-specific twists. You need Oracle SQL Developer or something similar. I doubt other relational ... more closely resembling a true object-oriented language, so make sure you get something Oracle-specific!.

Description : Python has a SQL-like querylanguage called ________- a) GQLb) PL SQL c) NOSQL d) JDBC

Last Answer : GQL

Description : What is the significance of the & and && operators in PL SQL ?

Last Answer : The & operator means that the PL SQL block requires user input for a variable. The && operator means that the value of this variable should be the same as inputted by the user previously ... span across different rollback segments or will it terminate ? It will terminate (Please check ).

Description : Can you have two functions with the same name in a PL/SQL block

Last Answer : Yes.

Description : Identify the DBMS among the following. (1) MS-Access (2) MS-Power Point (3) PL/SQL (4) MS-Excel

Last Answer : PL/SQL

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 : 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 : 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 : 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 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 is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?

Last 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.

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 types of SQL Statement ?

Last Answer : Data Definition Language : CREATE,ALTER,DROP,TRUNCATE,REVOKE,NO AUDIT & COMMIT.

Description : How does one use ORADEBUG from Server Manager/ SQL*Plus? (for DBA

Last Answer : Execute the "ORADEBUG HELP" command from svrmgrl or sqlplus to obtain a list of valid ORADEBUG commands. Look at these examples: SQLPLUS> REM Trace SQL statements with bind variables SQLPLUS> oradebug ... oradebug lkdebug -a convres SQLPLUS> oradebug lkdebug -r (i.e 0x8066d338 from convres dump)

Description : What is the difference between the SQL*Loader and IMPORT utilities?

Last Answer : These two Oracle utilities are used for loading data into the database. The difference is that the import utility relies on the data being produced by another Oracle utility EXPORT while the SQL* ... from different data sources just so long as it conforms to ASCII formatted or delimited files.

Description : Can you use select in FROM clause of SQL select ?

Last Answer : Yes.

Description : maxvalue.sql Select the Nth Highest value from a table?

Last Answer : select level, max('col_name') from my_table where level = '&n' connect by prior ('col_name') > 'col_name') group by level; Example: Given a table called emp with the following columns: -- id number -- name ... , max(sal) from emp -- where level=2 -- connect by prior sal > sal -- group by level

Description : What are various constraints used in SQL?

Last Answer : NULL -NOT NULL -CHECK -DEFAULT

Description : minvalue.sql Select the Nth lowest value from a table?

Last Answer : select level, min('col_name') from my_table where level = '&n' connect by prior ('col_name') < 'col_name') group by level; Example: Given a table called emp with the following columns: -- id number -- name ... , min(sal) from emp -- where level=2 -- connect by prior sal < sal -- group by level

Description : What is difference between SQL and SQL*PLUS?

Last Answer : SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a command line tool that allows user to type SQL commands to be executed directly against an Oracle ... SQL*PLUS commands are used to format query result, Set options, Edit SQL commands and PL/SQL.

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

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

Description : What is an SQL *FORMS ?

Last Answer : SQL *forms is 4GL tool for developing and executing; Oracle based interactive application.