Posts

How to change the size of the Android emulator

If your emulator popup is too big in Eclipse; follow the steps below to reduce the size of the Android emulator Go to Run >> Run Configurations . Select your application on the left side. Click on "Target"  tab on the right panel. Scroll down to the bottom and input the following under the "Emulator launch parameters" . Enter the follow command in the additional command options text box -cpu-delay 0 -no-boot-anim -cache ./cache -scale 0.8 This reduces your emulator size by 80%, and remove boot-up Android animation.

Concatenate files using MS-DOS

One or more files can be concatenated and saved to a single file using the very helpful copy command available in MS-DOS. The usage of it as follows, copy <multiple file names separated by the plus(+) operator> <resulting file name > Ex: copy File1.txt+File2.txt File3.txt copy *.* File3.txt

Updating a table using joins in Oracle

Scalar sub query UPDATE x SET foo = (SELECT y.foo FROM y WHERE y.bar = x.bar); Scalar sub query with existential predicate UPDATE x SET foo = ( SELECT y.foo FROM y WHERE y.bar = x.bar) WHERE EXISTS ( SELECT y.foo FROM y WHERE y.bar = x.bar); Updatable view (requires foreign key from x to y) UPDATE ( SELECT x.foo AS old_foo, y.foo AS new_foo FROM x, y WHERE y.bar = x.bar) SET old_foo = new_foo; Merge Update MERGE INTO x USING (SELECT foo, bar FROM y ) y ON (y.bar = x.bar) WHEN matched THEN UPDATE SET x.foo = y.foo; Note: WHEN NOT MATCHED construct is optional

Modify a column data type or size in Oracle

Modifying a column data type or size in Oracle is done by using the constructs below Changing the column data type: ALTER TABLE <Table name> MODIFY ( <Column Name> <New data type>) Changing the size of a column: (Assuming the previous data type of column was varchar2 with the length of 20 and it needs to be changed to 10) ALTER TABLE <Table name> MODIFY ( <Column Name> VARCHAR2(10)) Note: Text within <> indicate the parameters that need to be replaced.

Rename a column in Oracle

Renaming a column in Oracle is done by using the construct below ALTER TABLE <Table name> RENAME COLUMN <old column name> TO <new column name> Note: Text within <> indicate the parameters that need to be replaced.

Connecting to Oracle using SQL Plus

The following are the steps needs to connect to an Oracle database using SQL Plus Open command prompt - Windows > Run > cmd.exe Traverse to the path where oracle client is installed. In my case it is C:\Oracle\Ora11g_32\Client11g\bin Run the command sqlplus username/password@server