working on it ...

Filters

Explore Public Snippets

Sort by

Found 2 snippets

    public by DinhoPutz modified Jan 30, 2019  32  2  3  0

    Função para converter minutos para horas (SQL Oracle)

    PLSQL - SQL Oracle
    -- Criando nova função
    create or replace function converter (
        numero in  number 
    ) return varchar2
    is
        minutos varchar2(10);
    begin
        
    return 
    
    	case length 
        
         (case instr((numero / 60), '.')  
            when 2 then '0'  || substr((numero / 60), 1 ,1)
            when 3 then substr((numero / 60), 1 ,2)
        else to_char(numero / 60)
        end || '.' || lpad(mod(numero, 60), 2, 0))  
    	
    			when 4 then '0' || 
    			case instr((numero / 60), '.')  
    			when 2 then '0'  || substr((numero / 60), 1 ,1)
    			when 3 then substr((numero / 60), 1 ,2)
    		else to_char(numero / 60)
        end || '.' || lpad(mod(numero, 60), 2, 0) 
       
       else 
    		 case instr((numero / 60), '.')  
    			when 2 then '0'  || substr((numero / 60), 1 ,1)
    			when 3 then substr((numero / 60), 1 ,2)
    		else to_char(numero / 60)
        end || '.' || lpad(mod(numero, 60), 2, 0)   -- temos os minutos
       
       end ;
        
    end converter;
    /
    
    
    select  converter(valor), valor as valors from horario where  valor is not null

    public by snip2code modified Aug 13, 2017  596  4  4  0

    First Snippet: How to play with Snip2Code

    This is the first example of a snippet: - the title represents in few words which is the exact issue the snippet resolves; it can be something like the name of a method; - the description (this field) is an optional field where you can add interesting information regarding the snippet; something like the comment on the head of a method; - the c
    /* place here the actual content of your snippet. 
       It should be code or pseudo-code. 
       The less dependencies from external stuff, the better! */

    List Complete ( 2 snippets total )

    Cannot find what you were looking for?
    Ask the Snip2Code Community

    • Public Snippets
    • Channels Snippets