Friday, September 23, 2005

when i installed Oracle 9i i had created 2 database on the Server(Windows XP) through GUI Database Administration.

After that i went to My computer Properties and went there and stored ORACLE_SID as my one DBName. Now when i want to connect to oracle with this command in

SQLPLUSW / NOLOG "conn / as sysdba" it gives an Error as "Error - ORA - 24314 Service handle not initialized" and when i try to connect to Oracle through normal SQL giving user name Scott/tiger it gives another Error "ORA 12560 Protocol adapter error”

1. check whether the oracle services r running in the control panel - services. all the oracle services start with oracle.

2. check whether the listerner is running
in the command prompt
c:\ set oracle_sid=
c:\ lsnrctl status
c:\lsnrctl stop
c:\lsnrctl start

3. check whether u have created the connect string in the tnsnames.
use net8 easy config to create one.

1st point in point 2 should solve the issue

Thursday, September 22, 2005

For dynamic orderby clauses in Stored procedure

CREATE PROCEDURE getEmployees ( @OrderByClause varchar(100) ) AS

-- Create a variable @SQLStatement
DECLARE @SQLStatement varchar(255)

-- Enter the dynamic SQL statement into the
-- variable @SQLStatement
SELECT @SQLStatement = 'SELECT EmployeeID, FirstName, LastName, SSN, Salary ' +
'FROM Employees ORDER BY ' + @OrderByClause

-- Execute the SQL statement

Web Hosting Cheap PHP Plans Also at For free flags of the world