Updating record from cursor oracle Sexchat rulet

Due to a lack of validation on our front-end, we've received a file to process that contains a zero divisor for two customers.

This will cause two iterations of our FORALL statement to error but rather than fail the entire transaction, we will report the errors (in a production system you would probably store these off in an exceptions table) and allow the "clean" data to process through. LAST SAVE EXCEPTIONS 24 UPDATE customers 25 SET credit_limit = credit_limit/aa_divisors(i) 26 WHERE customer_id = aa_ids(i); 27 28 DBMS_OUTPUT.

For example, if we wanted to INSERT a record into a table pre-9i, we would have to build a potentially lengthy VALUES statement containing all the relevant "record.attribute" listings.

Now in 9i we can simply supply the record, assuming it meets with the INSERT target's column definition.

*/ 19 FETCH cv BULK COLLECT INTO aa_objects; 20 21 /* 22 * Not passing the ref cursor to a client 23 * in this example so close it... Until 9i, we could only BULK COLLECT columns of scalar types or single instances of object types (i.e. In keeping with 9i's extended support for record-based operations, we can now BULK COLLECT a collection of records stored in a table into either an associative array or collection variable.

Last modified 19-Aug-2020 18:14