Optimized assignment

Este forum é dedicado a códigos errados que se encontram por aí, ou seja, coisas que não se deve fazer de jeito nenhum! Não coloque neste forum dúvidas! (apenas situações bizarras do nosso dia a dia :-)
Post Reply
DanielNN
Moderador
Moderador
Posts: 641
Joined: Mon, 03 Sep 2007 3:26 pm
Location: Fortaleza - CE
att,

Daniel N.N.

Look at what I found inside a package pa_hr_update_pa_entities of the Oracle Projects module;

Select all

... 
l_res_asgn_exists := 'N'; 
 
BEGIN 
SELECT 'Y' 
INTO   l_res_asgn_exists 
FROM   dual 
WHERE EXISTS (SELECT 'Y' 
              FROM   pa_resources_denorm 
              WHERE  person_id                     = l_person_id 
              AND    resource_effective_start_date = 
                                                 l_start_date_new); 
EXCEPTION WHEN NO_DATA_FOUND THEN 
  l_res_asgn_exists := 'N'; 
END; 
...

In addition to filling sausages unnecessarily in this artistic form,
even then, looking only at the result, it can still go wrong.
If any other exception be triggered from NO_DATA_FOUND Ferrou. :FOR.
User avatar
stcoutinho
Moderador
Moderador
Posts: 850
Joined: Wed, 11 May 2011 5:15 pm
Location: são Paulo - SP

My God, Noctifero.

Hugs,

Sergio Coutinho
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Remember when Microsoft programmers earned numbers of code lines.
That's why she had Easter Eggs everywhere.

CTRL SHIFT ALT BACSKPACE HOME -> shoots a tetris.

Heoheohe
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests