Error depending on date

Dicas e truques sobre Oracle Reports Builder - modo gráfico ou modo caractere, ascii, arquivo .PRT, etc
Post Reply
Sanderson
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Tue, 26 Sep 2006 5:06 pm
Location: Porto Velho - RO

Someone can help me and say what is wrong with the following code:

Select all

function CF_DATA_EXTENSOFormula return Char is 
  mês_extenso varchar(50); 
begin 
  RETURN  ( 'Porto Velho, '||TO_CHAR(SYSDATE,'DD')||' de '||INITCAP(LOWER(mês_EXTENSO(TO_CHAR(SYSDATE,'MM'))))||' de '||TO_CHAR(SYSDATE,'YYYY')); 
end;

Thanks
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

Well, as I do not have the mês_extensum function, I could not test here. But look: it's a lot easier to use the to_char to leave it extensive!

Select all

SQL> SELECT TO_CHAR( SYSDATE , 'Month' , 'NLS_DATE_LANGUAGE=PORTUGUESE' ) 
  2  FROM DUAL 
  3  / 
 
TO_CHAR(S 
--------- 
Outubro 
 
SQL> 
No need of INITCAP. Read this topic for you to find out more about the dates: http://en.glufke.net/oracle/viewtopic.php?t=22
Sanderson
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Tue, 26 Sep 2006 5:06 pm
Location: Porto Velho - RO

Really using the toar was much better.

Thanks
User avatar
adrianoturbo
Moderador
Moderador
Posts: 393
Joined: Thu, 20 Mar 2008 4:09 pm
Location: Brasília
Adriano Alves
---Para cada problema dificil existe uma solução simples.----

I was doing a select to bring right by extensive the date with the to_char function (a hand on the wheel), good I just did.
Follow the train running for people test:

Select all

SELECT TO_CHAR(DT_NASC,'"Brasília" DD "de" Month" de "YYYY','NLS_DATE_LANGUAGE=PORTUGUESE' ) 
 FROM CLIENTE
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests