Using your mind in every thing (alter table add column with constraint scenario )

April 25, 2006

In the name of Allah

If you have any thing want to do think , imagine and dream how to do this thing

improve your dreams

then start to do

Real example

Problem : adding column to database table with NOT NULL constrain

First Thinking (Thinking code is under)

Copy the data to temp table

Truncate the table

Insert the old data with new values

NO IT'S OBSELETE WAY

Second Way

Altering the table with the new column but without the constraint

Update the column with the desired value

Alter the table again with the constraint

MORE EFFICIENT BUT SURE THERE ARE BETTER WAYS

Third way

Alter the table with default value

Third way (another method)

Alter the table with DEFERRABLE parameter

which didn't enforce the constraint in the old data

first

I won't write this code try it your self

second

  ALTER TABLE my_table
 ADD  (
 CREATED DATE,
 CREATOR VARCHAR2(8))
/

UPDATE my_table SET CREATOR='EXPRESS' , CREATED=SYSDATE;

 ALTER TABLE RENTER_CAR
 MODIFY (
 CREATED DATE NOT NULL ,
 CREATOR VARCHAR2(8) NOT NULL
)
/

third

ALTER TABLE my_table
 ADD  (
 CREATED DATE default sysdate not null,
 CREATOR VARCHAR2(8) default user not null
 )

Third way (2nd)

  ALTER TABLE my_table
ADD  (
CREATED DATE  not null DEFERRABLE ,
CREATOR VARCHAR2(8)  not null DEFERRABLE
)
/


Google offer jobs in Moon

April 4, 2006

WOW
This is really happen google offer jobs at moon
<a href="http://www.google.com/jobs/lunar_job.html">http://www.google.com/jobs/lunar_job.html</a&gt;

Why a lunar location?
They say :
It's a logical question to ask. Google's current engineering facilities in the United States, India and Switzerland are all leaders in search technology development. However, by locating a research and technology center on the Moon, Google engineers will be able to experiment with an entirely different set of parameters. For example, imagine tapping unlimited solar energy to drive megawatt data centers and power innumerable arrays of massively parallel lava lamps, with ample no-cost cooling available to regulate the temperature of server farms sprawling over acres of land unblighted by sentient lifeforms or restrictive zoning ordinances.

also there are no space problem