Thursday, November 18, 2010

Oracle: Rename a column in a table

Oracle provides "alter table" syntax to rename data columns in-place in this form:

ALTER TABLE
table_name
RENAME COLUMN
old_column_name
TO
new_column_name;

Here are the example of Oracle "alter table" syntax to rename data columns:

ALTER TABLE
pick_line
RENAME COLUMN
"VOLUME"
TO
"volume";

Saturday, November 13, 2010

Dos Command to read JDK Path from registry

These lines of code will get the JDK path from registry:


set KeyName=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
set Cmd=reg query "%KeyName%" /s
for /f "tokens=2*" %%i in ('%Cmd% ^| find "JavaHome"') do set JVM_HOME=%%j
echo Path is : %JVM_HOMPublish PostE%

Wednesday, November 10, 2010

Create Dependencies between Windows Services

The following steps need to be performed in order to create a dependency.

1-Backup your current registry settings.

2-Run 'regedit' to open your registry.

3-Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and locate the
service that you need to set a dependency for.

4-Open the 'DependOnService' key on the right side. If the selected service does not have a 'DependOnService' key, then create one by right-clicking and selecting New > Multi-String Value.

5-In the value field, enter the names of all services that the current service will depend on. Each service name must be entered properly and on a separate line.

6-Click OK, close your registry and restart your machine.