Skip to main content

Posts

JAVA: Anonymous Inner Class

Question: Give an example of Anonymous Inner Class. Answer: An event listener class can be created on the fly as an anonymous inner class, for example, addActionListener (new ActionListener()) { &nbsp&nbsp&nbsp&nbsppublic void actionPerformed (ActionEvent e) &nbsp&nbsp&nbsp&nbsp{ &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp//code here &nbsp&nbsp&nbsp&nbsp} };
Recent posts

PL/SQL: Save Exceptions

Question: Let's say you are doing a bulk operation of the type: ... FETCH my_cursor BULK COLLECT INTO my_collection; ... FORALL i IN 1..my_collection.COUNT INSERT INTO my_table my_collection(i).value; And some exception occurs, that is the code aborts at some point. Is there a way to save this? Answer: The SAVE EXCEPTIONS clause will record any exception during the bulk operation, and continue processing. ... some_number NUMBER; ... FORALL i IN 1..my_collection.COUNT SAVE EXCEPTIONS INSERT INTO my_table my_collection(i).value; ... EXCEPTION WHEN OTHERS THEN some_number := SQL%BULK_EXCEPTIONS.COUNT; FOR i IN 1..some_number LOOP DBMS_OUTPUT.PUT_LINE('Error ' || i || ', iteration ' || SQL%BULK_EXCEPTIONS(i).error_index || ' is: ' || SQLERRM(0 - SQL%BULK_EXCEPTIONS(i).error_code)); END LOOP;

PL/SQL: Full Outer Join

Question: You have two tables, A and B. You want to see data of both the tables, that is common together with the data that is not common between them. The data should not repeat. If the data is there in table A, but not table B, the output should show NULL values for B. Similarly, if the data is there in table B, but not table A, the output should show NULL values for A. Answer: Full Outer Join

Dear Jobseekers!

Hi! Welcome to this new blog of mine. This blog has a very simple and straight forward agenda. I will be dumping any interview questions here that I come across. Sources? My experience, my friends' experience, my colleagues experience, etc. etc. etc. I hope this helps the readers.