Advertisement

03.03.2006 at 06:40AM PST, ID: 21759367
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

2.2

Problem with a PL/slq statement

Asked by radical_mit in Oracle Database

Tags:

Hi ALL,

I have a pl/sql statement. The idea is to update the M_NAME table, with the information in the t_load_con table. The problem I have is that I have 1M records in the t_load_con table. when I run the statement below. It up dates all of the recordsin the M_NAME . I do not understand why, all the records are updated. The idea behind the statement, is that if there are any new information with the the t_load_con table it updates/add to  the master record.

Please could an expert try and point me in the correct direction.
Thanks
T
++++++++++++++++++++++++++++++++++++++
declare

counter number ;
BEGIN
counter :=0 ;
FOR LOAD IN (SELECT * FROM t_LOAD_con )

LOOP    
FOR MAST IN (SELECT * FROM m_name  WHERE LAST_NAME=LOAD.LAST_NAME AND
           STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and PLZ = LOAD.PLZ )    
LOOP
IF (MAST.LAST_NAME=LOAD.LAST_NAME
        and MAST.STREET=LOAD.STREET
      and MAST.HSE_NR = LOAD.HSE_NR
      and MAST.PLZ = LOAD.PLZ)
  THEN UPDATE m_name SET WHERE_FROM='33b' ;
END IF;

IF ( MAST.TOWN is NULL and LOAD.CITY is not NULL  )
  or ( MAST.TOWN !=LOAD.CITY and LOAD.CITY is not NULL)
  THEN  UPDATE m_name SET TOWN=LOAD.CITY
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
IF ( MAST.TELEPHONE_1 is NULL and LOAD.TELEPHONE1 is not NULL )
  or ( MAST.TELEPHONE_1 != LOAD.TELEPHONE1 and LOAD.TELEPHONE1 is not NULL)
  THEN  UPDATE m_name SET TELEPHONE_1=LOAD.TELEPHONE1  
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;
IF ( MAST.TELEPHONE_2 is NULL and LOAD.TELEPHONE2 is not NULL )
  or ( MAST.TELEPHONE_2 != LOAD.TELEPHONE2 )
  THEN UPDATE m_name SET TELEPHONE_2=LOAD.TELEPHONE2  
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;
IF ( MAST.TELEPHONE_3 is NULL and LOAD.TELEPHONE3 is not NULL )
  or ( MAST.TELEPHONE_3 != LOAD.TELEPHONE3 and LOAD.TELEPHONE3 is not NULL)
  THEN UPDATE m_name SET TELEPHONE_3=LOAD.TELEPHONE3
   where MAST.LAST_NAME=LOAD.LAST_NAME AND STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
IF ( MAST.TELE_TXT_1 is NULL and LOAD.TEL_TEXT1 is not NULL )
  OR ( MAST.TELE_TXT_1 != LOAD.TEL_TEXT1 and LOAD.TEL_TEXT1 is not NULL )
  THEN UPDATE m_name SET TELE_TXT_1=LOAD.TEL_TEXT1
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
IF ( MAST.TELE_TXT_2 is NULL and LOAD.TEL_TEXT2 is not NULL  )
  OR ( MAST.TELE_TXT_2 != LOAD.TEL_TEXT2 and LOAD.TEL_TEXT2 is not NULL )
  THEN UPDATE m_name SET TELE_TXT_2=LOAD.TEL_TEXT2
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
IF ( MAST.TELE_TXT_3 is NULL and LOAD.TEL_TEXT3 is not NULL  )
  OR   ( MAST.TELE_TXT_3 != LOAD.TEL_TEXT3 and LOAD.TEL_TEXT3 is not NULL )
  THEN UPDATE m_name SET TELE_TXT_3=LOAD.TEL_TEXT3
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;
IF ( MAST.HOMEPAGE is NULL and LOAD.HOMEPAGE is not NULL   )
  OR ( MAST.HOMEPAGE != LOAD.HOMEPAGE and LOAD.HOMEPAGE is not NULL )
  THEN UPDATE m_name SET HOMEPAGE=LOAD.HOMEPAGE  
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
IF ( MAST.COUNTRY is NULL and LOAD.COUNTRY is not  NULL)
  OR  ( MAST.COUNTRY != LOAD.COUNTRY and LOAD.COUNTRY is not NULL)
  THEN UPDATE m_name SET COUNTRY=LOAD.COUNTRY
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;
IF ( MAST.CANTON is NULL and LOAD.CANTON is not NULL)
  OR  ( MAST.CANTON != LOAD.CANTON and LOAD.CANTON is not NULL )
  THEN UPDATE m_name SET CANTON=LOAD.CANTON  
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;
IF ( MAST.TITTLE is NULL and LOAD.TITLE is not NULL )
  OR ( MAST.TITTLE != LOAD.TITLE and LOAD.TITLE is not NULL)
  THEN UPDATE m_name SET TITTLE=LOAD.TITLE  
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
IF ( MAST.eMail is NULL and LOAD.EMAIL is not NULL )
  Or ( MAST.eMail != LOAD.EMAIL and LOAD.EMAIL is not NULL )
  THEN UPDATE m_name SET eMail=LOAD.EMAIL
   where MAST.LAST_NAME=LOAD.LAST_NAME AND MAST.STREET=LOAD.STREET and HSE_NR=LOAD.HSE_NR and MAST.PLZ = load.plz ;
END IF;      
      
counter:=counter+1;
if counter > 10000 then   commit ;
         counter:=0 ;
      end if ;    END LOOP;
COMMIT;
END LOOP;
EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/
Start Free Trial
 
Loading Advertisement...
 
[+][-]03.03.2006 at 07:33AM PST, ID: 16095263

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 07:34AM PST, ID: 16095284

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:05AM PST, ID: 16095632

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:12AM PST, ID: 16095695

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:25AM PST, ID: 16095808

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:27AM PST, ID: 16095827

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:30AM PST, ID: 16095855

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:52AM PST, ID: 16096063

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:53AM PST, ID: 16096083

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 08:59AM PST, ID: 16096142

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.03.2006 at 09:07AM PST, ID: 16096242

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.03.2006 at 10:30AM PST, ID: 16096970

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.09.2006 at 09:23AM PST, ID: 16146683

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.09.2006 at 09:24AM PST, ID: 16146697

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.10.2006 at 04:45AM PST, ID: 16153859

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.13.2006 at 12:53PM PST, ID: 16177766

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2006 at 02:39AM PST, ID: 16182401

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2006 at 04:35AM PST, ID: 16182949

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2006 at 07:20AM PST, ID: 16184166

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2006 at 07:50AM PST, ID: 16184523

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.14.2006 at 12:47PM PST, ID: 16187789

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: loop
Sign Up Now!
Solution Provided By: jazzyline
Participating Experts: 4
Solution Grade: C
 
 
[+][-]04.05.2006 at 11:33PM PDT, ID: 16389328

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.06.2006 at 01:02AM PDT, ID: 16389670

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2006 at 03:56AM PDT, ID: 16415995

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.11.2006 at 08:40AM PDT, ID: 16428000

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.17.2006 at 09:30AM PDT, ID: 16470290

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.20.2006 at 08:29AM PDT, ID: 16499255

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2006 at 02:15AM PDT, ID: 16568337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.26.2006 at 01:40AM PDT, ID: 16767426

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42