Home » SQL & PL/SQL » SQL & PL/SQL » interview question (oracle 10g)
interview question [message #646943] Fri, 15 January 2016 02:26 Go to next message
san-deep
Messages: 2
Registered: January 2016
Location: INDIA
Junior Member
Please answer this it was asked in interview , thanks in advance Smile

there are three tables
a. Emp_master b. Emp_dtl c. Error_log
update title column 'Mr.' in a table where gender = MALE
update state column 'Telangana' in b table where state = ANDAHRA
total records is 50,000 . So use loop
if any type of error comming anywhere in the transaction rollback for that employee
and create error_log in the the table.

i.e if no error then data will be in a table and b table
and if error then no data in a table and b table but oracle_error should be in error_log table so that we can check what type of error came for that record.
Re: interview question [message #646944 is a reply to message #646943] Fri, 15 January 2016 02:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

1/ Never do in PL/SQL what you can do in SQL, so no loop
2/ What is your answer? or what you try to answer the question?

Re: interview question [message #646950 is a reply to message #646943] Fri, 15 January 2016 03:58 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Some suggestions:

Using the word "record" when you mean "row" would fail the interview, if I were in charge.
Question the use of PL/SQL rather than SQL (as MC said)
Look up the LOG ERRORS INTO clause of DML statements.

And just to do the Moderator bit:

Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read

Re: interview question [message #646951 is a reply to message #646950] Fri, 15 January 2016 04:10 Go to previous messageGo to next message
san-deep
Messages: 2
Registered: January 2016
Location: INDIA
Junior Member
is there anyone who could provide me the complete program code
i have to attend interview tommorow. its urgent
Re: interview question [message #646952 is a reply to message #646951] Fri, 15 January 2016 04:11 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Certainly not. That would be fraudulent. Not many people want to employ criminals.
Re: interview question [message #646971 is a reply to message #646952] Fri, 15 January 2016 12:43 Go to previous message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Most of us here are professionals. None of us would be willing to to help you cheat your way into a job that you're not qualified for. All that does is put added pressure on the department that you'd end up in, and take a job away from someone more capable than you.
Previous Topic: Odd case of removing duplicates within a set.
Next Topic: How to use minus, union for CLOB datatype column in Oracle?
Goto Forum:
  


Current Time: Fri Apr 26 17:42:07 CDT 2024