Seeking Oracle out of the matrix

Google
 
Web aboutoracle.blogspot.com
Oracle New Articles
Oracle Critical Patches
Oracle jDeveloper News
Oracle Blogs of interest


This blog records my personal experience.
Latest news from the front
               

Thoughts about oracle Author's note : Thank you all for your supporting letters. You have been a motivation to this web spot's posting. I wish you all the very best for you and your families for the new year.
Interested to know about a next post? You can suscribe to my RSS feed
HOW TO:

Resolution to the ORA-02262 error
Thursday, May 10, 2007
If you have ever faced this error message

ORA-02262: ORA-%05d occurs while type-checking column default value expression

while trying to alter the column definition of a table to NVARCHAR2 with Default Value just remember :

A 'string' literal is of type VARCHAR2
A N'string' literal is of type NVARCHAR2 !!

So now, you can correct your syntax and alter your table properly like this :

ALTER TABLE mytbl MODIFY mycolumn NVARCHAR2(3) DEFAULT N'A';

Labels:


posted by Admin @ 11:39 PM   2 comments
add to del.icio.us Digg it! Furl this! add to reddit! add to dzone!
Oracle Application Server 10.1.3 Bug when submitting Greek characters the result returns question marks
I remember back in the good old days of Oracle Application Server 10g R2 when i faced the same problem while developing in struts with jDeveloper 10g R2. It was indeed very difficult to finaly realize that a simple addition to orion-web.xml of the default-charset="windows-1253" would solve the problem so easily.

Now with the latest version of Oracle Application Server 10g R3 (10.1.3) i came across the same issue and i thought that i could easily solve the problem by simply doing the same thing.

I was wrong :-)

People, unfortunately i must warn you that this workaround doesn't apply to the R3 family. What you have to do now is to include


request.setCharacterEncoding("Windows-1253");


in all your JSP pages.

For those of you still developing in struts, i will show you a smarter way to automatically include this in all your pages without modifying any of these pages at all.

Have you ever "played" with the RequestProcessor ? The RequestProcessor has the ability to execute code before it goes to the Action Servlet. What you need to do here is extend the RequestProcessor so that it includes


request.setCharacterEncoding("Windows-1253");


in every call.

In jDeveloper 10g R3, create a new java class and write the following code :


package testgreek.view; //don't forget to change the name of the package to the
//one that you are using

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.RequestProcessor;

public class CustomRequestProcessor extends RequestProcessor {
protected boolean processPreprocess (HttpServletRequest request, HttpServletResponse response) {


try{
request.setCharacterEncoding("Windows-1253");
}
catch(Exception ex){
//.....
}

return true;
}

protected void processContent(HttpServletRequest request,
HttpServletResponse response) {
try{
request.setCharacterEncoding("Windows-1253");
}
catch(Exception ex){
//........
}
super.processContent(request, response);
}
}


Then, go to your struts-config.xml and add the following property to your controller :


<controller>
<set-property property="processorClass" value="testgreek.view.CustomRequestProcessor">
</controller>


That's it. Now every time you submit a page to the servlet, it includes the character encoding that you have selected.
That means no more ????

Labels: , , , , , , , ,


posted by Admin @ 10:19 PM  
add to del.icio.us Digg it! Furl this! add to reddit! add to dzone!
About Me

Name: John Galanopoulos
Home: The NeverLands
About Me: A source code wonderer since the early 80s with my first ZX81 by Sinclair, home computer.
See my complete profile
Previous Post
Archives
Links
ΣΚΛΗΡΥΝΣΗ ΚΑΤΑ ΠΛΑΚΑΣ - ΕΓΚΕΦΑΛΟΣ - ΕΓΚΕΦΑΛΟΓΡΑΦΗΜΑ - ΑΝΟΙΑ - ΝΕΥΡΟΛΟΓΟΣ - ΨΥΧΙΑΤΡΟΣ - ΛΟΙΜΩΔΗΣ ΜΟΝΟΠΥΡΗΝΩΣΗ - ΠΑΡΚΙΝΣΟΝ - ΑΓΧΟΣ - ΚΑΤΑΘΛΙΨΗ - ALZHEIMER - EPSTEIN BARR Eurolife
Email notification

Enter your email address and get notified whenever there is a new post:

Delivered by FeedBurner

This website abides by a strict policy : no spam, just posts; and that's a promise.

Powered by

Free Blogger Templates

BLOGGER


Register for a skinnyscore at www.blogskinny.com and increase traffic
Software Blogs -  Blog Catalog Blog Directory

© 2005 Seeking Oracle out of the matrix Template by Isnaini Dot Com