Wednesday, July 30, 2014

ADF and Time zone


I will implement this and come back to this later.

Time zone
http://adfnbpel.wordpress.com/2013/03/20/to-set-user-timezone-for-adf-datetime-fields/

Tuesday, July 29, 2014

How Language ISO and Locale ID works


"A language ID designates a written language (or orthography) and can reflect either the generic language or a specific dialect of that language. To specify a language ID, you use a language designator by itself. To specify a specific dialect of a language, you use a hyphen to combine a language designator with a region designator. Thus, the English language as it is spoken in Great Britain would yield a language ID of en-GB, while the English language spoken in the United States would have a language ID of en-US. To specify the generic version of the English language, you would use the language ID en by itself."


"A locale ID identifies a specific location where a given language is spoken. To specify a locale ID, use an underscore character to combine a language designator with a region designator. The locale ID for English-language speakers in Great Britain is en_GB, while the locale for English-speaking residents of the United States is en_US. Although locale IDs and language IDs might seem nearly identical, there is a subtle difference. A language ID identifies a written and spoken language only. A locale identifies a region and its conventions and has a more cultural context."


"To illustrate the difference between language IDs and locale IDs, consider the following example. The dialect for a resident of Great Britain is specified by the code en-GB. The commonly used locale for that same person is en_GB. If you wanted to be very precise when specifying the locale, you could specify the locale code as en-GB_GB. This specifies a person who speaks the British dialect of English and who resides in Great Britain. If that same person moved to the United States, the appropriate locale would been-GB_US, which would identify a person who speaks British English but uses the regional settings associated with the United States."

See https://developer.apple.com/library/mac/documentation/macosx/conceptual/bpinternational/Articles/LanguageDesignations.html
http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html

Tuesday, July 22, 2014

How to display date and time in ADF UI

In ADF, in order to display date + time in ADF UI, use <af:convertdatetime>:
<af:column filterable="true" headertext="#{bindings.View1.hints.DisplayDateTime.label}" id="c19" sortable="true" sortproperty="DisplayDateTime" width="150">
<f:facet name="filter">
<af:inputdate id="id6" value="#{vs.filterCriteria.DisplayDateTime}">
</af:inputdate></f:facet>
<af:outputtext id="ot33" value="#{row.DisplayDateTime}">
<af:convertdatetime datestyle="medium" locale="#{sessionScope.UserLocale}" pattern="#{bindings.View1.hints.DisplayDateTime.format}" timestyle="short" type="both"></af:convertdatetime></af:outputtext>
</af:column>

Monday, July 7, 2014

SQL error ORA-01722: invalid number tips

Usually this is because INSERT or UPDATE and the conversion from chars to number failed.

But when this is happened in SELECT statement:

It's probably because the implicit conversion in WHERE clause.

SELECT * 
FROM ( SELECT FLAG, TO_NUMBER ( NUM ) NUM 
FROM SUBTEST 
WHERE FLAG = 'N' ) 
WHERE NUM > 0 ;

See here