Monday, December 18, 2006

Dev : CVS vs VSS

Virtual Source Safe (a.k.a. VSS) and Concurrent Versions System (a.k.a. CVS), which one you prefer?

In general, VSS will lock a file for a user, and this will make sure no one will use the file until the current user checks it in. In the downside, when a user checked out the file for a long time, this means that other user have to wait for a long time too if they wanted to use it.

There are more comparisons we can get online, this is one of them.

Friday, December 15, 2006

ORA-00911: invalid character

ORA-00911: invalid character, I've been seeing this error message for 2 long, headache days. What is wrong with my SQL coding?

At first, I thought it was the values that I have inserted were wrong. After much checking, I decided to print out the whole query, copy it and put it into the Oracle SQL client to see what is fxxking wrong.

Test and test and test and retest. No! My query is totally correct to me, but it keep saying that I am wrong, even using Oracle SQL client! So my last resort for this is to remove each of the character in the query one by one. And there is it, the stupid ";" (semicolon) at the end of the query which cause all the misery!

Wednesday, December 13, 2006

Error: Object doesn't support this property or method

I was wondering for quite a while when I hit a javascript error. It stated "Error: Object doesn't support this property or method". The error was in this function, the line which has the word action:

function InsertRecord(){

var myForm = document.form1;

myForm.action="xxxxxxxxxxxx";
myForm.submit();
}

Lucky for me, my sifu, Steven, helped me out on this. My problem was actually a simple and silly error. What I done wrong was:

<button name="action" value="Attachment">

I have actually define one of my button in the form with the name of "action". After changing the name to a more meaningful one, it works once again. :-)

Tuesday, November 28, 2006

Signal Before You Turn

This morning while I was having my breakfast near a market area, out of a sudden, "bang~~crrraaanggg....". A motorcycle hit a car at the side! Luckily, the motocyclist and his pillion rider was not hurt bad. A few bruises thats all.

The point I am saying this is because nowadays, car signal had become useless to many drivers. They don't even bother to use it. Not until anything had happen. Some drivers are even smarter. They switch it on while turning, not before.

I felt sorry for the poor motorcyclist as I have experience the same thing before. For my case, a try to negotiate the driver to pay for my motorcycle maintenance, and if he would not do it, then I will file a police report on him. But later on, he tried to threaten me with my "Professional" sticker on my bike. He say if I were to report, I will have trouble with getting a valid licence. I quickly answer that the "P" was not mine as I have gotten my valid licence years ago. Only then, he agreed to pay me. Whew.... I was actually quite scared because it was 2 people against me. None of the busybodies who witness the incident stopped to help.

Friday, November 24, 2006

Not Clever Enough

Have you ever use Oracle's Exp to backup a user? It will ask you to specify file name, export grant, yadda, yadda, yadda....

Just right before the end, Exp will once again request the user to enter the user name or press return to exit. Normally, if we were to backup a user call "sample_database", we will type "sample_database" at the end and when Exp request user once again, we will just hit the return key to start a process.

But... have you tried to enter the same user twice? Oracle's Exp will just cleverly export the user twice, making the size of export double as well.

Monday, November 20, 2006

Same Name, Same Directory?

Today when I was checking on some system log files, I came across with one unexplainable phenomenon. There are 2 files with the same name in the same directory!


This image had not been edited or photoshoped or what so ever. This is captured from a telnet terminal. It is running on Solaris 10. Anyone has any idea what is happening?

Wednesday, November 08, 2006

Five Square Boxes At The Lower Right Of Internet Explorer

Have you all notice there are 5 small square boxes at the lower right of Internet Explorer? Any idea what is that for? I have tried double clicked it, and yes, it does response. HA~~~

Nothing for the first box. Second box will allow to toggle and configure the pop-up blocker. Third box will allow you to manage your IE add-on. What is IE add-on you may ask. IE add-on is some program that is installed to run together with your IE. Such as google toolbar, Yahoo toolbar, Microsoft Developer toolbar and many more.

The forth box does not seems to appear anything. Last but not least, the fifth box shows you the security certificates for a secure website, if there is any.

p/s: These elaboration is from my own understanding. If you have more ideas on it, please leave a comment for me.

Monday, November 06, 2006

ORA-01441: cannot decrease column length because some value is too big

One day when you suddenly found that a field in a table that you have inserted eons ago to Oracle is too large. You wanted varchar2(10), but you accidentally set it to varchar2(100). So with data in it, you wanted to alter the table's structure so that the field is decreased to varchar2(10) only.

To our cleverity, we started to use the alter command. "ALTER table_name MODIFY field_too_long VARCHAR2(10);". But guess what? Oracle will immediately complaint "ORA-01441: cannot decrease column length because some value is too big".

After some finding on the Net, only I realized that not only in Oracle, even DB2 also face the same problem, you can alway increase but not decrease a field length. MSSQL2000 is able to let the user to decrease it field length, as long as the existing data is shorter or the same with the new length.

Actually, from my point of view there are 2 turnarounds for this problem,
1) Either you export everything out, modify the script, remove the original database and import everything in.
2) Or, change the field to an "allow null" field, export the field data out, remove everything in the field to null, alter the table, import all the field data in and set it to "not null" again. "NULL" field does not hold any restriction, if all the values is null, you can even change to other datatype, as long there is no constrain.

Thursday, September 28, 2006

[Microsoft][SQLServer 2000 Driver for JDBC]Error

Today, my girlfriend was trying to install MsSQL 2000 server on my computer. After installing, she manage to start the database server. To her curiousity, she ask me whether I have some sample programs to test the connection.

I remember that I did an excel reader program on Java before. So I started Eclipse and wrote a main method to call an existing method which will create a connection and query to make a test run. To my disappointment, the programs fails to start due to some connection problem. I have change my setting to sync with my pc's MsSQL 2000 server, check the ODBC connection, but none of these will work. I even try telnet to port 1433 on my pc but each time I telnet, I failed to connect to it.

Eagerly to solve the problem, I try searching my answer online. Luckly for me, many people face the same error message before. After reading some comments online, some of them suggested to change the server's authentication mode, change port number and even create another user. After wasted some of my time on these helpless solutions, I decided to search for more info online. After somemore reading and minor research, I came across with a comment which reminds me of something which I have did before, update the MsSQL 2000 Server to service pack 4.

It took me quite some time to finish downloading MsSQL 2000 server sp4 update. After the update,restart of my pc and before running my test program, I did the telnet again. This time it works. Finally, I manage to connect my program to the server and successfully query it too. Happy~~~ :-)

Just a word of reminder, before running anything on a newly installed MsSQL 2000 server, please keep in mind that to update the service pack to sp4. You may save yourself more time on other purpose, rather than like me, spending the whole night looking for the connection solution.