Decode cool ...

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
Diego_Mello
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 229
Joined: Fri, 05 Sep 2008 2:59 pm
Location: Igrejinha - RS
Diego Mello
Igrejinha - RS
www.twitter.com/diegolmello

Galera ...

Have a look at this code ...

Select all

SELECT  
DECODE ( v_setor 
       ,'1' 
       ,DECODE(:b_controle.fil_filial, '16', 'MONT', '3', 'MONT', '30', 'MONT', 'MONT')  <--- este!     
       ,'2' 
       ,'PRE' 
       ,'3' 
       ,'BORD' 
       ,'4' 
       ,'ATEL.' 
       ,'5' 
       ,'COST' 
       ,'6' 
       ,'CORTE') 
    INTO v_setor 
FROM dual;
Did you see that interesting decode?

He checks .. if it is filial 16, it brings Mont ...
if it is of the subsidiary 3, it brings Mont ...
if it is of the subsidiary 30, Brings Mont ...
If it is not any of them ... Bring Mont !!!

Incredible !!!
EiHEHAEUAHEIUAHEIUA
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

hehehe ... show !! :-O
rodcapella
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 19
Joined: Tue, 07 Jul 2009 10:26 am
Location: Rio de Janeiro - RJ
_________________
Rodrigo Póvoa
Analista de Sistemas Júnior
Oracle Developer

: -The: -O: -O
RodrigoValentim
Moderador
Moderador
Posts: 367
Joined: Tue, 25 Mar 2008 3:41 pm
Location: Salvador - BA
Rodrigo Valentim
Analista de Sistemas
Oracle Developer

Campanha: Faça uma pesquisa antes de perguntar!!!

Then deny complain that you get little ... I know you did not see!
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests