What is diff between bulk collect and forall
Answers were Sorted based on User's Feedback
Answer / prabu t
Bulk collect:
*is a CLAUSE
*is used to fetch the records from the cursor.
Forall:
*is a STATEMENT
*is used to do dml operation of fetched records.
*The body of the FORALL statement is a single DML statement
-- an INSERT, UPDATE, or DELETE.
| Is This Answer Correct ? | 21 Yes | 1 No |
Answer / prabhudatta barick
#"The keywords BULK COLLECT tell the SQL engine to bulk-bind output collections before returning them to the PL/SQL engine.
#You can use these keywords in the SELECT INTO, FETCH INTO, and RETURNING INTO clauses. Here is the syntax:
... BULK COLLECT INTO collection_name[, collection_name] ..."
#"The keyword FORALL instructs the PL/SQL engine to bulk-bind input collections before sending them to the SQL engine.
Although the FORALL statement contains an iteration scheme, it is not a FOR loop. Its syntax follows:
FORALL index IN lower_bound..upper_bound
sql_statement;
The index can be referenced only within the FORALL statement and only as a collection subscript.
The SQL statement must be an INSERT, UPDATE, or DELETE statement that references collection elements. And, the bounds must specify a valid range of consecutive index numbers.
The SQL engine executes the SQL statement once for each index number in the range."
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / shweta singh
BULK COLLECT: SELECT statements that retrieve multiple rows with a single fetch, improving the speed of data retrieval
FORALL: INSERTs, UPDATEs, and DELETEs that use collections to change multiple rows of data very quickly.
| Is This Answer Correct ? | 2 Yes | 0 No |
is it possible to pass an object or table to a procedure as an argument?
How do you change a value in sql?
What is a unique key?
Create a procedure to delete certain records from a table and display the total number of records deleted in this process. (Condition for deletion can be of ur choice, for instance delete all records where eid='')
How do you delete duplicates in sql query using rowid?
can i give user defined exception in a package
How will you distinguish a global variable with a local variable in pl/sql?
How do you run a query?
What is a schema? How is it useful in sql servers?
Is null operator in sql?
how to select alphabets in a one column , for this the table name is PA_TASKS and column name is TASK_NUMBER, In TASK_NUMBER the data like this 1.1.3NN,1.1.4NN,1.5.1NN,1.3.2NE,1.5NN,1NN,1.2NE,1CE , For this i need to disply output as NN,NN,NN,NE,NN,NN,NE,CE, Its some urgent requirement ,thanks in advance
How do I add a primary key to a table?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)